From ed8aee6c62e6a18af6a9c5a9114fc1142563f37c Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 5 Oct 2020 21:23:56 +0000 Subject: [PATCH] Generated from 556280d69e0cd3ace69d8326e24220a8eae7d628 --- .../mgmt-v2019_12_10_preview/pom.xml | 135 ++ .../v2019_12_10_preview/Application.java | 343 +++++ .../v2019_12_10_preview/ApplicationGroup.java | 165 +++ .../ApplicationGroupPatch.java | 99 ++ .../ApplicationGroupType.java | 41 + .../ApplicationGroups.java | 25 + .../v2019_12_10_preview/ApplicationPatch.java | 258 ++++ .../v2019_12_10_preview/ApplicationType.java | 41 + .../v2019_12_10_preview/Applications.java | 53 + .../AzureEntityResource.java | 34 + .../v2019_12_10_preview/CloudError.java | 69 + .../CommandLineSetting.java | 44 + .../v2019_12_10_preview/Desktop.java | 107 ++ .../v2019_12_10_preview/DesktopList.java | 32 + .../v2019_12_10_preview/DesktopPatch.java | 98 ++ .../v2019_12_10_preview/Desktops.java | 40 + .../v2019_12_10_preview/HostPool.java | 439 ++++++ .../v2019_12_10_preview/HostPoolPatch.java | 363 +++++ .../v2019_12_10_preview/HostPoolType.java | 41 + .../v2019_12_10_preview/HostPools.java | 25 + .../v2019_12_10_preview/LoadBalancerType.java | 44 + .../v2019_12_10_preview/Operations.java | 27 + .../PersonalDesktopAssignmentType.java | 41 + .../PreferredAppGroupType.java | 44 + .../v2019_12_10_preview/RegistrationInfo.java | 97 ++ .../RegistrationInfoPatch.java | 71 + .../RegistrationTokenOperation.java | 44 + .../ResourceProviderOperation.java | 69 + .../ResourceProviderOperationDisplay.java | 121 ++ .../ResourceProviderOperationList.java | 26 + .../v2019_12_10_preview/SendMessage.java | 69 + .../v2019_12_10_preview/SessionHost.java | 145 ++ .../v2019_12_10_preview/SessionHostPatch.java | 72 + .../v2019_12_10_preview/SessionHosts.java | 52 + .../v2019_12_10_preview/SessionState.java | 53 + .../v2019_12_10_preview/StartMenuItem.java | 65 + .../v2019_12_10_preview/StartMenuItems.java | 29 + .../v2019_12_10_preview/Status.java | 53 + .../v2019_12_10_preview/UpdateState.java | 50 + .../v2019_12_10_preview/UserSession.java | 61 + .../v2019_12_10_preview/UserSessions.java | 89 ++ .../v2019_12_10_preview/Workspace.java | 156 ++ .../v2019_12_10_preview/WorkspacePatch.java | 125 ++ .../v2019_12_10_preview/Workspaces.java | 25 + .../implementation/ApplicationGroupImpl.java | 125 ++ .../implementation/ApplicationGroupInner.java | 141 ++ .../implementation/ApplicationGroupsImpl.java | 138 ++ .../ApplicationGroupsInner.java | 1205 +++++++++++++++ .../implementation/ApplicationImpl.java | 254 ++++ .../implementation/ApplicationInner.java | 263 ++++ .../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 | 308 ++++ .../DesktopVirtualizationManager.java | 195 +++ .../implementation/DesktopsImpl.java | 63 + .../implementation/DesktopsInner.java | 436 ++++++ .../implementation/HostPoolImpl.java | 272 ++++ .../implementation/HostPoolInner.java | 384 +++++ .../implementation/HostPoolsImpl.java | 138 ++ .../implementation/HostPoolsInner.java | 1068 ++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../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 + .../v2019_12_10_preview/package-info.java | 10 + 88 files changed, 15644 insertions(+) create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/pom.xml create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Application.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroup.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroupPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroupType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroups.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Applications.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/AzureEntityResource.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CloudError.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CommandLineSetting.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Desktop.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/DesktopList.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/DesktopPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Desktops.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPool.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPools.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/LoadBalancerType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Operations.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/PersonalDesktopAssignmentType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/PreferredAppGroupType.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationInfo.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationInfoPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationTokenOperation.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperation.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperationDisplay.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperationList.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SendMessage.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHost.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHostPatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHosts.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionState.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/StartMenuItem.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/StartMenuItems.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Status.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UpdateState.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UserSession.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UserSessions.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Workspace.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/WorkspacePatch.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Workspaces.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopListImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopListInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationAPIClientImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationManager.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/IdParsingUtils.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/OperationsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/OperationsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/PageImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ResourceProviderOperationListImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ResourceProviderOperationListInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionsImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionsInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspaceImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspaceInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspacesImpl.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspacesInner.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/package-info.java create mode 100644 sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/package-info.java diff --git a/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/pom.xml b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/pom.xml new file mode 100644 index 0000000000000..b3af00adacb96 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Application.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Application.java new file mode 100644 index 0000000000000..8b0ff322edd31 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Application.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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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.v2019_12_10_preview.implementation.DesktopVirtualizationManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @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 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 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 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.WithCommandLineArguments, DefinitionStages.WithDescription, DefinitionStages.WithFilePath, DefinitionStages.WithFriendlyName, DefinitionStages.WithIconIndex, DefinitionStages.WithIconPath, DefinitionStages.WithShowInPortal { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCommandLineArguments, UpdateStages.WithCommandLineSetting, UpdateStages.WithDescription, UpdateStages.WithFilePath, UpdateStages.WithFriendlyName, UpdateStages.WithIconIndex, UpdateStages.WithIconPath, UpdateStages.WithShowInPortal, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * 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 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroup.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroup.java new file mode 100644 index 0000000000000..4f1792c3f3815 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroupPatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroupPatch.java new file mode 100644 index 0000000000000..2c717f121c4ec --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroupType.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroupType.java new file mode 100644 index 0000000000000..88d8d19b09103 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroups.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationGroups.java new file mode 100644 index 0000000000000..bcc2facc1899c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationPatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationPatch.java new file mode 100644 index 0000000000000..ed894c8590d4a --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationPatch.java @@ -0,0 +1,258 @@ +/** + * 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.v2019_12_10_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; + + /** + * 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; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationType.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ApplicationType.java new file mode 100644 index 0000000000000..3056d8720631e --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Applications.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Applications.java new file mode 100644 index 0000000000000..3895260b05055 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/AzureEntityResource.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/AzureEntityResource.java new file mode 100644 index 0000000000000..fe7eacd7c044d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CloudError.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CloudError.java new file mode 100644 index 0000000000000..7262f8fbe0e8f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CloudError.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.v2019_12_10_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response of an operation failure. + */ +public class CloudError { + /** + * 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 CloudError object itself. + */ + public CloudError 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 CloudError object itself. + */ + public CloudError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CommandLineSetting.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/CommandLineSetting.java new file mode 100644 index 0000000000000..a8766b7e85603 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Desktop.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Desktop.java new file mode 100644 index 0000000000000..12adf89aa6de5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/DesktopList.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/DesktopList.java new file mode 100644 index 0000000000000..19a45c76eb8fb --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.implementation.DesktopListInner; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/DesktopPatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/DesktopPatch.java new file mode 100644 index 0000000000000..b883a1d5faf6e --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Desktops.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Desktops.java new file mode 100644 index 0000000000000..0ddd3418881f3 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPool.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPool.java new file mode 100644 index 0000000000000..f0df901c65a15 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPool.java @@ -0,0 +1,439 @@ +/** + * 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.v2019_12_10_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.v2019_12_10_preview.implementation.DesktopVirtualizationManager; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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 ssoContext value. + */ + String ssoContext(); + + /** + * @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 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 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.WithSsoContext, 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.WithSsoContext, 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 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 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolPatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolPatch.java new file mode 100644 index 0000000000000..f0f7138faf755 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolPatch.java @@ -0,0 +1,363 @@ +/** + * 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.v2019_12_10_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; + + /** + * 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 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolType.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPoolType.java new file mode 100644 index 0000000000000..c3ecf5833ce28 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPools.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/HostPools.java new file mode 100644 index 0000000000000..57845ece1c9aa --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/LoadBalancerType.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/LoadBalancerType.java new file mode 100644 index 0000000000000..bbe3c86b65ca7 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Operations.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Operations.java new file mode 100644 index 0000000000000..5e0be2c1e1af8 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/PersonalDesktopAssignmentType.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/PersonalDesktopAssignmentType.java new file mode 100644 index 0000000000000..27ef6a1419d5b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/PreferredAppGroupType.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/PreferredAppGroupType.java new file mode 100644 index 0000000000000..e14ca18367123 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationInfo.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationInfo.java new file mode 100644 index 0000000000000..3619e3c790929 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationInfoPatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationInfoPatch.java new file mode 100644 index 0000000000000..57d00613791a5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationTokenOperation.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/RegistrationTokenOperation.java new file mode 100644 index 0000000000000..f23aa28950cf1 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperation.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperation.java new file mode 100644 index 0000000000000..b32d2fb4f4b7d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperationDisplay.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperationDisplay.java new file mode 100644 index 0000000000000..3808540b66f21 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperationList.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/ResourceProviderOperationList.java new file mode 100644 index 0000000000000..2d7e1774cddcf --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.implementation.DesktopVirtualizationManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SendMessage.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SendMessage.java new file mode 100644 index 0000000000000..8e2a54a06619f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHost.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHost.java new file mode 100644 index 0000000000000..47e14a2e1ea0b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHostPatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHostPatch.java new file mode 100644 index 0000000000000..de1e8b2f1ef16 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHosts.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionHosts.java new file mode 100644 index 0000000000000..5c3861de98652 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionState.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/SessionState.java new file mode 100644 index 0000000000000..726e1280e79e4 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/StartMenuItem.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/StartMenuItem.java new file mode 100644 index 0000000000000..d03a466e5ce6b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.implementation.StartMenuItemInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/StartMenuItems.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/StartMenuItems.java new file mode 100644 index 0000000000000..82e2e06e9ebea --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Status.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Status.java new file mode 100644 index 0000000000000..69dea78cc19e5 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UpdateState.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UpdateState.java new file mode 100644 index 0000000000000..14216bc49b885 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UserSession.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UserSession.java new file mode 100644 index 0000000000000..909ee15146940 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.implementation.UserSessionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UserSessions.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/UserSessions.java new file mode 100644 index 0000000000000..446c91c9fab9c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Workspace.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Workspace.java new file mode 100644 index 0000000000000..28276e5ae4a5f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_preview.implementation.DesktopVirtualizationManager; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/WorkspacePatch.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/WorkspacePatch.java new file mode 100644 index 0000000000000..789521c9e11db --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Workspaces.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/Workspaces.java new file mode 100644 index 0000000000000..abc1293c0d1f0 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupImpl.java new file mode 100644 index 0000000000000..9a9cd73b52553 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationGroup; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationGroupPatch; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupInner.java new file mode 100644 index 0000000000000..c4ecff35b582a --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupsImpl.java new file mode 100644 index 0000000000000..9d2cd02e28b3a --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationGroups; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationGroupsInner.java new file mode 100644 index 0000000000000..e838117442f1e --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationImpl.java new file mode 100644 index 0000000000000..de3d7b4992b7d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationImpl.java @@ -0,0 +1,254 @@ +/** + * 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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationPatch; +import java.util.Map; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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 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 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 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 withShowInPortal(Boolean showInPortal) { + if (isInCreateMode()) { + this.inner().withShowInPortal(showInPortal); + } else { + this.updateParameter.withShowInPortal(showInPortal); + } + return this; + } + +} diff --git a/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationInner.java new file mode 100644 index 0000000000000..2835e75568cdf --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationInner.java @@ -0,0 +1,263 @@ +/** + * 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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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 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 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationsImpl.java new file mode 100644 index 0000000000000..5ea4150214f28 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ApplicationsInner.java new file mode 100644 index 0000000000000..35e2ec0d4efbb --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopImpl.java new file mode 100644 index 0000000000000..d9ad70a5a5114 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Desktop; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopInner.java new file mode 100644 index 0000000000000..ffbfd033da09b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopListImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopListImpl.java new file mode 100644 index 0000000000000..f8ee131b6373b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopListInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopListInner.java new file mode 100644 index 0000000000000..288a3fc838d1f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationAPIClientImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationAPIClientImpl.java new file mode 100644 index 0000000000000..c72bf7e61e87f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationAPIClientImpl.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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; + } + + /** + * 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 = "2019-12-10-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.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", "2019-12-10-preview"); + } +} diff --git a/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationManager.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationManager.java new file mode 100644 index 0000000000000..d665807467c1c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopVirtualizationManager.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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.v2019_12_10_preview.Operations; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Workspaces; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationGroups; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.StartMenuItems; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Applications; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Desktops; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.HostPools; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.UserSessions; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.SessionHosts; +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; + /** + * 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; + } + + /** + * 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopsImpl.java new file mode 100644 index 0000000000000..e5df3dd515809 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Desktops; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.DesktopList; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/DesktopsInner.java new file mode 100644 index 0000000000000..bf1c292a3da4b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolImpl.java new file mode 100644 index 0000000000000..11baf82119621 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolImpl.java @@ -0,0 +1,272 @@ +/** + * 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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.HostPool; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.HostPoolPatch; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.HostPoolType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.PersonalDesktopAssignmentType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.LoadBalancerType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.RegistrationInfo; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.PreferredAppGroupType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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 ssoContext() { + return this.inner().ssoContext(); + } + + @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 withSsoContext(String ssoContext) { + if (isInCreateMode()) { + this.inner().withSsoContext(ssoContext); + } else { + this.updateParameter.withSsoContext(ssoContext); + } + 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolInner.java new file mode 100644 index 0000000000000..c711fcdfd873f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolInner.java @@ -0,0 +1,384 @@ +/** + * 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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.HostPoolType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.PersonalDesktopAssignmentType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.LoadBalancerType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.RegistrationInfo; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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; + + /** + * 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 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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolsImpl.java new file mode 100644 index 0000000000000..87ebd28ee724f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.HostPools; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/HostPoolsInner.java new file mode 100644 index 0000000000000..ff80c1889996b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/IdParsingUtils.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..30c4f7e50fda4 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/OperationsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..98b829648e922 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/OperationsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..198a7878023e8 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/PageImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..e33a1768a409a --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ResourceProviderOperationListImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ResourceProviderOperationListImpl.java new file mode 100644 index 0000000000000..09782651b0e72 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ResourceProviderOperationList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ResourceProviderOperationListInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/ResourceProviderOperationListInner.java new file mode 100644 index 0000000000000..8d15de10f8e8f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostImpl.java new file mode 100644 index 0000000000000..3ba33b58ff075 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.SessionHost; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.SessionHostPatch; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Status; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostInner.java new file mode 100644 index 0000000000000..53a47326b81e6 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Status; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostsImpl.java new file mode 100644 index 0000000000000..b32ee87ac85c2 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.SessionHosts; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/SessionHostsInner.java new file mode 100644 index 0000000000000..a585497bb9b12 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemImpl.java new file mode 100644 index 0000000000000..2e4206738392c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemInner.java new file mode 100644 index 0000000000000..85d9cfef9c1ce --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemsImpl.java new file mode 100644 index 0000000000000..b1df9d66d105b --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.StartMenuItems; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/StartMenuItemsInner.java new file mode 100644 index 0000000000000..009fde8af7cdd --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionImpl.java new file mode 100644 index 0000000000000..cfa05287b5627 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.UserSession; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationType; +import org.joda.time.DateTime; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionInner.java new file mode 100644 index 0000000000000..bcceaa9692e6d --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.ApplicationType; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionsImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionsImpl.java new file mode 100644 index 0000000000000..47d265dea2ff9 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.UserSessions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionsInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/UserSessionsInner.java new file mode 100644 index 0000000000000..762d0d49c781f --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspaceImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspaceImpl.java new file mode 100644 index 0000000000000..4bc996a4e82ba --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Workspace; +import rx.Observable; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspaceInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspaceInner.java new file mode 100644 index 0000000000000..fe928f89042bf --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspacesImpl.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspacesImpl.java new file mode 100644 index 0000000000000..eb6a7f1092bc1 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_preview.Workspaces; +import com.microsoft.azure.management.desktopvirtualization.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspacesInner.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/WorkspacesInner.java new file mode 100644 index 0000000000000..15b6a0ce8cb30 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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.v2019_12_10_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-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/package-info.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/implementation/package-info.java new file mode 100644 index 0000000000000..9bc6bafc24d48 --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview.implementation; diff --git a/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/package-info.java b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_preview/package-info.java new file mode 100644 index 0000000000000..92d18c9f1240c --- /dev/null +++ b/sdk/desktopvirtualization/mgmt-v2019_12_10_preview/src/main/java/com/microsoft/azure/management/desktopvirtualization/v2019_12_10_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.v2019_12_10_preview;