diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 2ad405c45330..30bddfcb3181 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -392,7 +392,7 @@ com.azure.resourcemanager:azure-resourcemanager-extendedlocation;1.0.0-beta.2;1. com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.3.0;1.4.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-loadtesting;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md index 651f8577b78f..df9405a926bf 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/CHANGELOG.md @@ -1,14 +1,394 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2024-09-25) -### Features Added +- Azure Resource Manager DesktopVirtualization client library for Java. This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.Identity` was modified + +* `java.lang.String tenantId()` -> `java.util.UUID tenantId()` +* `java.lang.String principalId()` -> `java.util.UUID principalId()` + +### Features Added + +* `models.AppAttachPackage$UpdateStages` was added + +* `models.ImportPackageInfoRequest` was added + +* `models.FailHealthCheckOnStagingFailure` was added + +* `models.AppAttachPackagePatch` was added + +* `models.AppAttachPackagePatchProperties` was added + +* `models.ProvisioningState` was added + +* `models.AppAttachPackageInfoProperties` was added + +* `models.AppAttachPackage$Definition` was added + +* `models.RegistrationTokenList` was added + +* `models.AppAttachPackages` was added + +* `models.AppAttachPackage$Update` was added + +* `models.AppAttachPackageProperties` was added + +* `models.AppAttachPackageList` was added + +* `models.AppAttachPackage` was added + +* `models.AppAttachPackageInfoes` was added + +* `models.PackageTimestamped` was added + +* `models.AppAttachPackageArchitectures` was added + +* `models.RegistrationTokenMinimal` was added + +* `models.AppAttachPackage$DefinitionStages` was added + +#### `models.PrivateEndpointConnectionWithSystemData` was modified + +* `groupIds()` was added + +#### `models.ExpandMsixImageList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.HostPoolList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SessionHostList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StartMenuItemList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SessionHostHealthCheckReport` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.RegistrationInfoPatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.StartMenuItem` was modified + +* `systemData()` was added + +#### `models.OperationProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WorkspacePatch` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScalingHostPoolReference` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.DesktopPatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrivateEndpoint` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScalingSchedule` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MsixPackageApplications` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScalingPlanPersonalScheduleList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ResourceModelWithAllowedPropertySetPlan` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MsixPackageList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HostPool` was modified + +* `listRegistrationTokens()` was added +* `listRegistrationTokensWithResponse(com.azure.core.util.Context)` was added +* `appAttachPackageReferences()` was added + +#### `models.ResourceProviderOperationList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.HostPoolPatch` was modified + +* `type()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `id()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `systemData()` was added +* `name()` was added + +#### `models.ResourceModelWithAllowedPropertySet` was modified + +* `type()` was added +* `id()` was added +* `name()` was added +* `systemData()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ResourceProviderOperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SessionHostHealthCheckFailureDetails` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateLinkResource` was modified + +* `systemData()` was added + +#### `models.WorkspaceList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HostPoolProperties` was modified + +* `appAttachPackageReferences()` was added + +#### `DesktopVirtualizationManager` was modified + +* `appAttachPackages()` was added +* `appAttachPackageInfoes()` was added + +#### `models.ApplicationList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateEndpointConnection` was modified + +* `id()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `systemData()` was added +* `name()` was added +* `groupIds()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `type()` was added + +#### `models.ApplicationGroupList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Sku` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AgentUpdateProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LogSpecification` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SendMessage` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.AgentUpdatePatchProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScalingPlanPooledSchedulePatch` was modified + +* `id()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `name()` was added +* `type()` was added +* `systemData()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Identity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SessionHostPatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `id()` was added +* `name()` was added +* `type()` was added +* `systemData()` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MsixPackagePatch` was modified + +* `name()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `id()` was added +* `type()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `systemData()` was added + +#### `models.MsixImageUri` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScalingPlanPooledScheduleList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ApplicationGroupPatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `systemData()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `name()` was added +* `type()` was added +* `id()` was added + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MaintenanceWindowProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.MaintenanceWindowPatchProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScalingPlanPatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.PrivateLinkResourceListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ExpandMsixImage` was modified + +* `certificateName()` was added +* `certificateExpiry()` was added +* `systemData()` was added + +#### `models.ServiceSpecification` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Time` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.PrivateEndpointConnectionListResultWithSystemData` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ScalingPlanList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ScalingPlanPersonalSchedulePatch` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ResourceModelWithAllowedPropertySetIdentity` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `tenantId()` was added +* `principalId()` was added + +#### `models.MsixPackageDependencies` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UserSessionList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.HostPools` was modified + +* `listRegistrationTokens(java.lang.String,java.lang.String)` was added +* `listRegistrationTokensWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.DesktopList` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ApplicationPatch` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.Plan` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ResourceModelWithAllowedPropertySetSku` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.1.0 (2023-10-16) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md index b875cc8927bb..3117a8ce0042 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DesktopVirtualization client library for Java. -This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-2023-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-desktopvirtualization - 1.1.0 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -94,9 +90,10 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md index 02e1653efaad..904b9a25fb83 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md @@ -1,6 +1,19 @@ # Code snippets and samples +## AppAttachPackage + +- [CreateOrUpdate](#appattachpackage_createorupdate) +- [Delete](#appattachpackage_delete) +- [GetByResourceGroup](#appattachpackage_getbyresourcegroup) +- [List](#appattachpackage_list) +- [ListByResourceGroup](#appattachpackage_listbyresourcegroup) +- [Update](#appattachpackage_update) + +## AppAttachPackageInfo + +- [ImportMethod](#appattachpackageinfo_importmethod) + ## ApplicationGroups - [CreateOrUpdate](#applicationgroups_createorupdate) @@ -31,6 +44,7 @@ - [GetByResourceGroup](#hostpools_getbyresourcegroup) - [List](#hostpools_list) - [ListByResourceGroup](#hostpools_listbyresourcegroup) +- [ListRegistrationTokens](#hostpools_listregistrationtokens) - [RetrieveRegistrationToken](#hostpools_retrieveregistrationtoken) - [Update](#hostpools_update) @@ -120,6 +134,227 @@ - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) - [Update](#workspaces_update) +### AppAttachPackage_CreateOrUpdate + +```java +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for AppAttachPackage CreateOrUpdate. + */ +public final class AppAttachPackageCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Create.json + */ + /** + * Sample code: AppAttachPackage_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .define("msixpackagefullname") + .withRegion("southcentralus") + .withExistingResourceGroup("resourceGroup1") + .withProperties(new AppAttachPackageProperties() + .withImage(new AppAttachPackageInfoProperties().withPackageAlias("msixpackagealias") + .withImagePath("imagepath") + .withPackageName("MsixPackageName") + .withPackageFamilyName("MsixPackage_FamilyName") + .withPackageFullName("MsixPackage_FullName") + .withDisplayName("displayname") + .withPackageRelativePath("packagerelativepath") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies( + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixPackage_Dependency_Name") + .withPublisher("MsixPackage_Dependency_Publisher") + .withMinVersion("packageDep_version"))) + .withVersion("packageversion") + .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("AppId") + .withDescription("PackageApplicationDescription") + .withAppUserModelId("AppUserModelId") + .withFriendlyName("FriendlyName") + .withIconImageName("Iconimagename") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withCertificateName("certName") + .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) + .withHostPoolReferences(Arrays.asList()) + .withKeyVaultUrl("fakeTokenPlaceholder") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE)) + .create(); + } +} +``` + +### AppAttachPackage_Delete + +```java +/** + * Samples for AppAttachPackage Delete. + */ +public final class AppAttachPackageDeleteSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Delete.json + */ + /** + * Sample code: AppAttachPackage_Delete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .deleteByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); + } +} +``` + +### AppAttachPackage_GetByResourceGroup + +```java +/** + * Samples for AppAttachPackage GetByResourceGroup. + */ +public final class AppAttachPackageGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Get.json + */ + /** + * Sample code: AppAttachPackage_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .getByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); + } +} +``` + +### AppAttachPackage_List + +```java +/** + * Samples for AppAttachPackage List. + */ +public final class AppAttachPackageListSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_ListBySubscription.json + */ + /** + * Sample code: AppAttachPackage_ListBySubscription. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageListBySubscription( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages().list("HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); + } +} +``` + +### AppAttachPackage_ListByResourceGroup + +```java +/** + * Samples for AppAttachPackage ListByResourceGroup. + */ +public final class AppAttachPackageListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_ListByResourceGroup.json + */ + /** + * Sample code: AppAttachPackage_ListByResourceGroup. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageListByResourceGroup( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .listByResourceGroup("resourceGroup1", "HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); + } +} +``` + +### AppAttachPackage_Update + +```java +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; + +/** + * Samples for AppAttachPackage Update. + */ +public final class AppAttachPackageUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Update.json + */ + /** + * Sample code: AppAttachPackage_Update. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + AppAttachPackage resource = manager.appAttachPackages() + .getByResourceGroupWithResponse("resourceGroup1", "msixpackagefullname", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### AppAttachPackageInfo_ImportMethod + +```java +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; + +/** + * Samples for AppAttachPackageInfo ImportMethod. + */ +public final class AppAttachPackageInfoImportMethodSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackageInfo_Import_Post.json + */ + /** + * Sample code: AppAttachPackageInfo_Import. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageInfoImport( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackageInfoes() + .importMethod("resourceGroup1", "hostpool1", new ImportPackageInfoRequest().withPath("imagepath") + .withPackageArchitecture(AppAttachPackageArchitectures.X64), com.azure.core.util.Context.NONE); + } +} +``` + ### ApplicationGroups_CreateOrUpdate ```java @@ -127,20 +362,23 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupTy import java.util.HashMap; import java.util.Map; -/** Samples for ApplicationGroups CreateOrUpdate. */ +/** + * Samples for ApplicationGroups CreateOrUpdate. + */ public final class ApplicationGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Create.json */ /** * Sample code: ApplicationGroup_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() + public static void + applicationGroupCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() .define("applicationGroup1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") @@ -171,20 +409,23 @@ public final class ApplicationGroupsCreateOrUpdateSamples { ### ApplicationGroups_Delete ```java -/** Samples for ApplicationGroups Delete. */ +/** + * Samples for ApplicationGroups Delete. + */ public final class ApplicationGroupsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Delete.json */ /** * Sample code: ApplicationGroup_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() + public static void + applicationGroupDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() .deleteByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } } @@ -193,20 +434,23 @@ public final class ApplicationGroupsDeleteSamples { ### ApplicationGroups_GetByResourceGroup ```java -/** Samples for ApplicationGroups GetByResourceGroup. */ +/** + * Samples for ApplicationGroups GetByResourceGroup. + */ public final class ApplicationGroupsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Get.json */ /** * Sample code: ApplicationGroup_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() + public static void + applicationGroupGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } } @@ -215,18 +459,22 @@ public final class ApplicationGroupsGetByResourceGroupSamples { ### ApplicationGroups_List ```java -/** Samples for ApplicationGroups List. */ +/** + * Samples for ApplicationGroups List. + */ public final class ApplicationGroupsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListBySubscription.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_ListBySubscription.json */ /** * Sample code: ApplicationGroup_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + applicationGroupList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applicationGroups().list("applicationGroupType eq 'RailApplication'", com.azure.core.util.Context.NONE); } } @@ -235,26 +483,24 @@ public final class ApplicationGroupsListSamples { ### ApplicationGroups_ListByResourceGroup ```java -/** Samples for ApplicationGroups ListByResourceGroup. */ +/** + * Samples for ApplicationGroups ListByResourceGroup. + */ public final class ApplicationGroupsListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_ListByResourceGroup.json */ /** * Sample code: ApplicationGroup_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void applicationGroupListByResourceGroup( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() - .listByResourceGroup( - "resourceGroup1", - "applicationGroupType eq 'RailApplication'", - 10, - true, - 0, + manager.applicationGroups() + .listByResourceGroup("resourceGroup1", "applicationGroupType eq 'RailApplication'", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -267,25 +513,26 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroup; import java.util.HashMap; import java.util.Map; -/** Samples for ApplicationGroups Update. */ +/** + * Samples for ApplicationGroups Update. + */ public final class ApplicationGroupsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Update.json */ /** * Sample code: ApplicationGroups_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupsUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ApplicationGroup resource = - manager - .applicationGroups() - .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + applicationGroupsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ApplicationGroup resource = manager.applicationGroups() + .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withDescription("des1") .withFriendlyName("friendly") @@ -312,20 +559,23 @@ public final class ApplicationGroupsUpdateSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -/** Samples for Applications CreateOrUpdate. */ +/** + * Samples for Applications CreateOrUpdate. + */ public final class ApplicationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Create.json */ /** * Sample code: Application_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() + public static void + applicationCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() .define("application1") .withExistingApplicationGroup("resourceGroup1", "applicationGroup1") .withCommandLineSetting(CommandLineSetting.ALLOW) @@ -344,22 +594,25 @@ public final class ApplicationsCreateOrUpdateSamples { ### Applications_Delete ```java -/** Samples for Applications Delete. */ +/** + * Samples for Applications Delete. + */ public final class ApplicationsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Delete.json */ /** * Sample code: Application_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() - .deleteWithResponse( - "resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); + public static void + applicationDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() + .deleteWithResponse("resourceGroup1", "applicationGroup1", "application1", + com.azure.core.util.Context.NONE); } } ``` @@ -367,20 +620,23 @@ public final class ApplicationsDeleteSamples { ### Applications_Get ```java -/** Samples for Applications Get. */ +/** + * Samples for Applications Get. + */ public final class ApplicationsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Get.json */ /** * Sample code: Application_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() + public static void + applicationGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); } } @@ -389,20 +645,23 @@ public final class ApplicationsGetSamples { ### Applications_List ```java -/** Samples for Applications List. */ +/** + * Samples for Applications List. + */ public final class ApplicationsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_List.json */ /** * Sample code: Applications_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationsList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() + public static void + applicationsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() .list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -415,26 +674,26 @@ import com.azure.resourcemanager.desktopvirtualization.models.Application; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -/** Samples for Applications Update. */ +/** + * Samples for Applications Update. + */ public final class ApplicationsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Update.json */ /** * Sample code: Application_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - Application resource = - manager - .applications() - .getWithResponse( - "resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + applicationUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + Application resource = manager.applications() + .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withDescription("des1") .withFriendlyName("friendly") .withFilePath("path") @@ -452,20 +711,23 @@ public final class ApplicationsUpdateSamples { ### Desktops_Get ```java -/** Samples for Desktops Get. */ +/** + * Samples for Desktops Get. + */ public final class DesktopsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Desktop_Get.json */ /** * Sample code: Desktop_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void desktopGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .desktops() + public static void + desktopGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops() .getWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", com.azure.core.util.Context.NONE); } } @@ -474,18 +736,22 @@ public final class DesktopsGetSamples { ### Desktops_List ```java -/** Samples for Desktops List. */ +/** + * Samples for Desktops List. + */ public final class DesktopsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Desktop_List.json */ /** * Sample code: Desktop_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void desktopList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + desktopList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops().list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -496,24 +762,24 @@ public final class DesktopsListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; -/** Samples for Desktops Update. */ +/** + * Samples for Desktops Update. + */ public final class DesktopsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Desktop_Update.json */ /** * Sample code: Desktop_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void desktopUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .desktops() - .updateWithResponse( - "resourceGroup1", - "applicationGroup1", - "SessionDesktop", + public static void + desktopUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops() + .updateWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", new DesktopPatch().withDescription("des1").withFriendlyName("friendly"), com.azure.core.util.Context.NONE); } @@ -539,20 +805,23 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for HostPools CreateOrUpdate. */ +/** + * Samples for HostPools CreateOrUpdate. + */ public final class HostPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Create.json */ /** * Sample code: HostPool_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .hostPools() + public static void + hostPoolCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() .define("hostPool1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") @@ -565,8 +834,7 @@ public final class HostPoolsCreateOrUpdateSamples { .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) .withMaxSessionLimit(999999) .withRegistrationInfo( - new RegistrationInfoInner() - .withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) + new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) .withVmTemplate("{json:json}") .withSsoadfsAuthority("https://adfs") @@ -574,16 +842,12 @@ public final class HostPoolsCreateOrUpdateSamples { .withSsoClientSecretKeyVaultPath("https://keyvault/secret") .withSsoSecretType(SsoSecretType.SHARED_KEY) .withStartVMOnConnect(false) - .withAgentUpdate( - new AgentUpdateProperties() - .withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays - .asList( - new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withAgentUpdate(new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("Alaskan Standard Time") + .withMaintenanceWindows( + Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) .create(); } @@ -604,18 +868,22 @@ public final class HostPoolsCreateOrUpdateSamples { ### HostPools_Delete ```java -/** Samples for HostPools Delete. */ +/** + * Samples for HostPools Delete. + */ public final class HostPoolsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Delete.json */ /** * Sample code: HostPool_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + hostPoolDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().deleteWithResponse("resourceGroup1", "hostPool1", true, com.azure.core.util.Context.NONE); } } @@ -624,20 +892,23 @@ public final class HostPoolsDeleteSamples { ### HostPools_GetByResourceGroup ```java -/** Samples for HostPools GetByResourceGroup. */ +/** + * Samples for HostPools GetByResourceGroup. + */ public final class HostPoolsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Get.json */ /** * Sample code: HostPool_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .hostPools() + public static void + hostPoolGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } @@ -646,18 +917,22 @@ public final class HostPoolsGetByResourceGroupSamples { ### HostPools_List ```java -/** Samples for HostPools List. */ +/** + * Samples for HostPools List. + */ public final class HostPoolsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_List.json */ /** * Sample code: HostPool_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + hostPoolList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().list(10, true, 0, com.azure.core.util.Context.NONE); } } @@ -666,14 +941,18 @@ public final class HostPoolsListSamples { ### HostPools_ListByResourceGroup ```java -/** Samples for HostPools ListByResourceGroup. */ +/** + * Samples for HostPools ListByResourceGroup. + */ public final class HostPoolsListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_ListByResourceGroup.json */ /** * Sample code: HostPool_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void hostPoolListByResourceGroup( @@ -683,23 +962,51 @@ public final class HostPoolsListByResourceGroupSamples { } ``` +### HostPools_ListRegistrationTokens + +```java +/** + * Samples for HostPools ListRegistrationTokens. + */ +public final class HostPoolsListRegistrationTokensSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPools_ListRegistrationToken_Post.json + */ + /** + * Sample code: HostPools_ListRegistrationToken_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void hostPoolsListRegistrationTokenPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() + .listRegistrationTokensWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} +``` + ### HostPools_RetrieveRegistrationToken ```java -/** Samples for HostPools RetrieveRegistrationToken. */ +/** + * Samples for HostPools RetrieveRegistrationToken. + */ public final class HostPoolsRetrieveRegistrationTokenSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPools_RetrieveRegistrationToken_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPools_RetrieveRegistrationToken_Post.json */ /** * Sample code: HostPools_RetrieveRegistrationToken_Post. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void hostPoolsRetrieveRegistrationTokenPost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .hostPools() + manager.hostPools() .retrieveRegistrationTokenWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } @@ -723,25 +1030,26 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for HostPools Update. */ +/** + * Samples for HostPools Update. + */ public final class HostPoolsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Update.json */ /** * Sample code: HostPool_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - HostPool resource = - manager - .hostPools() - .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + hostPoolUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + HostPool resource = manager.hostPools() + .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withFriendlyName("friendly") .withDescription("des1") @@ -749,8 +1057,7 @@ public final class HostPoolsUpdateSamples { .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) .withRegistrationInfo( - new RegistrationInfoPatch() - .withExpirationTime(OffsetDateTime.parse("2020-10-01T15:01:54.9571247Z")) + new RegistrationInfoPatch().withExpirationTime(OffsetDateTime.parse("2020-10-01T15:01:54.9571247Z")) .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) .withVmTemplate("{json:json}") .withSsoadfsAuthority("https://adfs") @@ -759,15 +1066,12 @@ public final class HostPoolsUpdateSamples { .withSsoSecretType(SsoSecretType.SHARED_KEY) .withStartVMOnConnect(false) .withAgentUpdate( - new AgentUpdatePatchProperties() - .withType(SessionHostComponentUpdateType.SCHEDULED) + new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.SCHEDULED) .withUseSessionHostLocalTime(false) .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays - .asList( - new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withMaintenanceWindows(Arrays.asList( + new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) .apply(); } @@ -790,24 +1094,24 @@ public final class HostPoolsUpdateSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; -/** Samples for MsixImages Expand. */ +/** + * Samples for MsixImages Expand. + */ public final class MsixImagesExpandSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixImage_Expand_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixImage_Expand_Post.json */ /** * Sample code: MsixImage_Expand. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void msixImageExpand( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixImages() - .expand( - "resourceGroup1", - "hostpool1", - new MsixImageUri().withUri("imagepath"), + public static void + msixImageExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixImages() + .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("imagepath"), com.azure.core.util.Context.NONE); } } @@ -821,20 +1125,23 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDepende import java.time.OffsetDateTime; import java.util.Arrays; -/** Samples for MsixPackages CreateOrUpdate. */ +/** + * Samples for MsixPackages CreateOrUpdate. + */ public final class MsixPackagesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Create.json */ /** * Sample code: MSIXPackage_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixPackages() + public static void + mSIXPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() .define("msixpackagefullname") .withExistingHostPool("resourceGroup1", "hostpool1") .withImagePath("imagepath") @@ -845,25 +1152,18 @@ public final class MsixPackagesCreateOrUpdateSamples { .withIsRegularRegistration(false) .withIsActive(false) .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("MsixTest_Dependency_Name") - .withPublisher("PublishedName") - .withMinVersion("version"))) + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") + .withPublisher("PublishedName") + .withMinVersion("version"))) .withVersion("version") .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("ApplicationId") - .withDescription("application-desc") - .withAppUserModelId("AppUserModelId") - .withFriendlyName("friendlyname") - .withIconImageName("Apptile") - .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) - .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") + .withDescription("application-desc") + .withAppUserModelId("AppUserModelId") + .withFriendlyName("friendlyname") + .withIconImageName("Apptile") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) .create(); } } @@ -872,20 +1172,23 @@ public final class MsixPackagesCreateOrUpdateSamples { ### MsixPackages_Delete ```java -/** Samples for MsixPackages Delete. */ +/** + * Samples for MsixPackages Delete. + */ public final class MsixPackagesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Delete.json */ /** * Sample code: MSIXPackage_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixPackages() + public static void + mSIXPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() .deleteWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } } @@ -894,20 +1197,23 @@ public final class MsixPackagesDeleteSamples { ### MsixPackages_Get ```java -/** Samples for MsixPackages Get. */ +/** + * Samples for MsixPackages Get. + */ public final class MsixPackagesGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Get.json */ /** * Sample code: MSIXPackage_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixPackages() + public static void + mSIXPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() .getWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } } @@ -916,18 +1222,22 @@ public final class MsixPackagesGetSamples { ### MsixPackages_List ```java -/** Samples for MsixPackages List. */ +/** + * Samples for MsixPackages List. + */ public final class MsixPackagesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_List.json */ /** * Sample code: MSIXPackage_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + mSIXPackageList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages().list("resourceGroup1", "hostpool1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -938,23 +1248,25 @@ public final class MsixPackagesListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -/** Samples for MsixPackages Update. */ +/** + * Samples for MsixPackages Update. + */ public final class MsixPackagesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Update.json */ /** * Sample code: MSIXPackage_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - MsixPackage resource = - manager - .msixPackages() - .getWithResponse("resourceGroup1", "hostpool1", "msixpackagefullname", com.azure.core.util.Context.NONE) - .getValue(); + public static void + mSIXPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + MsixPackage resource = manager.msixPackages() + .getWithResponse("resourceGroup1", "hostpool1", "msixpackagefullname", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withIsActive(true).withIsRegularRegistration(false).withDisplayName("displayname").apply(); } } @@ -963,18 +1275,22 @@ public final class MsixPackagesUpdateSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/OperationDescription_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * OperationDescription_List.json */ /** * Sample code: OperationDescription_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void operationDescriptionList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + operationDescriptionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } @@ -983,25 +1299,25 @@ public final class OperationsListSamples { ### PrivateEndpointConnections_DeleteByHostPool ```java -/** Samples for PrivateEndpointConnections DeleteByHostPool. */ +/** + * Samples for PrivateEndpointConnections DeleteByHostPool. + */ public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_DeleteByHostPool.json */ /** * Sample code: PrivateEndpointConnection_DeleteByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionDeleteByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .deleteByHostPoolWithResponse( - "resourceGroup1", - "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .deleteByHostPoolWithResponse("resourceGroup1", "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } ``` @@ -1009,25 +1325,25 @@ public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { ### PrivateEndpointConnections_DeleteByWorkspace ```java -/** Samples for PrivateEndpointConnections DeleteByWorkspace. */ +/** + * Samples for PrivateEndpointConnections DeleteByWorkspace. + */ public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_DeleteByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_DeleteByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionDeleteByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .deleteByWorkspaceWithResponse( - "resourceGroup1", - "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .deleteByWorkspaceWithResponse("resourceGroup1", "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } ``` @@ -1035,24 +1351,24 @@ public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { ### PrivateEndpointConnections_GetByHostPool ```java -/** Samples for PrivateEndpointConnections GetByHostPool. */ +/** + * Samples for PrivateEndpointConnections GetByHostPool. + */ public final class PrivateEndpointConnectionsGetByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_GetByHostPool.json */ /** * Sample code: PrivateEndpointConnection_GetByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionGetByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .getByHostPoolWithResponse( - "resourceGroup1", - "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + manager.privateEndpointConnections() + .getByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } @@ -1061,25 +1377,25 @@ public final class PrivateEndpointConnectionsGetByHostPoolSamples { ### PrivateEndpointConnections_GetByWorkspace ```java -/** Samples for PrivateEndpointConnections GetByWorkspace. */ +/** + * Samples for PrivateEndpointConnections GetByWorkspace. + */ public final class PrivateEndpointConnectionsGetByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_GetByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_GetByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionGetByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .getByWorkspaceWithResponse( - "resourceGroup1", - "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .getByWorkspaceWithResponse("resourceGroup1", "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } ``` @@ -1087,20 +1403,23 @@ public final class PrivateEndpointConnectionsGetByWorkspaceSamples { ### PrivateEndpointConnections_ListByHostPool ```java -/** Samples for PrivateEndpointConnections ListByHostPool. */ +/** + * Samples for PrivateEndpointConnections ListByHostPool. + */ public final class PrivateEndpointConnectionsListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_ListByHostPool.json */ /** * Sample code: PrivateEndpointConnection_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); } } @@ -1109,20 +1428,23 @@ public final class PrivateEndpointConnectionsListByHostPoolSamples { ### PrivateEndpointConnections_ListByWorkspace ```java -/** Samples for PrivateEndpointConnections ListByWorkspace. */ +/** + * Samples for PrivateEndpointConnections ListByWorkspace. + */ public final class PrivateEndpointConnectionsListByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_ListByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_ListByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionListByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .listByWorkspace("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } @@ -1135,30 +1457,29 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointCon import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections UpdateByHostPool. */ +/** + * Samples for PrivateEndpointConnections UpdateByHostPool. + */ public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_UpdateByHostPool.json */ /** * Sample code: PrivateEndpointConnection_UpdateByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionUpdateByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .updateByHostPoolWithResponse( - "resourceGroup1", - "hostPool1", + manager.privateEndpointConnections() + .updateByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None")), com.azure.core.util.Context.NONE); } } @@ -1171,30 +1492,29 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointCon import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections UpdateByWorkspace. */ +/** + * Samples for PrivateEndpointConnections UpdateByWorkspace. + */ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_UpdateByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_UpdateByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionUpdateByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .updateByWorkspaceWithResponse( - "resourceGroup1", - "workspace1", + manager.privateEndpointConnections() + .updateByWorkspaceWithResponse("resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None")), com.azure.core.util.Context.NONE); } } @@ -1203,20 +1523,23 @@ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { ### PrivateLinkResources_ListByHostPool ```java -/** Samples for PrivateLinkResources ListByHostPool. */ +/** + * Samples for PrivateLinkResources ListByHostPool. + */ public final class PrivateLinkResourcesListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateLinkResources_ListByHostPool.json */ /** * Sample code: PrivateLinkResources_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateLinkResourcesListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateLinkResources() + manager.privateLinkResources() .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); } } @@ -1225,20 +1548,23 @@ public final class PrivateLinkResourcesListByHostPoolSamples { ### PrivateLinkResources_ListByWorkspace ```java -/** Samples for PrivateLinkResources ListByWorkspace. */ +/** + * Samples for PrivateLinkResources ListByWorkspace. + */ public final class PrivateLinkResourcesListByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateLinkResources_ListByWorkspace.json */ /** * Sample code: PrivateLinkResources_ListByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateLinkResourcesListByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateLinkResources() + manager.privateLinkResources() .listByWorkspace("resourceGroup1", "workspace1", null, null, null, com.azure.core.util.Context.NONE); } } @@ -1254,26 +1580,27 @@ import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; -/** Samples for ScalingPlanPersonalSchedules Create. */ +/** + * Samples for ScalingPlanPersonalSchedules Create. + */ public final class ScalingPlanPersonalSchedulesCreateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Create.json */ /** * Sample code: ScalingPlanPersonalSchedules_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesCreate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() + manager.scalingPlanPersonalSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) .withRampUpAutoStartHosts(StartupBehavior.ALL) .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) @@ -1307,22 +1634,25 @@ public final class ScalingPlanPersonalSchedulesCreateSamples { ### ScalingPlanPersonalSchedules_Delete ```java -/** Samples for ScalingPlanPersonalSchedules Delete. */ +/** + * Samples for ScalingPlanPersonalSchedules Delete. + */ public final class ScalingPlanPersonalSchedulesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Delete.json */ /** * Sample code: ScalingPlanPersonalSchedules_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesDelete( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() - .deleteWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE); + manager.scalingPlanPersonalSchedules() + .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } ``` @@ -1330,24 +1660,24 @@ public final class ScalingPlanPersonalSchedulesDeleteSamples { ### ScalingPlanPersonalSchedules_Get ```java -/** Samples for ScalingPlanPersonalSchedules Get. */ +/** + * Samples for ScalingPlanPersonalSchedules Get. + */ public final class ScalingPlanPersonalSchedulesGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Get.json */ /** * Sample code: ScalingPlanPersonalSchedules_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesGet( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() - .getWithResponse( - "resourceGroup1", - "PersonalScalingPlan1", - "PersonalScalingPlanSchedule", + manager.scalingPlanPersonalSchedules() + .getWithResponse("resourceGroup1", "PersonalScalingPlan1", "PersonalScalingPlanSchedule", com.azure.core.util.Context.NONE); } } @@ -1356,20 +1686,23 @@ public final class ScalingPlanPersonalSchedulesGetSamples { ### ScalingPlanPersonalSchedules_List ```java -/** Samples for ScalingPlanPersonalSchedules List. */ +/** + * Samples for ScalingPlanPersonalSchedules List. + */ public final class ScalingPlanPersonalSchedulesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_List.json */ /** * Sample code: ScalingPlanPersonalSchedules_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesList( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() + manager.scalingPlanPersonalSchedules() .list("resourceGroup1", "scalingPlan", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -1383,26 +1716,27 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOpe import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.Time; -/** Samples for ScalingPlanPersonalSchedules Update. */ +/** + * Samples for ScalingPlanPersonalSchedules Update. + */ public final class ScalingPlanPersonalSchedulesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesUpdate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlanPersonalSchedule resource = - manager - .scalingPlanPersonalSchedules() - .getWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + ScalingPlanPersonalSchedule resource = manager.scalingPlanPersonalSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withPeakStartTime(new Time().withHour(8).withMinute(0)) .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) .withPeakMinutesToWaitOnDisconnect(10) @@ -1432,26 +1766,27 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBal import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; -/** Samples for ScalingPlanPooledSchedules Create. */ +/** + * Samples for ScalingPlanPooledSchedules Create. + */ public final class ScalingPlanPooledSchedulesCreateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesCreate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() + manager.scalingPlanPooledSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .withRampUpMinimumHostsPct(20) @@ -1475,22 +1810,25 @@ public final class ScalingPlanPooledSchedulesCreateSamples { ### ScalingPlanPooledSchedules_Delete ```java -/** Samples for ScalingPlanPooledSchedules Delete. */ +/** + * Samples for ScalingPlanPooledSchedules Delete. + */ public final class ScalingPlanPooledSchedulesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Delete.json */ /** * Sample code: ScalingPlanPooledSchedules_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesDelete( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() - .deleteWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE); + manager.scalingPlanPooledSchedules() + .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } ``` @@ -1498,22 +1836,25 @@ public final class ScalingPlanPooledSchedulesDeleteSamples { ### ScalingPlanPooledSchedules_Get ```java -/** Samples for ScalingPlanPooledSchedules Get. */ +/** + * Samples for ScalingPlanPooledSchedules Get. + */ public final class ScalingPlanPooledSchedulesGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Get.json */ /** * Sample code: ScalingPlanPooledSchedules_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesGet( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() - .getWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE); + manager.scalingPlanPooledSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } ``` @@ -1521,20 +1862,23 @@ public final class ScalingPlanPooledSchedulesGetSamples { ### ScalingPlanPooledSchedules_List ```java -/** Samples for ScalingPlanPooledSchedules List. */ +/** + * Samples for ScalingPlanPooledSchedules List. + */ public final class ScalingPlanPooledSchedulesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_List.json */ /** * Sample code: ScalingPlanPooledSchedules_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesList( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() + manager.scalingPlanPooledSchedules() .list("resourceGroup1", "scalingPlan1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -1549,30 +1893,29 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBal import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; -/** Samples for ScalingPlanPooledSchedules Update. */ +/** + * Samples for ScalingPlanPooledSchedules Update. + */ public final class ScalingPlanPooledSchedulesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesUpdate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlanPooledSchedule resource = - manager - .scalingPlanPooledSchedules() - .getWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + ScalingPlanPooledSchedule resource = manager.scalingPlanPooledSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .withRampUpCapacityThresholdPct(80) .withPeakStartTime(new Time().withHour(8).withMinute(0)) @@ -1597,20 +1940,23 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for ScalingPlans Create. */ +/** + * Samples for ScalingPlans Create. + */ public final class ScalingPlansCreateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Create.json */ /** * Sample code: ScalingPlans_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + public static void + scalingPlansCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() .define("scalingPlan1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") @@ -1620,41 +1966,28 @@ public final class ScalingPlansCreateSamples { .withFriendlyName("Scaling Plan 1") .withHostPoolType(ScalingHostPoolType.POOLED) .withExclusionTag("value") - .withSchedules( - Arrays - .asList( - new ScalingSchedule() - .withName("schedule1") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences( - Arrays - .asList( - new ScalingHostPoolReference() - .withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withScalingPlanEnabled(true))) + .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") + .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.MONDAY, + ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY, + ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownCapacityThresholdPct(50) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withScalingPlanEnabled(true))) .create(); } @@ -1675,20 +2008,23 @@ public final class ScalingPlansCreateSamples { ### ScalingPlans_Delete ```java -/** Samples for ScalingPlans Delete. */ +/** + * Samples for ScalingPlans Delete. + */ public final class ScalingPlansDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Delete.json */ /** * Sample code: ScalingPlans_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + public static void + scalingPlansDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() .deleteByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); } } @@ -1697,20 +2033,23 @@ public final class ScalingPlansDeleteSamples { ### ScalingPlans_GetByResourceGroup ```java -/** Samples for ScalingPlans GetByResourceGroup. */ +/** + * Samples for ScalingPlans GetByResourceGroup. + */ public final class ScalingPlansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Get.json */ /** * Sample code: ScalingPlans_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + public static void + scalingPlansGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); } } @@ -1719,14 +2058,18 @@ public final class ScalingPlansGetByResourceGroupSamples { ### ScalingPlans_List ```java -/** Samples for ScalingPlans List. */ +/** + * Samples for ScalingPlans List. + */ public final class ScalingPlansListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListBySubscription.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_ListBySubscription.json */ /** * Sample code: ScalingPlans_ListBySubscription. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlansListBySubscription( @@ -1739,20 +2082,23 @@ public final class ScalingPlansListSamples { ### ScalingPlans_ListByHostPool ```java -/** Samples for ScalingPlans ListByHostPool. */ +/** + * Samples for ScalingPlans ListByHostPool. + */ public final class ScalingPlansListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_ListByHostPool.json */ /** * Sample code: ScalingPlan_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + manager.scalingPlans() .listByHostPool("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -1761,14 +2107,18 @@ public final class ScalingPlansListByHostPoolSamples { ### ScalingPlans_ListByResourceGroup ```java -/** Samples for ScalingPlans ListByResourceGroup. */ +/** + * Samples for ScalingPlans ListByResourceGroup. + */ public final class ScalingPlansListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_ListByResourceGroup.json */ /** * Sample code: ScalingPlans_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlansListByResourceGroup( @@ -1783,23 +2133,25 @@ public final class ScalingPlansListByResourceGroupSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; -/** Samples for ScalingPlans Update. */ +/** + * Samples for ScalingPlans Update. + */ public final class ScalingPlansUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Update.json */ /** * Sample code: ScalingPlans_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlan resource = - manager - .scalingPlans() - .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) - .getValue(); + public static void + scalingPlansUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ScalingPlan resource = manager.scalingPlans() + .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } @@ -1808,22 +2160,25 @@ public final class ScalingPlansUpdateSamples { ### SessionHosts_Delete ```java -/** Samples for SessionHosts Delete. */ +/** + * Samples for SessionHosts Delete. + */ public final class SessionHostsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_Delete.json */ /** * Sample code: SessionHost_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .sessionHosts() - .deleteWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, com.azure.core.util.Context.NONE); + public static void + sessionHostDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, + com.azure.core.util.Context.NONE); } } ``` @@ -1831,22 +2186,25 @@ public final class SessionHostsDeleteSamples { ### SessionHosts_Get ```java -/** Samples for SessionHosts Get. */ +/** + * Samples for SessionHosts Get. + */ public final class SessionHostsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_Get.json */ /** * Sample code: SessionHost_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .sessionHosts() - .getWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", com.azure.core.util.Context.NONE); + public static void + sessionHostGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE); } } ``` @@ -1854,18 +2212,22 @@ public final class SessionHostsGetSamples { ### SessionHosts_List ```java -/** Samples for SessionHosts List. */ +/** + * Samples for SessionHosts List. + */ public final class SessionHostsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_List.json */ /** * Sample code: SessionHost_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + sessionHostList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.sessionHosts().list("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -1876,27 +2238,25 @@ public final class SessionHostsListSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; -/** Samples for SessionHosts Update. */ +/** + * Samples for SessionHosts Update. + */ public final class SessionHostsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_Update.json */ /** * Sample code: SessionHost_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .sessionHosts() - .updateWithResponse( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - true, - new SessionHostPatch() - .withAllowNewSession(true) + public static void + sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, + new SessionHostPatch().withAllowNewSession(true) .withAssignedUser("user1@microsoft.com") .withFriendlyName("friendly"), com.azure.core.util.Context.NONE); @@ -1907,20 +2267,23 @@ public final class SessionHostsUpdateSamples { ### StartMenuItems_List ```java -/** Samples for StartMenuItems List. */ +/** + * Samples for StartMenuItems List. + */ public final class StartMenuItemsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/StartMenuItem_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * StartMenuItem_List.json */ /** * Sample code: StartMenuItem_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void startMenuItemList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .startMenuItems() + public static void + startMenuItemList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.startMenuItems() .list("resourceGroup1", "applicationGroup1", null, null, null, com.azure.core.util.Context.NONE); } } @@ -1929,26 +2292,24 @@ public final class StartMenuItemsListSamples { ### UserSessions_Delete ```java -/** Samples for UserSessions Delete. */ +/** + * Samples for UserSessions Delete. + */ public final class UserSessionsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_Delete.json */ /** * Sample code: UserSession_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .deleteWithResponse( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - "1", - true, + public static void + userSessionDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", true, com.azure.core.util.Context.NONE); } } @@ -1957,22 +2318,25 @@ public final class UserSessionsDeleteSamples { ### UserSessions_Disconnect ```java -/** Samples for UserSessions Disconnect. */ +/** + * Samples for UserSessions Disconnect. + */ public final class UserSessionsDisconnectSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Disconnect_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_Disconnect_Post.json */ /** * Sample code: UserSession_Disconnect_Post. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void userSessionDisconnectPost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .disconnectWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", com.azure.core.util.Context.NONE); + manager.userSessions() + .disconnectWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + com.azure.core.util.Context.NONE); } } ``` @@ -1980,22 +2344,25 @@ public final class UserSessionsDisconnectSamples { ### UserSessions_Get ```java -/** Samples for UserSessions Get. */ +/** + * Samples for UserSessions Get. + */ public final class UserSessionsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_Get.json */ /** * Sample code: UserSession_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .getWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", com.azure.core.util.Context.NONE); + public static void + userSessionGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + com.azure.core.util.Context.NONE); } } ``` @@ -2003,27 +2370,24 @@ public final class UserSessionsGetSamples { ### UserSessions_List ```java -/** Samples for UserSessions List. */ +/** + * Samples for UserSessions List. + */ public final class UserSessionsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_List.json */ /** * Sample code: UserSession_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .list( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - 10, - true, - 0, + public static void + userSessionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .list("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -2032,27 +2396,25 @@ public final class UserSessionsListSamples { ### UserSessions_ListByHostPool ```java -/** Samples for UserSessions ListByHostPool. */ +/** + * Samples for UserSessions ListByHostPool. + */ public final class UserSessionsListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_ListByHostPool.json */ /** * Sample code: UserSession_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void userSessionListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .listByHostPool( - "resourceGroup1", - "hostPool1", - "userPrincipalName eq 'user1@microsoft.com' and state eq 'active'", - 10, - true, - 0, + manager.userSessions() + .listByHostPool("resourceGroup1", "hostPool1", + "userPrincipalName eq 'user1@microsoft.com' and state eq 'active'", 10, true, 0, com.azure.core.util.Context.NONE); } } @@ -2063,27 +2425,25 @@ public final class UserSessionsListByHostPoolSamples { ```java import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; -/** Samples for UserSessions SendMessage. */ +/** + * Samples for UserSessions SendMessage. + */ public final class UserSessionsSendMessageSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_SendMessage_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_SendMessage_Post.json */ /** * Sample code: UserSession_SendMessage_Post. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void userSessionSendMessagePost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .sendMessageWithResponse( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - "1", - new SendMessage().withMessageTitle("title").withMessageBody("body"), - com.azure.core.util.Context.NONE); + manager.userSessions() + .sendMessageWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + new SendMessage().withMessageTitle("title").withMessageBody("body"), com.azure.core.util.Context.NONE); } } ``` @@ -2094,20 +2454,23 @@ public final class UserSessionsSendMessageSamples { import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces CreateOrUpdate. */ +/** + * Samples for Workspaces CreateOrUpdate. + */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Create.json */ /** * Sample code: Workspace_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .workspaces() + public static void + workspaceCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() .define("workspace1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") @@ -2134,20 +2497,23 @@ public final class WorkspacesCreateOrUpdateSamples { ### Workspaces_Delete ```java -/** Samples for Workspaces Delete. */ +/** + * Samples for Workspaces Delete. + */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Delete.json */ /** * Sample code: Workspace_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .workspaces() + public static void + workspaceDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() .deleteByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } @@ -2156,20 +2522,23 @@ public final class WorkspacesDeleteSamples { ### Workspaces_GetByResourceGroup ```java -/** Samples for Workspaces GetByResourceGroup. */ +/** + * Samples for Workspaces GetByResourceGroup. + */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Get.json */ /** * Sample code: Workspace_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .workspaces() + public static void + workspaceGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } @@ -2178,14 +2547,18 @@ public final class WorkspacesGetByResourceGroupSamples { ### Workspaces_List ```java -/** Samples for Workspaces List. */ +/** + * Samples for Workspaces List. + */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListBySubscription.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_ListBySubscription.json */ /** * Sample code: Workspace_ListBySubscription. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void workspaceListBySubscription( @@ -2198,14 +2571,18 @@ public final class WorkspacesListSamples { ### Workspaces_ListByResourceGroup ```java -/** Samples for Workspaces ListByResourceGroup. */ +/** + * Samples for Workspaces ListByResourceGroup. + */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_ListByResourceGroup.json */ /** * Sample code: Workspace_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void workspaceListByResourceGroup( @@ -2222,25 +2599,26 @@ import com.azure.resourcemanager.desktopvirtualization.models.Workspace; import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces Update. */ +/** + * Samples for Workspaces Update. + */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Update.json */ /** * Sample code: Workspace_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - Workspace resource = - manager - .workspaces() - .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + workspaceUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + Workspace resource = manager.workspaces() + .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withDescription("des1") .withFriendlyName("friendly") diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml index 2f2de217b913..2d05ec8f14d5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-desktopvirtualization - 1.2.0-beta.1 + 1.2.0 jar Microsoft Azure SDK for DesktopVirtualization Management - This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2023-09. + This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04. https://github.com/Azure/azure-sdk-for-java @@ -47,6 +47,11 @@ 0 + + com.azure + azure-json + 1.3.0 + com.azure azure-core @@ -81,14 +86,18 @@ 5.9.3 test + + org.slf4j + slf4j-simple + 1.7.36 + test + org.mockito mockito-core 4.11.0 test - - net.bytebuddy byte-buddy @@ -101,11 +110,5 @@ 1.14.12 test - - org.slf4j - slf4j-simple - 1.7.36 - test - diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java index 0a090c871fac..428b4c9465bc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -24,10 +24,12 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationApiClient; +import com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackageInfoesImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackagesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationGroupsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationsImpl; -import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopVirtualizationApiClientBuilder; import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsImpl; +import com.azure.resourcemanager.desktopvirtualization.implementation.DesktopVirtualizationApiClientBuilder; import com.azure.resourcemanager.desktopvirtualization.implementation.HostPoolsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.MsixImagesImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.MsixPackagesImpl; @@ -41,6 +43,8 @@ import com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.UserSessionsImpl; import com.azure.resourcemanager.desktopvirtualization.implementation.WorkspacesImpl; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoes; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackages; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroups; import com.azure.resourcemanager.desktopvirtualization.models.Applications; import com.azure.resourcemanager.desktopvirtualization.models.Desktops; @@ -64,7 +68,9 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to DesktopVirtualizationManager. */ +/** + * Entry point to DesktopVirtualizationManager. + */ public final class DesktopVirtualizationManager { private Operations operations; @@ -96,26 +102,28 @@ public final class DesktopVirtualizationManager { private MsixPackages msixPackages; + private AppAttachPackageInfoes appAttachPackageInfoes; + private MsixImages msixImages; + private AppAttachPackages appAttachPackages; + private final DesktopVirtualizationApiClient clientObject; - private DesktopVirtualizationManager( - HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private DesktopVirtualizationManager(HttpPipeline httpPipeline, AzureProfile profile, + Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new DesktopVirtualizationApiClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new DesktopVirtualizationApiClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of DesktopVirtualization service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the DesktopVirtualization service API instance. @@ -128,7 +136,7 @@ public static DesktopVirtualizationManager authenticate(TokenCredential credenti /** * Creates an instance of DesktopVirtualization service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the DesktopVirtualization service API instance. @@ -141,14 +149,16 @@ public static DesktopVirtualizationManager authenticate(HttpPipeline httpPipelin /** * Gets a Configurable instance that can be used to create DesktopVirtualizationManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new DesktopVirtualizationManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -220,8 +230,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -238,8 +248,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -259,15 +269,13 @@ public DesktopVirtualizationManager authenticate(TokenCredential credential, Azu Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.desktopvirtualization") .append("/") - .append("1.1.0"); + .append("1.2.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -292,38 +300,28 @@ public DesktopVirtualizationManager authenticate(TokenCredential credential, Azu policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new DesktopVirtualizationManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -335,7 +333,7 @@ public Operations operations() { /** * Gets the resource collection API of Workspaces. It manages Workspace. - * + * * @return Resource collection API of Workspaces. */ public Workspaces workspaces() { @@ -347,20 +345,20 @@ public Workspaces workspaces() { /** * Gets the resource collection API of PrivateEndpointConnections. - * + * * @return Resource collection API of PrivateEndpointConnections. */ public PrivateEndpointConnections privateEndpointConnections() { if (this.privateEndpointConnections == null) { - this.privateEndpointConnections = - new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } return privateEndpointConnections; } /** * Gets the resource collection API of PrivateLinkResources. - * + * * @return Resource collection API of PrivateLinkResources. */ public PrivateLinkResources privateLinkResources() { @@ -372,7 +370,7 @@ public PrivateLinkResources privateLinkResources() { /** * Gets the resource collection API of ScalingPlans. It manages ScalingPlan. - * + * * @return Resource collection API of ScalingPlans. */ public ScalingPlans scalingPlans() { @@ -384,33 +382,33 @@ public ScalingPlans scalingPlans() { /** * Gets the resource collection API of ScalingPlanPooledSchedules. It manages ScalingPlanPooledSchedule. - * + * * @return Resource collection API of ScalingPlanPooledSchedules. */ public ScalingPlanPooledSchedules scalingPlanPooledSchedules() { if (this.scalingPlanPooledSchedules == null) { - this.scalingPlanPooledSchedules = - new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this); + this.scalingPlanPooledSchedules + = new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this); } return scalingPlanPooledSchedules; } /** * Gets the resource collection API of ScalingPlanPersonalSchedules. It manages ScalingPlanPersonalSchedule. - * + * * @return Resource collection API of ScalingPlanPersonalSchedules. */ public ScalingPlanPersonalSchedules scalingPlanPersonalSchedules() { if (this.scalingPlanPersonalSchedules == null) { - this.scalingPlanPersonalSchedules = - new ScalingPlanPersonalSchedulesImpl(clientObject.getScalingPlanPersonalSchedules(), this); + this.scalingPlanPersonalSchedules + = new ScalingPlanPersonalSchedulesImpl(clientObject.getScalingPlanPersonalSchedules(), this); } return scalingPlanPersonalSchedules; } /** * Gets the resource collection API of ApplicationGroups. It manages ApplicationGroup. - * + * * @return Resource collection API of ApplicationGroups. */ public ApplicationGroups applicationGroups() { @@ -422,7 +420,7 @@ public ApplicationGroups applicationGroups() { /** * Gets the resource collection API of StartMenuItems. - * + * * @return Resource collection API of StartMenuItems. */ public StartMenuItems startMenuItems() { @@ -434,7 +432,7 @@ public StartMenuItems startMenuItems() { /** * Gets the resource collection API of Applications. It manages Application. - * + * * @return Resource collection API of Applications. */ public Applications applications() { @@ -446,7 +444,7 @@ public Applications applications() { /** * Gets the resource collection API of Desktops. - * + * * @return Resource collection API of Desktops. */ public Desktops desktops() { @@ -458,7 +456,7 @@ public Desktops desktops() { /** * Gets the resource collection API of HostPools. It manages HostPool. - * + * * @return Resource collection API of HostPools. */ public HostPools hostPools() { @@ -470,7 +468,7 @@ public HostPools hostPools() { /** * Gets the resource collection API of UserSessions. - * + * * @return Resource collection API of UserSessions. */ public UserSessions userSessions() { @@ -482,7 +480,7 @@ public UserSessions userSessions() { /** * Gets the resource collection API of SessionHosts. - * + * * @return Resource collection API of SessionHosts. */ public SessionHosts sessionHosts() { @@ -494,7 +492,7 @@ public SessionHosts sessionHosts() { /** * Gets the resource collection API of MsixPackages. It manages MsixPackage. - * + * * @return Resource collection API of MsixPackages. */ public MsixPackages msixPackages() { @@ -504,9 +502,22 @@ public MsixPackages msixPackages() { return msixPackages; } + /** + * Gets the resource collection API of AppAttachPackageInfoes. + * + * @return Resource collection API of AppAttachPackageInfoes. + */ + public AppAttachPackageInfoes appAttachPackageInfoes() { + if (this.appAttachPackageInfoes == null) { + this.appAttachPackageInfoes + = new AppAttachPackageInfoesImpl(clientObject.getAppAttachPackageInfoes(), this); + } + return appAttachPackageInfoes; + } + /** * Gets the resource collection API of MsixImages. - * + * * @return Resource collection API of MsixImages. */ public MsixImages msixImages() { @@ -516,10 +527,22 @@ public MsixImages msixImages() { return msixImages; } + /** + * Gets the resource collection API of AppAttachPackages. It manages AppAttachPackage. + * + * @return Resource collection API of AppAttachPackages. + */ + public AppAttachPackages appAttachPackages() { + if (this.appAttachPackages == null) { + this.appAttachPackages = new AppAttachPackagesImpl(clientObject.getAppAttachPackages(), this); + } + return appAttachPackages; + } + /** * Gets wrapped service client DesktopVirtualizationApiClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. - * + * * @return Wrapped service client DesktopVirtualizationApiClient. */ public DesktopVirtualizationApiClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java new file mode 100644 index 000000000000..8d638a66b3e0 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackageInfoesClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; + +/** + * An instance of this class provides access to all the operations defined in AppAttachPackageInfoesClient. + */ +public interface AppAttachPackageInfoesClient { + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux importMethodAsync(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest); + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest); + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java new file mode 100644 index 000000000000..acc2fd51b9c5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/AppAttachPackagesClient.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AppAttachPackagesClient. + */ +public interface AppAttachPackagesClient { + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appAttachPackageName); + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String appAttachPackageName); + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String appAttachPackageName, Context context); + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppAttachPackageInner getByResourceGroup(String resourceGroupName, String appAttachPackageName); + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage); + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage); + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage, Context context); + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage); + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName); + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String appAttachPackageName); + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Context context); + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String appAttachPackageName); + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackagePatch Object containing App Attach Package definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, String appAttachPackageName, + AppAttachPackagePatch appAttachPackagePatch); + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String appAttachPackageName); + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String appAttachPackageName, + AppAttachPackagePatch appAttachPackagePatch, Context context); + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppAttachPackageInner update(String resourceGroupName, String appAttachPackageName); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter); + + /** + * List App Attach packages in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List App Attach packages in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java index 14c09dee0e0d..2c35056382d2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationGroupsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationGroupsClient. + */ public interface ApplicationGroupsClient { /** * 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. @@ -27,12 +29,12 @@ public interface ApplicationGroupsClient { * @return an application group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationGroupName); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String applicationGroupName); /** * 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. @@ -45,7 +47,7 @@ Mono> getByResourceGroupWithResponseAsync( /** * 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 context The context to associate with this operation. @@ -55,12 +57,12 @@ Mono> getByResourceGroupWithResponseAsync( * @return an application group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationGroupName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationGroupName, Context context); /** * 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. @@ -73,23 +75,23 @@ Response getByResourceGroupWithResponse( /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup); /** * 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. @@ -99,12 +101,12 @@ Mono> createOrUpdateWithResponseAsync( * @return represents a ApplicationGroup definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup); + Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup); /** * 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. @@ -115,12 +117,12 @@ Mono createOrUpdateAsync( * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup, Context context); /** * 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. @@ -130,12 +132,12 @@ Response createOrUpdateWithResponse( * @return represents a ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationGroupInner createOrUpdate( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup); + ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup); /** * 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. @@ -148,7 +150,7 @@ ApplicationGroupInner createOrUpdate( /** * 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. @@ -161,7 +163,7 @@ ApplicationGroupInner createOrUpdate( /** * 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 context The context to associate with this operation. @@ -175,7 +177,7 @@ ApplicationGroupInner createOrUpdate( /** * 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. @@ -187,23 +189,23 @@ ApplicationGroupInner createOrUpdate( /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String applicationGroupName, ApplicationGroupPatch applicationGroup); + Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup); /** * 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. @@ -216,7 +218,7 @@ Mono> updateWithResponseAsync( /** * 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. @@ -227,12 +229,12 @@ Mono> updateWithResponseAsync( * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String applicationGroupName, ApplicationGroupPatch applicationGroup, Context context); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup, Context context); /** * 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. @@ -245,7 +247,7 @@ Response updateWithResponse( /** * 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 pageSize Number of items per page. @@ -257,12 +259,12 @@ Response updateWithResponse( * @return applicationGroupList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * List applicationGroups. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -274,7 +276,7 @@ PagedFlux listByResourceGroupAsync( /** * List applicationGroups. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -286,7 +288,7 @@ PagedFlux listByResourceGroupAsync( /** * 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 pageSize Number of items per page. @@ -299,17 +301,12 @@ PagedFlux listByResourceGroupAsync( * @return applicationGroupList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -321,7 +318,7 @@ PagedIterable listByResourceGroup( /** * List applicationGroups in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationGroupList as paginated response with {@link PagedFlux}. @@ -331,7 +328,7 @@ PagedIterable listByResourceGroup( /** * List applicationGroups in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationGroupList as paginated response with {@link PagedIterable}. @@ -341,7 +338,7 @@ PagedIterable listByResourceGroup( /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java index 32935c030ede..328b4c594e83 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationsClient. + */ public interface ApplicationsClient { /** * 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. @@ -28,12 +30,12 @@ public interface ApplicationsClient { * @return an application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName); + Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName); /** * 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. @@ -47,7 +49,7 @@ Mono> getWithResponseAsync( /** * 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. @@ -58,12 +60,12 @@ Mono> getWithResponseAsync( * @return an application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context); + Response getWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context); /** * 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. @@ -77,7 +79,7 @@ Response getWithResponse( /** * 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. @@ -88,12 +90,12 @@ Response getWithResponse( * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationInner application); /** * 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. @@ -104,12 +106,12 @@ Mono> createOrUpdateWithResponseAsync( * @return schema for Application properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application); + Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application); /** * 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. @@ -121,16 +123,12 @@ Mono createOrUpdateAsync( * @return schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String applicationGroupName, - String applicationName, - ApplicationInner application, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application, Context context); /** * 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. @@ -141,12 +139,12 @@ Response createOrUpdateWithResponse( * @return schema for Application properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application); + ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, String applicationName, + ApplicationInner application); /** * 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. @@ -156,12 +154,12 @@ ApplicationInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName); + Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName); /** * 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. @@ -175,7 +173,7 @@ Mono> deleteWithResponseAsync( /** * 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. @@ -186,12 +184,12 @@ Mono> deleteWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context); + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Context context); /** * 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. @@ -204,7 +202,7 @@ Response deleteWithResponse( /** * 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. @@ -215,12 +213,12 @@ Response deleteWithResponse( * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationPatch application); + Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationPatch application); /** * 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. @@ -234,7 +232,7 @@ Mono> updateWithResponseAsync( /** * 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. @@ -246,16 +244,12 @@ Mono> updateWithResponseAsync( * @return schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - String applicationName, - ApplicationPatch application, - Context context); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationPatch application, Context context); /** * 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. @@ -269,7 +263,7 @@ Response updateWithResponse( /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -281,16 +275,12 @@ Response updateWithResponse( * @return applicationList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * 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. @@ -303,7 +293,7 @@ PagedFlux listAsync( /** * 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. @@ -316,7 +306,7 @@ PagedFlux listAsync( /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -329,11 +319,6 @@ PagedFlux listAsync( * @return applicationList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java index 8a128c96020d..12f17ea6865b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java @@ -7,152 +7,168 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for DesktopVirtualizationApiClient class. */ +/** + * The interface for DesktopVirtualizationApiClient class. + */ public interface DesktopVirtualizationApiClient { /** - * Gets The ID of the target subscription. - * + * Gets The ID of the target subscription. The value must be an UUID. + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the WorkspacesClient object to access its operations. - * + * * @return the WorkspacesClient object. */ WorkspacesClient getWorkspaces(); /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); /** * Gets the ScalingPlansClient object to access its operations. - * + * * @return the ScalingPlansClient object. */ ScalingPlansClient getScalingPlans(); /** * Gets the ScalingPlanPooledSchedulesClient object to access its operations. - * + * * @return the ScalingPlanPooledSchedulesClient object. */ ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules(); /** * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. - * + * * @return the ScalingPlanPersonalSchedulesClient object. */ ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules(); /** * Gets the ApplicationGroupsClient object to access its operations. - * + * * @return the ApplicationGroupsClient object. */ ApplicationGroupsClient getApplicationGroups(); /** * Gets the StartMenuItemsClient object to access its operations. - * + * * @return the StartMenuItemsClient object. */ StartMenuItemsClient getStartMenuItems(); /** * Gets the ApplicationsClient object to access its operations. - * + * * @return the ApplicationsClient object. */ ApplicationsClient getApplications(); /** * Gets the DesktopsClient object to access its operations. - * + * * @return the DesktopsClient object. */ DesktopsClient getDesktops(); /** * Gets the HostPoolsClient object to access its operations. - * + * * @return the HostPoolsClient object. */ HostPoolsClient getHostPools(); /** * Gets the UserSessionsClient object to access its operations. - * + * * @return the UserSessionsClient object. */ UserSessionsClient getUserSessions(); /** * Gets the SessionHostsClient object to access its operations. - * + * * @return the SessionHostsClient object. */ SessionHostsClient getSessionHosts(); /** * Gets the MsixPackagesClient object to access its operations. - * + * * @return the MsixPackagesClient object. */ MsixPackagesClient getMsixPackages(); + /** + * Gets the AppAttachPackageInfoesClient object to access its operations. + * + * @return the AppAttachPackageInfoesClient object. + */ + AppAttachPackageInfoesClient getAppAttachPackageInfoes(); + /** * Gets the MsixImagesClient object to access its operations. - * + * * @return the MsixImagesClient object. */ MsixImagesClient getMsixImages(); + + /** + * Gets the AppAttachPackagesClient object to access its operations. + * + * @return the AppAttachPackagesClient object. + */ + AppAttachPackagesClient getAppAttachPackages(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java index d44baeeef5eb..2e5075ecf914 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DesktopsClient. */ +/** + * An instance of this class provides access to all the operations defined in DesktopsClient. + */ public interface DesktopsClient { /** * 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. @@ -28,12 +30,12 @@ public interface DesktopsClient { * @return a desktop along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String applicationGroupName, String desktopName); + Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName); /** * 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. @@ -47,7 +49,7 @@ Mono> getWithResponseAsync( /** * 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. @@ -58,12 +60,12 @@ Mono> getWithResponseAsync( * @return a desktop along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String applicationGroupName, String desktopName, Context context); + Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + Context context); /** * 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. @@ -77,7 +79,7 @@ Response getWithResponse( /** * 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. @@ -88,12 +90,12 @@ Response getWithResponse( * @return schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String applicationGroupName, String desktopName, DesktopPatch desktop); + Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop); /** * 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. @@ -107,7 +109,7 @@ Mono> updateWithResponseAsync( /** * 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. @@ -119,16 +121,12 @@ Mono> updateWithResponseAsync( * @return schema for Desktop properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - String desktopName, - DesktopPatch desktop, - Context context); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + DesktopPatch desktop, Context context); /** * 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. @@ -142,7 +140,7 @@ Response updateWithResponse( /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -154,16 +152,12 @@ Response updateWithResponse( * @return desktopList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * 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. @@ -176,7 +170,7 @@ PagedFlux listAsync( /** * 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. @@ -189,7 +183,7 @@ PagedFlux listAsync( /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -202,11 +196,6 @@ PagedFlux listAsync( * @return desktopList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java index e41f0918a9b6..b8f2b9c69a58 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/HostPoolsClient.java @@ -12,14 +12,17 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in HostPoolsClient. */ +/** + * An instance of this class provides access to all the operations defined in HostPoolsClient. + */ public interface HostPoolsClient { /** * 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. @@ -32,7 +35,7 @@ public interface HostPoolsClient { /** * 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. @@ -45,7 +48,7 @@ public interface HostPoolsClient { /** * 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 context The context to associate with this operation. @@ -55,12 +58,12 @@ public interface HostPoolsClient { * @return a host pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String hostPoolName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, + Context context); /** * 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. @@ -73,7 +76,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -83,12 +86,12 @@ Response getByResourceGroupWithResponse( * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostPoolName, HostPoolInner hostPool); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool); /** * 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. @@ -102,7 +105,7 @@ Mono> createOrUpdateWithResponseAsync( /** * 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. @@ -113,12 +116,12 @@ Mono> createOrUpdateWithResponseAsync( * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String hostPoolName, HostPoolInner hostPool, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool, Context context); /** * 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. @@ -132,7 +135,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -146,7 +149,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -159,7 +162,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -174,7 +177,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -186,7 +189,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -196,12 +199,12 @@ Response createOrUpdateWithResponse( * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String hostPoolName, HostPoolPatch hostPool); + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool); /** * 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. @@ -214,7 +217,7 @@ Mono> updateWithResponseAsync( /** * 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. @@ -225,12 +228,12 @@ Mono> updateWithResponseAsync( * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, + Context context); /** * 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. @@ -243,7 +246,7 @@ Response updateWithResponse( /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -254,12 +257,12 @@ Response updateWithResponse( * @return hostPoolList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip); /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -271,7 +274,7 @@ PagedFlux listByResourceGroupAsync( /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -283,7 +286,7 @@ PagedFlux listByResourceGroupAsync( /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -295,12 +298,12 @@ PagedFlux listByResourceGroupAsync( * @return hostPoolList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -314,7 +317,7 @@ PagedIterable listByResourceGroup( /** * List hostPools in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return hostPoolList as paginated response with {@link PagedFlux}. @@ -324,7 +327,7 @@ PagedIterable listByResourceGroup( /** * List hostPools in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return hostPoolList as paginated response with {@link PagedIterable}. @@ -334,7 +337,7 @@ PagedIterable listByResourceGroup( /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -349,22 +352,22 @@ PagedIterable listByResourceGroup( /** * Registration token of the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> retrieveRegistrationTokenWithResponseAsync( - String resourceGroupName, String hostPoolName); + Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + String hostPoolName); /** * Registration token of the 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. @@ -377,7 +380,7 @@ Mono> retrieveRegistrationTokenWithResponseAsync /** * Registration token of the 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 context The context to associate with this operation. @@ -387,12 +390,12 @@ Mono> retrieveRegistrationTokenWithResponseAsync * @return represents a RegistrationInfo definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveRegistrationTokenWithResponse( - String resourceGroupName, String hostPoolName, Context context); + Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, + Context context); /** * Registration token of the 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. @@ -402,4 +405,59 @@ Response retrieveRegistrationTokenWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, String hostPoolName); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, + String hostPoolName); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listRegistrationTokensAsync(String resourceGroupName, String hostPoolName); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listRegistrationTokensWithResponse(String resourceGroupName, + String hostPoolName, Context context); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistrationTokenListInner listRegistrationTokens(String resourceGroupName, String hostPoolName); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java index 2920e831cb76..c79b9c09856a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixImagesClient.java @@ -12,11 +12,13 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; -/** An instance of this class provides access to all the operations defined in MsixImagesClient. */ +/** + * An instance of this class provides access to all the operations defined in MsixImagesClient. + */ public interface MsixImagesClient { /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -26,12 +28,12 @@ public interface MsixImagesClient { * @return expandMsixImageList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux expandAsync( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri); + PagedFlux expandAsync(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri); /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -41,12 +43,12 @@ PagedFlux expandAsync( * @return expandMsixImageList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri); + PagedIterable expand(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri); /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -57,6 +59,6 @@ PagedIterable expand( * @return expandMsixImageList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context); + PagedIterable expand(String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, + Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java index 7e90bbb3199e..5a00acdae0e4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/MsixPackagesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MsixPackagesClient. */ +/** + * An instance of this class provides access to all the operations defined in MsixPackagesClient. + */ public interface MsixPackagesClient { /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -28,12 +30,12 @@ public interface MsixPackagesClient { * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName); + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName); /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -47,7 +49,7 @@ Mono> getWithResponseAsync( /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -58,12 +60,12 @@ Mono> getWithResponseAsync( * @return a msixpackage along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context); /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -77,7 +79,7 @@ Response getWithResponse( /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -88,12 +90,12 @@ Response getWithResponse( * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage); /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -104,12 +106,12 @@ Mono> createOrUpdateWithResponseAsync( * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage); + Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage); /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -121,16 +123,12 @@ Mono createOrUpdateAsync( * @return schema for MSIX Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String hostPoolName, - String msixPackageFullName, - MsixPackageInner msixPackage, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage, Context context); /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -141,12 +139,12 @@ Response createOrUpdateWithResponse( * @return schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - MsixPackageInner createOrUpdate( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage); + MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackageInner msixPackage); /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -156,12 +154,12 @@ MsixPackageInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName); /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -175,7 +173,7 @@ Mono> deleteWithResponseAsync( /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -186,12 +184,12 @@ Mono> deleteWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context); /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -204,7 +202,7 @@ Response deleteWithResponse( /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -215,12 +213,12 @@ Response deleteWithResponse( * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackagePatch msixPackage); + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage); /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -234,7 +232,7 @@ Mono> updateWithResponseAsync( /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -246,16 +244,12 @@ Mono> updateWithResponseAsync( * @return schema for MSIX Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String hostPoolName, - String msixPackageFullName, - MsixPackagePatch msixPackage, - Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage, Context context); /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -269,7 +263,7 @@ Response updateWithResponse( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -281,12 +275,12 @@ Response updateWithResponse( * @return msixPackageList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,7 +293,7 @@ PagedFlux listAsync( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -312,7 +306,7 @@ PagedFlux listAsync( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -325,11 +319,6 @@ PagedFlux listAsync( * @return msixPackageList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java index fbeb8668954a..4e4e5c418518 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/OperationsClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations as paginated response with {@link PagedFlux}. @@ -25,7 +27,7 @@ public interface OperationsClient { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations as paginated response with {@link PagedIterable}. @@ -35,7 +37,7 @@ public interface OperationsClient { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java index b0fe67f7c09f..77454f1695e5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateEndpointConnectionsClient.java @@ -14,41 +14,43 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public interface PrivateEndpointConnectionsClient { /** * List private endpoint connections. - * + * * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByWorkspaceAsync( - String resourceGroupName, String workspaceName); + PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName); /** * List private endpoint connections. - * + * * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName); /** * List private endpoint connections. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -56,19 +58,19 @@ PagedIterable listByWorkspace( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName, Context context); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context); /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -80,27 +82,27 @@ Mono> getByWorkspaceWithR /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByWorkspaceAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + Mono getByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName); /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -108,64 +110,64 @@ Mono getByWorkspaceAsync( * @return a private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context); /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner getByWorkspace( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByWorkspaceAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -173,16 +175,16 @@ Mono deleteByWorkspaceAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -192,32 +194,30 @@ Response deleteByWorkspaceWithResponse( /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection); /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -225,19 +225,16 @@ Mono> updateByWorkspaceWi * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByWorkspaceAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection); + Mono updateByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection); /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -246,20 +243,17 @@ Mono updateByWorkspaceAsync( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateByWorkspaceWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context); /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -267,15 +261,12 @@ Response updateByWorkspaceWithResp * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner updateByWorkspace( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection); + PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnection connection); /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -285,45 +276,45 @@ PrivateEndpointConnectionWithSystemDataInner updateByWorkspace( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName); + PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName); /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool( - String resourceGroupName, String hostPoolName); + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName); /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -334,24 +325,19 @@ PagedIterable listByHostPool( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -363,27 +349,27 @@ Mono> getByHostPoolWithRe /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByHostPoolAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + Mono getByHostPoolAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -391,64 +377,64 @@ Mono getByHostPoolAsync( * @return a private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context); + Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context); /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner getByHostPool( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByHostPoolAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -456,16 +442,16 @@ Mono deleteByHostPoolAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context); + Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context); /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -475,32 +461,30 @@ Response deleteByHostPoolWithResponse( /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection); /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -508,19 +492,16 @@ Mono> updateByHostPoolWit * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection); + Mono updateByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection); /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -529,20 +510,17 @@ Mono updateByHostPoolAsync( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateByHostPoolWithResponse( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context); /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -550,9 +528,6 @@ Response updateByHostPoolWithRespo * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionWithSystemDataInner updateByHostPool( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection); + PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnection connection); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java index 07b8dda0897c..a88d8ebd9344 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/PrivateLinkResourcesClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public interface PrivateLinkResourcesClient { /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -27,12 +29,12 @@ public interface PrivateLinkResourcesClient { * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByWorkspaceAsync( - String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** * List the private link resources available for this 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. @@ -45,7 +47,7 @@ PagedFlux listByWorkspaceAsync( /** * List the private link resources available for this 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. @@ -58,7 +60,7 @@ PagedFlux listByWorkspaceAsync( /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -71,17 +73,12 @@ PagedFlux listByWorkspaceAsync( * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByWorkspace( - String resourceGroupName, - String workspaceName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -93,12 +90,12 @@ PagedIterable listByWorkspace( * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -111,7 +108,7 @@ PagedFlux listByHostPoolAsync( /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +121,7 @@ PagedFlux listByHostPoolAsync( /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -137,11 +134,6 @@ PagedFlux listByHostPoolAsync( * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java index 011294d506d9..c528c5d02e59 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPersonalSchedulesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ScalingPlanPersonalSchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in ScalingPlanPersonalSchedulesClient. + */ public interface ScalingPlanPersonalSchedulesClient { /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -28,12 +30,12 @@ public interface ScalingPlanPersonalSchedulesClient { * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName); /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -43,12 +45,12 @@ Mono> getWithResponseAsync( * @return a ScalingPlanPersonalSchedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono getAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -59,12 +61,12 @@ Mono getAsync( * @return a ScalingPlanPersonalSchedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context); /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -74,12 +76,12 @@ Response getWithResponse( * @return a ScalingPlanPersonalSchedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanPersonalScheduleInner get( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPersonalScheduleInner get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -88,18 +90,15 @@ ScalingPlanPersonalScheduleInner get( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule); + Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule); /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -110,15 +109,12 @@ Mono> createWithResponseAsync( * @return represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule); + Mono createAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule); /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -130,16 +126,12 @@ Mono createAsync( * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule, - Context context); + Response createWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, Context context); /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -150,15 +142,12 @@ Response createWithResponse( * @return represents a ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanPersonalScheduleInner create( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule); + ScalingPlanPersonalScheduleInner create(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule); /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -168,12 +157,12 @@ ScalingPlanPersonalScheduleInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -187,7 +176,7 @@ Mono> deleteWithResponseAsync( /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -198,12 +187,12 @@ Mono> deleteWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -216,7 +205,7 @@ Response deleteWithResponse( /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -225,18 +214,15 @@ Response deleteWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalSchedulePatch scalingPlanSchedule); + Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule); /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -246,12 +232,12 @@ Mono> updateWithResponseAsync( * @return represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -263,16 +249,12 @@ Mono updateAsync( * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalSchedulePatch scalingPlanSchedule, - Context context); + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context); /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -282,12 +264,12 @@ Response updateWithResponse( * @return represents a ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanPersonalScheduleInner update( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -299,12 +281,12 @@ ScalingPlanPersonalScheduleInner update( * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -317,7 +299,7 @@ PagedFlux listAsync( /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -330,7 +312,7 @@ PagedFlux listAsync( /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -343,11 +325,6 @@ PagedFlux listAsync( * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java index 4a06365c0df5..f84ced4c32ed 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlanPooledSchedulesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ScalingPlanPooledSchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in ScalingPlanPooledSchedulesClient. + */ public interface ScalingPlanPooledSchedulesClient { /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -28,12 +30,12 @@ public interface ScalingPlanPooledSchedulesClient { * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName); /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -43,12 +45,12 @@ Mono> getWithResponseAsync( * @return a ScalingPlanPooledSchedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono getAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -59,12 +61,12 @@ Mono getAsync( * @return a ScalingPlanPooledSchedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context); /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -74,12 +76,12 @@ Response getWithResponse( * @return a ScalingPlanPooledSchedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanPooledScheduleInner get( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPooledScheduleInner get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -88,18 +90,15 @@ ScalingPlanPooledScheduleInner get( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule); + Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule); /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -110,15 +109,12 @@ Mono> createWithResponseAsync( * @return represents a ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule); + Mono createAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule); /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -130,16 +126,12 @@ Mono createAsync( * @return represents a ScalingPlanPooledSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule, - Context context); + Response createWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context); /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -150,15 +142,12 @@ Response createWithResponse( * @return represents a ScalingPlanPooledSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanPooledScheduleInner create( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule); + ScalingPlanPooledScheduleInner create(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule); /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -168,12 +157,12 @@ ScalingPlanPooledScheduleInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -187,7 +176,7 @@ Mono> deleteWithResponseAsync( /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -198,12 +187,12 @@ Mono> deleteWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -216,7 +205,7 @@ Response deleteWithResponse( /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -225,18 +214,15 @@ Response deleteWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledSchedulePatch scalingPlanSchedule); + Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule); /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -246,12 +232,12 @@ Mono> updateWithResponseAsync( * @return represents a ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + Mono updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -263,16 +249,12 @@ Mono updateAsync( * @return represents a ScalingPlanPooledSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledSchedulePatch scalingPlanSchedule, - Context context); + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context); /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -282,12 +264,12 @@ Response updateWithResponse( * @return represents a ScalingPlanPooledSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ScalingPlanPooledScheduleInner update( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); + ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName); /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -299,12 +281,12 @@ ScalingPlanPooledScheduleInner update( * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -317,7 +299,7 @@ PagedFlux listAsync( /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -330,7 +312,7 @@ PagedFlux listAsync( /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -343,11 +325,6 @@ PagedFlux listAsync( * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java index a032ae0d96e0..dfc4abf4e6aa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ScalingPlansClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ScalingPlansClient. */ +/** + * An instance of this class provides access to all the operations defined in ScalingPlansClient. + */ public interface ScalingPlansClient { /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,12 +29,12 @@ public interface ScalingPlansClient { * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String scalingPlanName); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String scalingPlanName); /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -45,7 +47,7 @@ Mono> getByResourceGroupWithResponseAsync( /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -55,12 +57,12 @@ Mono> getByResourceGroupWithResponseAsync( * @return a scaling plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String scalingPlanName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context); /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,7 +75,7 @@ Response getByResourceGroupWithResponse( /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -83,12 +85,12 @@ Response getByResourceGroupWithResponse( * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan); + Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan); /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -102,7 +104,7 @@ Mono> createWithResponseAsync( /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -113,12 +115,12 @@ Mono> createWithResponseAsync( * @return scalingPlan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan, Context context); + Response createWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan, Context context); /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -132,7 +134,7 @@ Response createWithResponse( /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -145,7 +147,7 @@ Response createWithResponse( /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,7 +160,7 @@ Response createWithResponse( /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -172,7 +174,7 @@ Response createWithResponse( /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,7 +186,7 @@ Response createWithResponse( /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -194,12 +196,12 @@ Response createWithResponse( * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanPatch scalingPlan); + Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan); /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -212,7 +214,7 @@ Mono> updateWithResponseAsync( /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -223,12 +225,12 @@ Mono> updateWithResponseAsync( * @return scalingPlan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String scalingPlanName, ScalingPlanPatch scalingPlan, Context context); + Response updateWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context); /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -241,7 +243,7 @@ Response updateWithResponse( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -252,12 +254,12 @@ Response updateWithResponse( * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -269,7 +271,7 @@ PagedFlux listByResourceGroupAsync( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -281,7 +283,7 @@ PagedFlux listByResourceGroupAsync( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -293,12 +295,12 @@ PagedFlux listByResourceGroupAsync( * @return scalingPlanList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -312,7 +314,7 @@ PagedIterable listByResourceGroup( /** * List scaling plans in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedFlux}. @@ -322,7 +324,7 @@ PagedIterable listByResourceGroup( /** * List scaling plans in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedIterable}. @@ -332,7 +334,7 @@ PagedIterable listByResourceGroup( /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -347,7 +349,7 @@ PagedIterable listByResourceGroup( /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -359,12 +361,12 @@ PagedIterable listByResourceGroup( * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -377,7 +379,7 @@ PagedFlux listByHostPoolAsync( /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -390,7 +392,7 @@ PagedFlux listByHostPoolAsync( /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -403,11 +405,6 @@ PagedFlux listByHostPoolAsync( * @return scalingPlanList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java index 3b0d417491cd..f4ef87604a59 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/SessionHostsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SessionHostsClient. */ +/** + * An instance of this class provides access to all the operations defined in SessionHostsClient. + */ public interface SessionHostsClient { /** * 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. @@ -28,12 +30,12 @@ public interface SessionHostsClient { * @return a session host along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname); + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname); /** * 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. @@ -47,7 +49,7 @@ Mono> getWithResponseAsync( /** * 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. @@ -58,12 +60,12 @@ Mono> getWithResponseAsync( * @return a session host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context); /** * 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. @@ -77,7 +79,7 @@ Response getWithResponse( /** * 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. @@ -88,12 +90,12 @@ Response getWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force); /** * 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. @@ -107,7 +109,7 @@ Mono> deleteWithResponseAsync( /** * 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. @@ -119,12 +121,12 @@ Mono> deleteWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context); /** * 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. @@ -137,7 +139,7 @@ Response deleteWithResponse( /** * 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. @@ -149,16 +151,12 @@ Response deleteWithResponse( * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost); + Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, SessionHostPatch sessionHost); /** * 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. @@ -172,7 +170,7 @@ Mono> updateWithResponseAsync( /** * 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. @@ -185,17 +183,12 @@ Mono> updateWithResponseAsync( * @return represents a SessionHost definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost, - Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, SessionHostPatch sessionHost, Context context); /** * 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. @@ -209,7 +202,7 @@ Response updateWithResponse( /** * 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 pageSize Number of items per page. @@ -221,12 +214,12 @@ Response updateWithResponse( * @return sessionHostList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * 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. @@ -239,7 +232,7 @@ PagedFlux listAsync( /** * 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. @@ -252,7 +245,7 @@ PagedFlux listAsync( /** * 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 pageSize Number of items per page. @@ -265,11 +258,6 @@ PagedFlux listAsync( * @return sessionHostList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java index 2a71d539d743..fe8b1c358d8f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/StartMenuItemsClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; -/** An instance of this class provides access to all the operations defined in StartMenuItemsClient. */ +/** + * An instance of this class provides access to all the operations defined in StartMenuItemsClient. + */ public interface StartMenuItemsClient { /** * 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 pageSize Number of items per page. @@ -27,16 +29,12 @@ public interface StartMenuItemsClient { * @return startMenuItemList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip); /** * 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. @@ -49,7 +47,7 @@ PagedFlux listAsync( /** * 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. @@ -62,7 +60,7 @@ PagedFlux listAsync( /** * 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 pageSize Number of items per page. @@ -75,11 +73,6 @@ PagedFlux listAsync( * @return startMenuItemList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java index 36027db5a9d0..2af8408086a6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/UserSessionsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in UserSessionsClient. */ +/** + * An instance of this class provides access to all the operations defined in UserSessionsClient. + */ public interface UserSessionsClient { /** * 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. @@ -31,17 +33,12 @@ public interface UserSessionsClient { * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip); + PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** * 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. @@ -54,7 +51,7 @@ PagedFlux listByHostPoolAsync( /** * 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. @@ -67,7 +64,7 @@ PagedFlux listByHostPoolAsync( /** * 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. @@ -81,18 +78,12 @@ PagedFlux listByHostPoolAsync( * @return userSessionList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * 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. @@ -103,12 +94,12 @@ PagedIterable listByHostPool( * @return a userSession along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId); /** * 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. @@ -119,12 +110,12 @@ Mono> getWithResponseAsync( * @return a userSession on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId); /** * 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. @@ -136,12 +127,12 @@ Mono getAsync( * @return a userSession along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context); /** * 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. @@ -156,7 +147,7 @@ Response getWithResponse( /** * 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. @@ -168,12 +159,12 @@ Response getWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Boolean force); + Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Boolean force); /** * 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. @@ -188,7 +179,7 @@ Mono> deleteWithResponseAsync( /** * 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. @@ -201,17 +192,12 @@ Mono> deleteWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - Boolean force, - Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Boolean force, Context context); /** * 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. @@ -225,7 +211,7 @@ Response deleteWithResponse( /** * 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. @@ -238,17 +224,12 @@ Response deleteWithResponse( * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip); + PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip); /** * 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. @@ -262,7 +243,7 @@ PagedFlux listAsync( /** * 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. @@ -276,7 +257,7 @@ PagedFlux listAsync( /** * 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. @@ -290,18 +271,12 @@ PagedFlux listAsync( * @return userSessionList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * 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. @@ -312,12 +287,12 @@ PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> disconnectWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId); /** * 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. @@ -328,12 +303,12 @@ Mono> disconnectWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono disconnectAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + Mono disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId); /** * 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. @@ -345,12 +320,12 @@ Mono disconnectAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response disconnectWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context); + Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context); /** * 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. @@ -364,7 +339,7 @@ Response disconnectWithResponse( /** * 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. @@ -376,16 +351,12 @@ Response disconnectWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> sendMessageWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage); + Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, SendMessage sendMessage); /** * 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. @@ -396,12 +367,12 @@ Mono> sendMessageWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono sendMessageAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId); + Mono sendMessageAsync(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. @@ -414,17 +385,12 @@ Mono sendMessageAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response sendMessageWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage, - Context context); + Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context); /** * 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. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java index aac2771e92a3..681d79eab9eb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/WorkspacesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspacesClient. + */ public interface WorkspacesClient { /** * 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. @@ -31,7 +33,7 @@ public interface WorkspacesClient { /** * 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. @@ -44,7 +46,7 @@ public interface WorkspacesClient { /** * Get a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -54,12 +56,12 @@ public interface WorkspacesClient { * @return a workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context); /** * 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. @@ -72,7 +74,7 @@ Response getByResourceGroupWithResponse( /** * 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. @@ -82,12 +84,12 @@ Response getByResourceGroupWithResponse( * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner workspace); + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspaceInner workspace); /** * 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. @@ -101,7 +103,7 @@ Mono> createOrUpdateWithResponseAsync( /** * 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. @@ -112,12 +114,12 @@ Mono> createOrUpdateWithResponseAsync( * @return represents a Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner workspace, Context context); /** * 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. @@ -131,7 +133,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -144,7 +146,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -157,7 +159,7 @@ Response createOrUpdateWithResponse( /** * Remove a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -171,7 +173,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -183,7 +185,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -193,12 +195,12 @@ Response createOrUpdateWithResponse( * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspacePatch workspace); + Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspacePatch workspace); /** * 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. @@ -211,7 +213,7 @@ Mono> updateWithResponseAsync( /** * 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. @@ -222,12 +224,12 @@ Mono> updateWithResponseAsync( * @return represents a Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String workspaceName, WorkspacePatch workspace, Context context); + Response updateWithResponse(String resourceGroupName, String workspaceName, + WorkspacePatch workspace, Context context); /** * 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. @@ -240,7 +242,7 @@ Response updateWithResponse( /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -251,12 +253,12 @@ Response updateWithResponse( * @return workspaceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip); + PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip); /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -268,7 +270,7 @@ PagedFlux listByResourceGroupAsync( /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -280,7 +282,7 @@ PagedFlux listByResourceGroupAsync( /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -292,12 +294,12 @@ PagedFlux listByResourceGroupAsync( * @return workspaceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** * List workspaces in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList as paginated response with {@link PagedFlux}. @@ -307,7 +309,7 @@ PagedIterable listByResourceGroup( /** * List workspaces in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList as paginated response with {@link PagedIterable}. @@ -317,7 +319,7 @@ PagedIterable listByResourceGroup( /** * List workspaces in subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java new file mode 100644 index 000000000000..62533c697736 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/AppAttachPackageInner.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Schema for App Attach Package properties. + */ +@Fluent +public final class AppAttachPackageInner extends Resource { + /* + * Detailed properties for App Attach Package + */ + private AppAttachPackageProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AppAttachPackageInner class. + */ + public AppAttachPackageInner() { + } + + /** + * Get the properties property: Detailed properties for App Attach Package. + * + * @return the properties value. + */ + public AppAttachPackageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for App Attach Package. + * + * @param properties the properties value to set. + * @return the AppAttachPackageInner object itself. + */ + public AppAttachPackageInner withProperties(AppAttachPackageProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AppAttachPackageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AppAttachPackageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model AppAttachPackageInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppAttachPackageInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppAttachPackageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppAttachPackageInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppAttachPackageInner. + */ + public static AppAttachPackageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppAttachPackageInner deserializedAppAttachPackageInner = new AppAttachPackageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppAttachPackageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppAttachPackageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppAttachPackageInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAppAttachPackageInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppAttachPackageInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAppAttachPackageInner.properties = AppAttachPackageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppAttachPackageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppAttachPackageInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java index c4f0c2085fdf..0ebffdecc946 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupInner.java @@ -7,94 +7,180 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Represents a ApplicationGroup definition. */ +/** + * Represents a ApplicationGroup definition. + */ @Fluent public final class ApplicationGroupInner extends ResourceModelWithAllowedPropertySet { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for ApplicationGroup + */ + private ApplicationGroupProperties innerProperties = new ApplicationGroupProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for ApplicationGroup + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header + * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested + * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. */ - @JsonProperty(value = "properties", required = true) - private ApplicationGroupProperties innerProperties = new ApplicationGroupProperties(); + private String etag; + + /* + * The type of the resource. + */ + private String type; - /** Creates an instance of ApplicationGroupInner class. */ + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ApplicationGroupInner class. + */ public ApplicationGroupInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for ApplicationGroup. + * + * @return the innerProperties value. + */ + private ApplicationGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ + @Override public SystemData systemData() { return this.systemData; } /** - * Get the innerProperties property: Detailed properties for ApplicationGroup. - * - * @return the innerProperties value. + * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be + * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from + * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), + * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value. */ - private ApplicationGroupProperties innerProperties() { - return this.innerProperties; + @Override + public String etag() { + return this.etag; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withManagedBy(String managedBy) { super.withManagedBy(managedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withKind(String kind) { super.withKind(kind); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withSku(ResourceModelWithAllowedPropertySetSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { super.withPlan(plan); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ApplicationGroupInner withTags(Map tags) { super.withTags(tags); @@ -103,7 +189,7 @@ public ApplicationGroupInner withTags(Map tags) { /** * Get the objectId property: ObjectId of ApplicationGroup. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -112,7 +198,7 @@ public String objectId() { /** * Get the description property: Description of ApplicationGroup. - * + * * @return the description value. */ public String description() { @@ -121,7 +207,7 @@ public String description() { /** * Set the description property: Description of ApplicationGroup. - * + * * @param description the description value to set. * @return the ApplicationGroupInner object itself. */ @@ -135,7 +221,7 @@ public ApplicationGroupInner withDescription(String description) { /** * Get the friendlyName property: Friendly name of ApplicationGroup. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -144,7 +230,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of ApplicationGroup. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationGroupInner object itself. */ @@ -158,7 +244,7 @@ public ApplicationGroupInner withFriendlyName(String friendlyName) { /** * Get the hostPoolArmPath property: HostPool arm path of ApplicationGroup. - * + * * @return the hostPoolArmPath value. */ public String hostPoolArmPath() { @@ -167,7 +253,7 @@ public String hostPoolArmPath() { /** * Set the hostPoolArmPath property: HostPool arm path of ApplicationGroup. - * + * * @param hostPoolArmPath the hostPoolArmPath value to set. * @return the ApplicationGroupInner object itself. */ @@ -181,7 +267,7 @@ public ApplicationGroupInner withHostPoolArmPath(String hostPoolArmPath) { /** * Get the workspaceArmPath property: Workspace arm path of ApplicationGroup. - * + * * @return the workspaceArmPath value. */ public String workspaceArmPath() { @@ -190,7 +276,7 @@ public String workspaceArmPath() { /** * Get the applicationGroupType property: Resource Type of ApplicationGroup. - * + * * @return the applicationGroupType value. */ public ApplicationGroupType applicationGroupType() { @@ -199,7 +285,7 @@ public ApplicationGroupType applicationGroupType() { /** * Set the applicationGroupType property: Resource Type of ApplicationGroup. - * + * * @param applicationGroupType the applicationGroupType value to set. * @return the ApplicationGroupInner object itself. */ @@ -213,7 +299,7 @@ public ApplicationGroupInner withApplicationGroupType(ApplicationGroupType appli /** * Get the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ public Boolean cloudPcResource() { @@ -222,7 +308,7 @@ public Boolean cloudPcResource() { /** * Get the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @return the showInFeed value. */ public Boolean showInFeed() { @@ -231,7 +317,7 @@ public Boolean showInFeed() { /** * Set the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @param showInFeed the showInFeed value to set. * @return the ApplicationGroupInner object itself. */ @@ -245,21 +331,99 @@ public ApplicationGroupInner withShowInFeed(Boolean showInFeed) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ApplicationGroupInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ApplicationGroupInner")); } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(ApplicationGroupInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedBy", managedBy()); + jsonWriter.writeStringField("kind", kind()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("sku", sku()); + jsonWriter.writeJsonField("plan", plan()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGroupInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGroupInner. + */ + public static ApplicationGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGroupInner deserializedApplicationGroupInner = new ApplicationGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApplicationGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApplicationGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationGroupInner.withTags(tags); + } else if ("managedBy".equals(fieldName)) { + deserializedApplicationGroupInner.withManagedBy(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedApplicationGroupInner.withKind(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGroupInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedApplicationGroupInner + .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + } else if ("sku".equals(fieldName)) { + deserializedApplicationGroupInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("plan".equals(fieldName)) { + deserializedApplicationGroupInner + .withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedApplicationGroupInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGroupInner.innerProperties = ApplicationGroupProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGroupInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java index d950f7dda412..1fe5dfd70fef 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupPatchProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** ApplicationGroup properties that can be patched. */ +/** + * ApplicationGroup properties that can be patched. + */ @Fluent -public final class ApplicationGroupPatchProperties { +public final class ApplicationGroupPatchProperties implements JsonSerializable { /* * Description of ApplicationGroup. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of ApplicationGroup. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Boolean representing whether the applicationGroup is show in the feed. */ - @JsonProperty(value = "showInFeed") private Boolean showInFeed; - /** Creates an instance of ApplicationGroupPatchProperties class. */ + /** + * Creates an instance of ApplicationGroupPatchProperties class. + */ public ApplicationGroupPatchProperties() { } /** * Get the description property: Description of ApplicationGroup. - * + * * @return the description value. */ public String description() { @@ -43,7 +48,7 @@ public String description() { /** * Set the description property: Description of ApplicationGroup. - * + * * @param description the description value to set. * @return the ApplicationGroupPatchProperties object itself. */ @@ -54,7 +59,7 @@ public ApplicationGroupPatchProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of ApplicationGroup. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -63,7 +68,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of ApplicationGroup. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationGroupPatchProperties object itself. */ @@ -74,7 +79,7 @@ public ApplicationGroupPatchProperties withFriendlyName(String friendlyName) { /** * Get the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @return the showInFeed value. */ public Boolean showInFeed() { @@ -83,7 +88,7 @@ public Boolean showInFeed() { /** * Set the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @param showInFeed the showInFeed value to set. * @return the ApplicationGroupPatchProperties object itself. */ @@ -94,9 +99,52 @@ public ApplicationGroupPatchProperties withShowInFeed(Boolean showInFeed) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeBooleanField("showInFeed", this.showInFeed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGroupPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGroupPatchProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGroupPatchProperties. + */ + public static ApplicationGroupPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGroupPatchProperties deserializedApplicationGroupPatchProperties + = new ApplicationGroupPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedApplicationGroupPatchProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedApplicationGroupPatchProperties.friendlyName = reader.getString(); + } else if ("showInFeed".equals(fieldName)) { + deserializedApplicationGroupPatchProperties.showInFeed = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGroupPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java index ddf0c382b536..2dcc2c5fcf98 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationGroupProperties.java @@ -6,67 +6,67 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Schema for ApplicationGroup properties. */ +/** + * Schema for ApplicationGroup properties. + */ @Fluent -public final class ApplicationGroupProperties { +public final class ApplicationGroupProperties implements JsonSerializable { /* * ObjectId of ApplicationGroup. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Description of ApplicationGroup. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of ApplicationGroup. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * HostPool arm path of ApplicationGroup. */ - @JsonProperty(value = "hostPoolArmPath", required = true) private String hostPoolArmPath; /* * Workspace arm path of ApplicationGroup. */ - @JsonProperty(value = "workspaceArmPath", access = JsonProperty.Access.WRITE_ONLY) private String workspaceArmPath; /* * Resource Type of ApplicationGroup. */ - @JsonProperty(value = "applicationGroupType", required = true) private ApplicationGroupType applicationGroupType; /* * Is cloud pc resource. */ - @JsonProperty(value = "cloudPcResource", access = JsonProperty.Access.WRITE_ONLY) private Boolean cloudPcResource; /* * Boolean representing whether the applicationGroup is show in the feed. */ - @JsonProperty(value = "showInFeed") private Boolean showInFeed; - /** Creates an instance of ApplicationGroupProperties class. */ + /** + * Creates an instance of ApplicationGroupProperties class. + */ public ApplicationGroupProperties() { } /** * Get the objectId property: ObjectId of ApplicationGroup. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -75,7 +75,7 @@ public String objectId() { /** * Get the description property: Description of ApplicationGroup. - * + * * @return the description value. */ public String description() { @@ -84,7 +84,7 @@ public String description() { /** * Set the description property: Description of ApplicationGroup. - * + * * @param description the description value to set. * @return the ApplicationGroupProperties object itself. */ @@ -95,7 +95,7 @@ public ApplicationGroupProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of ApplicationGroup. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -104,7 +104,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of ApplicationGroup. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationGroupProperties object itself. */ @@ -115,7 +115,7 @@ public ApplicationGroupProperties withFriendlyName(String friendlyName) { /** * Get the hostPoolArmPath property: HostPool arm path of ApplicationGroup. - * + * * @return the hostPoolArmPath value. */ public String hostPoolArmPath() { @@ -124,7 +124,7 @@ public String hostPoolArmPath() { /** * Set the hostPoolArmPath property: HostPool arm path of ApplicationGroup. - * + * * @param hostPoolArmPath the hostPoolArmPath value to set. * @return the ApplicationGroupProperties object itself. */ @@ -135,7 +135,7 @@ public ApplicationGroupProperties withHostPoolArmPath(String hostPoolArmPath) { /** * Get the workspaceArmPath property: Workspace arm path of ApplicationGroup. - * + * * @return the workspaceArmPath value. */ public String workspaceArmPath() { @@ -144,7 +144,7 @@ public String workspaceArmPath() { /** * Get the applicationGroupType property: Resource Type of ApplicationGroup. - * + * * @return the applicationGroupType value. */ public ApplicationGroupType applicationGroupType() { @@ -153,7 +153,7 @@ public ApplicationGroupType applicationGroupType() { /** * Set the applicationGroupType property: Resource Type of ApplicationGroup. - * + * * @param applicationGroupType the applicationGroupType value to set. * @return the ApplicationGroupProperties object itself. */ @@ -164,7 +164,7 @@ public ApplicationGroupProperties withApplicationGroupType(ApplicationGroupType /** * Get the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ public Boolean cloudPcResource() { @@ -173,7 +173,7 @@ public Boolean cloudPcResource() { /** * Get the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @return the showInFeed value. */ public Boolean showInFeed() { @@ -182,7 +182,7 @@ public Boolean showInFeed() { /** * Set the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @param showInFeed the showInFeed value to set. * @return the ApplicationGroupProperties object itself. */ @@ -193,23 +193,78 @@ public ApplicationGroupProperties withShowInFeed(Boolean showInFeed) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (hostPoolArmPath() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property hostPoolArmPath in model ApplicationGroupProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostPoolArmPath in model ApplicationGroupProperties")); } if (applicationGroupType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property applicationGroupType in model ApplicationGroupProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property applicationGroupType in model ApplicationGroupProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(ApplicationGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostPoolArmPath", this.hostPoolArmPath); + jsonWriter.writeStringField("applicationGroupType", + this.applicationGroupType == null ? null : this.applicationGroupType.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeBooleanField("showInFeed", this.showInFeed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGroupProperties. + */ + public static ApplicationGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGroupProperties deserializedApplicationGroupProperties = new ApplicationGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostPoolArmPath".equals(fieldName)) { + deserializedApplicationGroupProperties.hostPoolArmPath = reader.getString(); + } else if ("applicationGroupType".equals(fieldName)) { + deserializedApplicationGroupProperties.applicationGroupType + = ApplicationGroupType.fromString(reader.getString()); + } else if ("objectId".equals(fieldName)) { + deserializedApplicationGroupProperties.objectId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedApplicationGroupProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedApplicationGroupProperties.friendlyName = reader.getString(); + } else if ("workspaceArmPath".equals(fieldName)) { + deserializedApplicationGroupProperties.workspaceArmPath = reader.getString(); + } else if ("cloudPcResource".equals(fieldName)) { + deserializedApplicationGroupProperties.cloudPcResource = reader.getNullable(JsonReader::getBoolean); + } else if ("showInFeed".equals(fieldName)) { + deserializedApplicationGroupProperties.showInFeed = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGroupProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java index 95a3eee8def3..e8a03b6ecb15 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationInner.java @@ -8,32 +8,63 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Schema for Application properties. */ +/** + * Schema for Application properties. + */ @Fluent public final class ApplicationInner extends ProxyResource { + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + + /* + * Detailed properties for Application + */ + private ApplicationProperties innerProperties = new ApplicationProperties(); + /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for Application + * The type of the resource. */ - @JsonProperty(value = "properties", required = true) - private ApplicationProperties innerProperties = new ApplicationProperties(); + private String type; + + /* + * The name of the resource. + */ + private String name; - /** Creates an instance of ApplicationInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ApplicationInner class. + */ public ApplicationInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for Application. + * + * @return the innerProperties value. + */ + private ApplicationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -41,17 +72,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for Application. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private ApplicationProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the objectId property: ObjectId of Application. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -60,7 +112,7 @@ public String objectId() { /** * Get the description property: Description of Application. - * + * * @return the description value. */ public String description() { @@ -69,7 +121,7 @@ public String description() { /** * Set the description property: Description of Application. - * + * * @param description the description value to set. * @return the ApplicationInner object itself. */ @@ -83,7 +135,7 @@ public ApplicationInner withDescription(String description) { /** * Get the friendlyName property: Friendly name of Application. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -92,7 +144,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Application. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationInner object itself. */ @@ -106,7 +158,7 @@ public ApplicationInner withFriendlyName(String friendlyName) { /** * Get the filePath property: Specifies a path for the executable file for the application. - * + * * @return the filePath value. */ public String filePath() { @@ -115,7 +167,7 @@ public String filePath() { /** * Set the filePath property: Specifies a path for the executable file for the application. - * + * * @param filePath the filePath value to set. * @return the ApplicationInner object itself. */ @@ -129,7 +181,7 @@ public ApplicationInner withFilePath(String filePath) { /** * Get the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @return the msixPackageFamilyName value. */ public String msixPackageFamilyName() { @@ -138,7 +190,7 @@ public String msixPackageFamilyName() { /** * Set the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @param msixPackageFamilyName the msixPackageFamilyName value to set. * @return the ApplicationInner object itself. */ @@ -152,7 +204,7 @@ public ApplicationInner withMsixPackageFamilyName(String msixPackageFamilyName) /** * Get the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @return the msixPackageApplicationId value. */ public String msixPackageApplicationId() { @@ -161,7 +213,7 @@ public String msixPackageApplicationId() { /** * Set the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @param msixPackageApplicationId the msixPackageApplicationId value to set. * @return the ApplicationInner object itself. */ @@ -175,7 +227,7 @@ public ApplicationInner withMsixPackageApplicationId(String msixPackageApplicati /** * Get the applicationType property: Resource Type of Application. - * + * * @return the applicationType value. */ public RemoteApplicationType applicationType() { @@ -184,7 +236,7 @@ public RemoteApplicationType applicationType() { /** * Set the applicationType property: Resource Type of Application. - * + * * @param applicationType the applicationType value to set. * @return the ApplicationInner object itself. */ @@ -200,7 +252,7 @@ public ApplicationInner withApplicationType(RemoteApplicationType applicationTyp * Get the commandLineSetting property: 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. - * + * * @return the commandLineSetting value. */ public CommandLineSetting commandLineSetting() { @@ -211,7 +263,7 @@ public CommandLineSetting commandLineSetting() { * Set the commandLineSetting property: 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. - * + * * @param commandLineSetting the commandLineSetting value to set. * @return the ApplicationInner object itself. */ @@ -225,7 +277,7 @@ public ApplicationInner withCommandLineSetting(CommandLineSetting commandLineSet /** * Get the commandLineArguments property: Command Line Arguments for Application. - * + * * @return the commandLineArguments value. */ public String commandLineArguments() { @@ -234,7 +286,7 @@ public String commandLineArguments() { /** * Set the commandLineArguments property: Command Line Arguments for Application. - * + * * @param commandLineArguments the commandLineArguments value to set. * @return the ApplicationInner object itself. */ @@ -248,7 +300,7 @@ public ApplicationInner withCommandLineArguments(String commandLineArguments) { /** * Get the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @return the showInPortal value. */ public Boolean showInPortal() { @@ -257,7 +309,7 @@ public Boolean showInPortal() { /** * Set the showInPortal property: 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. */ @@ -271,7 +323,7 @@ public ApplicationInner withShowInPortal(Boolean showInPortal) { /** * Get the iconPath property: Path to icon. - * + * * @return the iconPath value. */ public String iconPath() { @@ -280,7 +332,7 @@ public String iconPath() { /** * Set the iconPath property: Path to icon. - * + * * @param iconPath the iconPath value to set. * @return the ApplicationInner object itself. */ @@ -294,7 +346,7 @@ public ApplicationInner withIconPath(String iconPath) { /** * Get the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ public Integer iconIndex() { @@ -303,7 +355,7 @@ public Integer iconIndex() { /** * Set the iconIndex property: Index of the icon. - * + * * @param iconIndex the iconIndex value to set. * @return the ApplicationInner object itself. */ @@ -317,7 +369,7 @@ public ApplicationInner withIconIndex(Integer iconIndex) { /** * Get the iconHash property: Hash of the icon. - * + * * @return the iconHash value. */ public String iconHash() { @@ -326,28 +378,72 @@ public String iconHash() { /** * Get the iconContent property: the icon a 64 bit string as a byte array. - * + * * @return the iconContent value. */ public byte[] iconContent() { - return this.innerProperties() == null ? new byte[0] : this.innerProperties().iconContent(); + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().iconContent(); } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ApplicationInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ApplicationInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ApplicationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationInner. + */ + public static ApplicationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationInner deserializedApplicationInner = new ApplicationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApplicationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedApplicationInner.innerProperties = ApplicationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedApplicationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java index 48003f018adb..af072a7d7b8d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationPatchProperties.java @@ -5,87 +5,84 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Application properties that can be patched. */ +/** + * Application properties that can be patched. + */ @Fluent -public final class ApplicationPatchProperties { +public final class ApplicationPatchProperties implements JsonSerializable { /* * Description of Application. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of Application. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Specifies a path for the executable file for the application. */ - @JsonProperty(value = "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. */ - @JsonProperty(value = "commandLineSetting") private CommandLineSetting commandLineSetting; /* * Command Line Arguments for Application. */ - @JsonProperty(value = "commandLineArguments") private String commandLineArguments; /* * Specifies whether to show the RemoteApp program in the RD Web Access server. */ - @JsonProperty(value = "showInPortal") private Boolean showInPortal; /* * Path to icon. */ - @JsonProperty(value = "iconPath") private String iconPath; /* * Index of the icon. */ - @JsonProperty(value = "iconIndex") private Integer iconIndex; /* * Specifies the package family name for MSIX applications */ - @JsonProperty(value = "msixPackageFamilyName") private String msixPackageFamilyName; /* * Specifies the package application Id for MSIX applications */ - @JsonProperty(value = "msixPackageApplicationId") private String msixPackageApplicationId; /* * Resource Type of Application. */ - @JsonProperty(value = "applicationType") private RemoteApplicationType applicationType; - /** Creates an instance of ApplicationPatchProperties class. */ + /** + * Creates an instance of ApplicationPatchProperties class. + */ public ApplicationPatchProperties() { } /** * Get the description property: Description of Application. - * + * * @return the description value. */ public String description() { @@ -94,7 +91,7 @@ public String description() { /** * Set the description property: Description of Application. - * + * * @param description the description value to set. * @return the ApplicationPatchProperties object itself. */ @@ -105,7 +102,7 @@ public ApplicationPatchProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of Application. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -114,7 +111,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Application. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationPatchProperties object itself. */ @@ -125,7 +122,7 @@ public ApplicationPatchProperties withFriendlyName(String friendlyName) { /** * Get the filePath property: Specifies a path for the executable file for the application. - * + * * @return the filePath value. */ public String filePath() { @@ -134,7 +131,7 @@ public String filePath() { /** * Set the filePath property: Specifies a path for the executable file for the application. - * + * * @param filePath the filePath value to set. * @return the ApplicationPatchProperties object itself. */ @@ -147,7 +144,7 @@ public ApplicationPatchProperties withFilePath(String filePath) { * Get the commandLineSetting property: 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. - * + * * @return the commandLineSetting value. */ public CommandLineSetting commandLineSetting() { @@ -158,7 +155,7 @@ public CommandLineSetting commandLineSetting() { * Set the commandLineSetting property: 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. - * + * * @param commandLineSetting the commandLineSetting value to set. * @return the ApplicationPatchProperties object itself. */ @@ -169,7 +166,7 @@ public ApplicationPatchProperties withCommandLineSetting(CommandLineSetting comm /** * Get the commandLineArguments property: Command Line Arguments for Application. - * + * * @return the commandLineArguments value. */ public String commandLineArguments() { @@ -178,7 +175,7 @@ public String commandLineArguments() { /** * Set the commandLineArguments property: Command Line Arguments for Application. - * + * * @param commandLineArguments the commandLineArguments value to set. * @return the ApplicationPatchProperties object itself. */ @@ -189,7 +186,7 @@ public ApplicationPatchProperties withCommandLineArguments(String commandLineArg /** * Get the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @return the showInPortal value. */ public Boolean showInPortal() { @@ -198,7 +195,7 @@ public Boolean showInPortal() { /** * Set the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @param showInPortal the showInPortal value to set. * @return the ApplicationPatchProperties object itself. */ @@ -209,7 +206,7 @@ public ApplicationPatchProperties withShowInPortal(Boolean showInPortal) { /** * Get the iconPath property: Path to icon. - * + * * @return the iconPath value. */ public String iconPath() { @@ -218,7 +215,7 @@ public String iconPath() { /** * Set the iconPath property: Path to icon. - * + * * @param iconPath the iconPath value to set. * @return the ApplicationPatchProperties object itself. */ @@ -229,7 +226,7 @@ public ApplicationPatchProperties withIconPath(String iconPath) { /** * Get the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ public Integer iconIndex() { @@ -238,7 +235,7 @@ public Integer iconIndex() { /** * Set the iconIndex property: Index of the icon. - * + * * @param iconIndex the iconIndex value to set. * @return the ApplicationPatchProperties object itself. */ @@ -249,7 +246,7 @@ public ApplicationPatchProperties withIconIndex(Integer iconIndex) { /** * Get the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @return the msixPackageFamilyName value. */ public String msixPackageFamilyName() { @@ -258,7 +255,7 @@ public String msixPackageFamilyName() { /** * Set the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @param msixPackageFamilyName the msixPackageFamilyName value to set. * @return the ApplicationPatchProperties object itself. */ @@ -269,7 +266,7 @@ public ApplicationPatchProperties withMsixPackageFamilyName(String msixPackageFa /** * Get the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @return the msixPackageApplicationId value. */ public String msixPackageApplicationId() { @@ -278,7 +275,7 @@ public String msixPackageApplicationId() { /** * Set the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @param msixPackageApplicationId the msixPackageApplicationId value to set. * @return the ApplicationPatchProperties object itself. */ @@ -289,7 +286,7 @@ public ApplicationPatchProperties withMsixPackageApplicationId(String msixPackag /** * Get the applicationType property: Resource Type of Application. - * + * * @return the applicationType value. */ public RemoteApplicationType applicationType() { @@ -298,7 +295,7 @@ public RemoteApplicationType applicationType() { /** * Set the applicationType property: Resource Type of Application. - * + * * @param applicationType the applicationType value to set. * @return the ApplicationPatchProperties object itself. */ @@ -309,9 +306,79 @@ public ApplicationPatchProperties withApplicationType(RemoteApplicationType appl /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("filePath", this.filePath); + jsonWriter.writeStringField("commandLineSetting", + this.commandLineSetting == null ? null : this.commandLineSetting.toString()); + jsonWriter.writeStringField("commandLineArguments", this.commandLineArguments); + jsonWriter.writeBooleanField("showInPortal", this.showInPortal); + jsonWriter.writeStringField("iconPath", this.iconPath); + jsonWriter.writeNumberField("iconIndex", this.iconIndex); + jsonWriter.writeStringField("msixPackageFamilyName", this.msixPackageFamilyName); + jsonWriter.writeStringField("msixPackageApplicationId", this.msixPackageApplicationId); + jsonWriter.writeStringField("applicationType", + this.applicationType == null ? null : this.applicationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationPatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationPatchProperties. + */ + public static ApplicationPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationPatchProperties deserializedApplicationPatchProperties = new ApplicationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedApplicationPatchProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedApplicationPatchProperties.friendlyName = reader.getString(); + } else if ("filePath".equals(fieldName)) { + deserializedApplicationPatchProperties.filePath = reader.getString(); + } else if ("commandLineSetting".equals(fieldName)) { + deserializedApplicationPatchProperties.commandLineSetting + = CommandLineSetting.fromString(reader.getString()); + } else if ("commandLineArguments".equals(fieldName)) { + deserializedApplicationPatchProperties.commandLineArguments = reader.getString(); + } else if ("showInPortal".equals(fieldName)) { + deserializedApplicationPatchProperties.showInPortal = reader.getNullable(JsonReader::getBoolean); + } else if ("iconPath".equals(fieldName)) { + deserializedApplicationPatchProperties.iconPath = reader.getString(); + } else if ("iconIndex".equals(fieldName)) { + deserializedApplicationPatchProperties.iconIndex = reader.getNullable(JsonReader::getInt); + } else if ("msixPackageFamilyName".equals(fieldName)) { + deserializedApplicationPatchProperties.msixPackageFamilyName = reader.getString(); + } else if ("msixPackageApplicationId".equals(fieldName)) { + deserializedApplicationPatchProperties.msixPackageApplicationId = reader.getString(); + } else if ("applicationType".equals(fieldName)) { + deserializedApplicationPatchProperties.applicationType + = RemoteApplicationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java index cb168d91b007..b86fd5c46140 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ApplicationProperties.java @@ -7,105 +7,99 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Schema for Application properties. */ +/** + * Schema for Application properties. + */ @Fluent -public final class ApplicationProperties { +public final class ApplicationProperties implements JsonSerializable { /* * ObjectId of Application. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Description of Application. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of Application. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Specifies a path for the executable file for the application. */ - @JsonProperty(value = "filePath") private String filePath; /* * Specifies the package family name for MSIX applications */ - @JsonProperty(value = "msixPackageFamilyName") private String msixPackageFamilyName; /* * Specifies the package application Id for MSIX applications */ - @JsonProperty(value = "msixPackageApplicationId") private String msixPackageApplicationId; /* * Resource Type of Application. */ - @JsonProperty(value = "applicationType") private RemoteApplicationType applicationType; /* * Specifies whether this published application can be launched with command line arguments provided by the client, * command line arguments specified at publish time, or no command line arguments at all. */ - @JsonProperty(value = "commandLineSetting", required = true) private CommandLineSetting commandLineSetting; /* * Command Line Arguments for Application. */ - @JsonProperty(value = "commandLineArguments") private String commandLineArguments; /* * Specifies whether to show the RemoteApp program in the RD Web Access server. */ - @JsonProperty(value = "showInPortal") private Boolean showInPortal; /* * Path to icon. */ - @JsonProperty(value = "iconPath") private String iconPath; /* * Index of the icon. */ - @JsonProperty(value = "iconIndex") private Integer iconIndex; /* * Hash of the icon. */ - @JsonProperty(value = "iconHash", access = JsonProperty.Access.WRITE_ONLY) private String iconHash; /* * the icon a 64 bit string as a byte array. */ - @JsonProperty(value = "iconContent", access = JsonProperty.Access.WRITE_ONLY) private byte[] iconContent; - /** Creates an instance of ApplicationProperties class. */ + /** + * Creates an instance of ApplicationProperties class. + */ public ApplicationProperties() { } /** * Get the objectId property: ObjectId of Application. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -114,7 +108,7 @@ public String objectId() { /** * Get the description property: Description of Application. - * + * * @return the description value. */ public String description() { @@ -123,7 +117,7 @@ public String description() { /** * Set the description property: Description of Application. - * + * * @param description the description value to set. * @return the ApplicationProperties object itself. */ @@ -134,7 +128,7 @@ public ApplicationProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of Application. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -143,7 +137,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Application. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationProperties object itself. */ @@ -154,7 +148,7 @@ public ApplicationProperties withFriendlyName(String friendlyName) { /** * Get the filePath property: Specifies a path for the executable file for the application. - * + * * @return the filePath value. */ public String filePath() { @@ -163,7 +157,7 @@ public String filePath() { /** * Set the filePath property: Specifies a path for the executable file for the application. - * + * * @param filePath the filePath value to set. * @return the ApplicationProperties object itself. */ @@ -174,7 +168,7 @@ public ApplicationProperties withFilePath(String filePath) { /** * Get the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @return the msixPackageFamilyName value. */ public String msixPackageFamilyName() { @@ -183,7 +177,7 @@ public String msixPackageFamilyName() { /** * Set the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @param msixPackageFamilyName the msixPackageFamilyName value to set. * @return the ApplicationProperties object itself. */ @@ -194,7 +188,7 @@ public ApplicationProperties withMsixPackageFamilyName(String msixPackageFamilyN /** * Get the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @return the msixPackageApplicationId value. */ public String msixPackageApplicationId() { @@ -203,7 +197,7 @@ public String msixPackageApplicationId() { /** * Set the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @param msixPackageApplicationId the msixPackageApplicationId value to set. * @return the ApplicationProperties object itself. */ @@ -214,7 +208,7 @@ public ApplicationProperties withMsixPackageApplicationId(String msixPackageAppl /** * Get the applicationType property: Resource Type of Application. - * + * * @return the applicationType value. */ public RemoteApplicationType applicationType() { @@ -223,7 +217,7 @@ public RemoteApplicationType applicationType() { /** * Set the applicationType property: Resource Type of Application. - * + * * @param applicationType the applicationType value to set. * @return the ApplicationProperties object itself. */ @@ -236,7 +230,7 @@ public ApplicationProperties withApplicationType(RemoteApplicationType applicati * Get the commandLineSetting property: 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. - * + * * @return the commandLineSetting value. */ public CommandLineSetting commandLineSetting() { @@ -247,7 +241,7 @@ public CommandLineSetting commandLineSetting() { * Set the commandLineSetting property: 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. - * + * * @param commandLineSetting the commandLineSetting value to set. * @return the ApplicationProperties object itself. */ @@ -258,7 +252,7 @@ public ApplicationProperties withCommandLineSetting(CommandLineSetting commandLi /** * Get the commandLineArguments property: Command Line Arguments for Application. - * + * * @return the commandLineArguments value. */ public String commandLineArguments() { @@ -267,7 +261,7 @@ public String commandLineArguments() { /** * Set the commandLineArguments property: Command Line Arguments for Application. - * + * * @param commandLineArguments the commandLineArguments value to set. * @return the ApplicationProperties object itself. */ @@ -278,7 +272,7 @@ public ApplicationProperties withCommandLineArguments(String commandLineArgument /** * Get the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @return the showInPortal value. */ public Boolean showInPortal() { @@ -287,7 +281,7 @@ public Boolean showInPortal() { /** * Set the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @param showInPortal the showInPortal value to set. * @return the ApplicationProperties object itself. */ @@ -298,7 +292,7 @@ public ApplicationProperties withShowInPortal(Boolean showInPortal) { /** * Get the iconPath property: Path to icon. - * + * * @return the iconPath value. */ public String iconPath() { @@ -307,7 +301,7 @@ public String iconPath() { /** * Set the iconPath property: Path to icon. - * + * * @param iconPath the iconPath value to set. * @return the ApplicationProperties object itself. */ @@ -318,7 +312,7 @@ public ApplicationProperties withIconPath(String iconPath) { /** * Get the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ public Integer iconIndex() { @@ -327,7 +321,7 @@ public Integer iconIndex() { /** * Set the iconIndex property: Index of the icon. - * + * * @param iconIndex the iconIndex value to set. * @return the ApplicationProperties object itself. */ @@ -338,7 +332,7 @@ public ApplicationProperties withIconIndex(Integer iconIndex) { /** * Get the iconHash property: Hash of the icon. - * + * * @return the iconHash value. */ public String iconHash() { @@ -347,7 +341,7 @@ public String iconHash() { /** * Get the iconContent property: the icon a 64 bit string as a byte array. - * + * * @return the iconContent value. */ public byte[] iconContent() { @@ -356,17 +350,93 @@ public byte[] iconContent() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (commandLineSetting() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property commandLineSetting in model ApplicationProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property commandLineSetting in model ApplicationProperties")); } } private static final ClientLogger LOGGER = new ClientLogger(ApplicationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("commandLineSetting", + this.commandLineSetting == null ? null : this.commandLineSetting.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("filePath", this.filePath); + jsonWriter.writeStringField("msixPackageFamilyName", this.msixPackageFamilyName); + jsonWriter.writeStringField("msixPackageApplicationId", this.msixPackageApplicationId); + jsonWriter.writeStringField("applicationType", + this.applicationType == null ? null : this.applicationType.toString()); + jsonWriter.writeStringField("commandLineArguments", this.commandLineArguments); + jsonWriter.writeBooleanField("showInPortal", this.showInPortal); + jsonWriter.writeStringField("iconPath", this.iconPath); + jsonWriter.writeNumberField("iconIndex", this.iconIndex); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationProperties. + */ + public static ApplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationProperties deserializedApplicationProperties = new ApplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("commandLineSetting".equals(fieldName)) { + deserializedApplicationProperties.commandLineSetting + = CommandLineSetting.fromString(reader.getString()); + } else if ("objectId".equals(fieldName)) { + deserializedApplicationProperties.objectId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedApplicationProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedApplicationProperties.friendlyName = reader.getString(); + } else if ("filePath".equals(fieldName)) { + deserializedApplicationProperties.filePath = reader.getString(); + } else if ("msixPackageFamilyName".equals(fieldName)) { + deserializedApplicationProperties.msixPackageFamilyName = reader.getString(); + } else if ("msixPackageApplicationId".equals(fieldName)) { + deserializedApplicationProperties.msixPackageApplicationId = reader.getString(); + } else if ("applicationType".equals(fieldName)) { + deserializedApplicationProperties.applicationType + = RemoteApplicationType.fromString(reader.getString()); + } else if ("commandLineArguments".equals(fieldName)) { + deserializedApplicationProperties.commandLineArguments = reader.getString(); + } else if ("showInPortal".equals(fieldName)) { + deserializedApplicationProperties.showInPortal = reader.getNullable(JsonReader::getBoolean); + } else if ("iconPath".equals(fieldName)) { + deserializedApplicationProperties.iconPath = reader.getString(); + } else if ("iconIndex".equals(fieldName)) { + deserializedApplicationProperties.iconIndex = reader.getNullable(JsonReader::getInt); + } else if ("iconHash".equals(fieldName)) { + deserializedApplicationProperties.iconHash = reader.getString(); + } else if ("iconContent".equals(fieldName)) { + deserializedApplicationProperties.iconContent = reader.getBinary(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java index 664d9527b2b6..9a0caab916f8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopInner.java @@ -7,30 +7,61 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Schema for Desktop properties. */ +/** + * Schema for Desktop properties. + */ @Fluent public final class DesktopInner extends ProxyResource { + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + + /* + * Detailed properties for Desktop + */ + private DesktopProperties innerProperties; + /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for Desktop + * The type of the resource. */ - @JsonProperty(value = "properties") - private DesktopProperties innerProperties; + private String type; + + /* + * The name of the resource. + */ + private String name; - /** Creates an instance of DesktopInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DesktopInner class. + */ public DesktopInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for Desktop. + * + * @return the innerProperties value. + */ + private DesktopProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -38,17 +69,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for Desktop. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private DesktopProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the objectId property: ObjectId of Desktop. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -57,7 +109,7 @@ public String objectId() { /** * Get the description property: Description of Desktop. - * + * * @return the description value. */ public String description() { @@ -66,7 +118,7 @@ public String description() { /** * Set the description property: Description of Desktop. - * + * * @param description the description value to set. * @return the DesktopInner object itself. */ @@ -80,7 +132,7 @@ public DesktopInner withDescription(String description) { /** * Get the friendlyName property: Friendly name of Desktop. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -89,7 +141,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Desktop. - * + * * @param friendlyName the friendlyName value to set. * @return the DesktopInner object itself. */ @@ -103,7 +155,7 @@ public DesktopInner withFriendlyName(String friendlyName) { /** * Get the iconHash property: Hash of the icon. - * + * * @return the iconHash value. */ public String iconHash() { @@ -112,16 +164,16 @@ public String iconHash() { /** * Get the iconContent property: The icon a 64 bit string as a byte array. - * + * * @return the iconContent value. */ public byte[] iconContent() { - return this.innerProperties() == null ? new byte[0] : this.innerProperties().iconContent(); + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().iconContent(); } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -129,4 +181,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DesktopInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DesktopInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DesktopInner. + */ + public static DesktopInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DesktopInner deserializedDesktopInner = new DesktopInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDesktopInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDesktopInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDesktopInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDesktopInner.innerProperties = DesktopProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDesktopInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDesktopInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java index 5b2861930ca8..43518a5e4f94 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopPatchProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Desktop properties that can be patched. */ +/** + * Desktop properties that can be patched. + */ @Fluent -public final class DesktopPatchProperties { +public final class DesktopPatchProperties implements JsonSerializable { /* * Description of Desktop. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of Desktop. */ - @JsonProperty(value = "friendlyName") private String friendlyName; - /** Creates an instance of DesktopPatchProperties class. */ + /** + * Creates an instance of DesktopPatchProperties class. + */ public DesktopPatchProperties() { } /** * Get the description property: Description of Desktop. - * + * * @return the description value. */ public String description() { @@ -37,7 +43,7 @@ public String description() { /** * Set the description property: Description of Desktop. - * + * * @param description the description value to set. * @return the DesktopPatchProperties object itself. */ @@ -48,7 +54,7 @@ public DesktopPatchProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of Desktop. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -57,7 +63,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Desktop. - * + * * @param friendlyName the friendlyName value to set. * @return the DesktopPatchProperties object itself. */ @@ -68,9 +74,48 @@ public DesktopPatchProperties withFriendlyName(String friendlyName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DesktopPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DesktopPatchProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DesktopPatchProperties. + */ + public static DesktopPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DesktopPatchProperties deserializedDesktopPatchProperties = new DesktopPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDesktopPatchProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedDesktopPatchProperties.friendlyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDesktopPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java index de310b145b67..2d7a8bb27df9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/DesktopProperties.java @@ -6,48 +6,51 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Schema for Desktop properties. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Schema for Desktop properties. + */ @Fluent -public final class DesktopProperties { +public final class DesktopProperties implements JsonSerializable { /* * ObjectId of Desktop. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Description of Desktop. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of Desktop. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Hash of the icon. */ - @JsonProperty(value = "iconHash", access = JsonProperty.Access.WRITE_ONLY) private String iconHash; /* * The icon a 64 bit string as a byte array. */ - @JsonProperty(value = "iconContent", access = JsonProperty.Access.WRITE_ONLY) private byte[] iconContent; - /** Creates an instance of DesktopProperties class. */ + /** + * Creates an instance of DesktopProperties class. + */ public DesktopProperties() { } /** * Get the objectId property: ObjectId of Desktop. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -56,7 +59,7 @@ public String objectId() { /** * Get the description property: Description of Desktop. - * + * * @return the description value. */ public String description() { @@ -65,7 +68,7 @@ public String description() { /** * Set the description property: Description of Desktop. - * + * * @param description the description value to set. * @return the DesktopProperties object itself. */ @@ -76,7 +79,7 @@ public DesktopProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of Desktop. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -85,7 +88,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Desktop. - * + * * @param friendlyName the friendlyName value to set. * @return the DesktopProperties object itself. */ @@ -96,7 +99,7 @@ public DesktopProperties withFriendlyName(String friendlyName) { /** * Get the iconHash property: Hash of the icon. - * + * * @return the iconHash value. */ public String iconHash() { @@ -105,7 +108,7 @@ public String iconHash() { /** * Get the iconContent property: The icon a 64 bit string as a byte array. - * + * * @return the iconContent value. */ public byte[] iconContent() { @@ -114,9 +117,54 @@ public byte[] iconContent() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DesktopProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DesktopProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DesktopProperties. + */ + public static DesktopProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DesktopProperties deserializedDesktopProperties = new DesktopProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectId".equals(fieldName)) { + deserializedDesktopProperties.objectId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDesktopProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedDesktopProperties.friendlyName = reader.getString(); + } else if ("iconHash".equals(fieldName)) { + deserializedDesktopProperties.iconHash = reader.getString(); + } else if ("iconContent".equals(fieldName)) { + deserializedDesktopProperties.iconContent = reader.getBinary(); + } else { + reader.skipChildren(); + } + } + + return deserializedDesktopProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java index b58ac6261582..e5d7fce17dc0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageInner.java @@ -6,37 +6,103 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** Represents the definition of contents retrieved after expanding the MSIX Image. */ +/** + * Represents the definition of contents retrieved after expanding the MSIX Image. + */ @Fluent public final class ExpandMsixImageInner extends ProxyResource { /* * Detailed properties for ExpandMsixImage */ - @JsonProperty(value = "properties") private ExpandMsixImageProperties innerProperties; - /** Creates an instance of ExpandMsixImageInner class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ExpandMsixImageInner class. + */ public ExpandMsixImageInner() { } /** * Get the innerProperties property: Detailed properties for ExpandMsixImage. - * + * * @return the innerProperties value. */ private ExpandMsixImageProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the packageAlias property: Alias of MSIX Package. - * + * * @return the packageAlias value. */ public String packageAlias() { @@ -45,7 +111,7 @@ public String packageAlias() { /** * Set the packageAlias property: Alias of MSIX Package. - * + * * @param packageAlias the packageAlias value to set. * @return the ExpandMsixImageInner object itself. */ @@ -59,7 +125,7 @@ public ExpandMsixImageInner withPackageAlias(String packageAlias) { /** * Get the imagePath property: VHD/CIM image path on Network Share. - * + * * @return the imagePath value. */ public String imagePath() { @@ -68,7 +134,7 @@ public String imagePath() { /** * Set the imagePath property: VHD/CIM image path on Network Share. - * + * * @param imagePath the imagePath value to set. * @return the ExpandMsixImageInner object itself. */ @@ -82,7 +148,7 @@ public ExpandMsixImageInner withImagePath(String imagePath) { /** * Get the packageName property: Package Name from appxmanifest.xml. - * + * * @return the packageName value. */ public String packageName() { @@ -91,7 +157,7 @@ public String packageName() { /** * Set the packageName property: Package Name from appxmanifest.xml. - * + * * @param packageName the packageName value to set. * @return the ExpandMsixImageInner object itself. */ @@ -106,7 +172,7 @@ public ExpandMsixImageInner withPackageName(String packageName) { /** * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @return the packageFamilyName value. */ public String packageFamilyName() { @@ -116,7 +182,7 @@ public String packageFamilyName() { /** * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @param packageFamilyName the packageFamilyName value to set. * @return the ExpandMsixImageInner object itself. */ @@ -130,7 +196,7 @@ public ExpandMsixImageInner withPackageFamilyName(String packageFamilyName) { /** * Get the packageFullName property: Package Full Name from appxmanifest.xml. - * + * * @return the packageFullName value. */ public String packageFullName() { @@ -139,7 +205,7 @@ public String packageFullName() { /** * Set the packageFullName property: Package Full Name from appxmanifest.xml. - * + * * @param packageFullName the packageFullName value to set. * @return the ExpandMsixImageInner object itself. */ @@ -153,7 +219,7 @@ public ExpandMsixImageInner withPackageFullName(String packageFullName) { /** * Get the displayName property: User friendly Name to be displayed in the portal. - * + * * @return the displayName value. */ public String displayName() { @@ -162,7 +228,7 @@ public String displayName() { /** * Set the displayName property: User friendly Name to be displayed in the portal. - * + * * @param displayName the displayName value to set. * @return the ExpandMsixImageInner object itself. */ @@ -176,7 +242,7 @@ public ExpandMsixImageInner withDisplayName(String displayName) { /** * Get the packageRelativePath property: Relative Path to the package inside the image. - * + * * @return the packageRelativePath value. */ public String packageRelativePath() { @@ -185,7 +251,7 @@ public String packageRelativePath() { /** * Set the packageRelativePath property: Relative Path to the package inside the image. - * + * * @param packageRelativePath the packageRelativePath value to set. * @return the ExpandMsixImageInner object itself. */ @@ -199,7 +265,7 @@ public ExpandMsixImageInner withPackageRelativePath(String packageRelativePath) /** * Get the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @return the isRegularRegistration value. */ public Boolean isRegularRegistration() { @@ -208,7 +274,7 @@ public Boolean isRegularRegistration() { /** * Set the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @param isRegularRegistration the isRegularRegistration value to set. * @return the ExpandMsixImageInner object itself. */ @@ -222,7 +288,7 @@ public ExpandMsixImageInner withIsRegularRegistration(Boolean isRegularRegistrat /** * Get the isActive property: Make this version of the package the active one across the hostpool. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -231,7 +297,7 @@ public Boolean isActive() { /** * Set the isActive property: Make this version of the package the active one across the hostpool. - * + * * @param isActive the isActive value to set. * @return the ExpandMsixImageInner object itself. */ @@ -245,7 +311,7 @@ public ExpandMsixImageInner withIsActive(Boolean isActive) { /** * Get the packageDependencies property: List of package dependencies. - * + * * @return the packageDependencies value. */ public List packageDependencies() { @@ -254,7 +320,7 @@ public List packageDependencies() { /** * Set the packageDependencies property: List of package dependencies. - * + * * @param packageDependencies the packageDependencies value to set. * @return the ExpandMsixImageInner object itself. */ @@ -267,8 +333,8 @@ public ExpandMsixImageInner withPackageDependencies(List packageApplications() { @@ -323,7 +389,7 @@ public List packageApplications() { /** * Set the packageApplications property: List of package applications. - * + * * @param packageApplications the packageApplications value to set. * @return the ExpandMsixImageInner object itself. */ @@ -335,9 +401,55 @@ public ExpandMsixImageInner withPackageApplications(List { + ExpandMsixImageInner deserializedExpandMsixImageInner = new ExpandMsixImageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpandMsixImageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedExpandMsixImageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpandMsixImageInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedExpandMsixImageInner.innerProperties = ExpandMsixImageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedExpandMsixImageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpandMsixImageInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java index cb3cd7bf906e..c9304c1e42e8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ExpandMsixImageProperties.java @@ -5,100 +5,107 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** Schema for Expand MSIX Image properties. */ +/** + * Schema for Expand MSIX Image properties. + */ @Fluent -public final class ExpandMsixImageProperties { +public final class ExpandMsixImageProperties implements JsonSerializable { /* * Alias of MSIX Package. */ - @JsonProperty(value = "packageAlias") private String packageAlias; /* * VHD/CIM image path on Network Share. */ - @JsonProperty(value = "imagePath") private String imagePath; /* * Package Name from appxmanifest.xml. */ - @JsonProperty(value = "packageName") private String packageName; /* * Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. */ - @JsonProperty(value = "packageFamilyName") private String packageFamilyName; /* * Package Full Name from appxmanifest.xml. */ - @JsonProperty(value = "packageFullName") private String packageFullName; /* * User friendly Name to be displayed in the portal. */ - @JsonProperty(value = "displayName") private String displayName; /* * Relative Path to the package inside the image. */ - @JsonProperty(value = "packageRelativePath") private String packageRelativePath; /* * Specifies how to register Package in feed. */ - @JsonProperty(value = "isRegularRegistration") private Boolean isRegularRegistration; /* * Make this version of the package the active one across the hostpool. */ - @JsonProperty(value = "isActive") private Boolean isActive; /* * List of package dependencies. */ - @JsonProperty(value = "packageDependencies") private List packageDependencies; /* - * Package Version found in the appxmanifest.xml. + * Package version found in the appxmanifest.xml. */ - @JsonProperty(value = "version") private String version; /* * Date Package was last updated, found in the appxmanifest.xml. */ - @JsonProperty(value = "lastUpdated") private OffsetDateTime lastUpdated; /* * List of package applications. */ - @JsonProperty(value = "packageApplications") private List packageApplications; - /** Creates an instance of ExpandMsixImageProperties class. */ + /* + * Certificate name found in the appxmanifest.xml. + */ + private String certificateName; + + /* + * Date certificate expires, found in the appxmanifest.xml. + */ + private OffsetDateTime certificateExpiry; + + /** + * Creates an instance of ExpandMsixImageProperties class. + */ public ExpandMsixImageProperties() { } /** * Get the packageAlias property: Alias of MSIX Package. - * + * * @return the packageAlias value. */ public String packageAlias() { @@ -107,7 +114,7 @@ public String packageAlias() { /** * Set the packageAlias property: Alias of MSIX Package. - * + * * @param packageAlias the packageAlias value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -118,7 +125,7 @@ public ExpandMsixImageProperties withPackageAlias(String packageAlias) { /** * Get the imagePath property: VHD/CIM image path on Network Share. - * + * * @return the imagePath value. */ public String imagePath() { @@ -127,7 +134,7 @@ public String imagePath() { /** * Set the imagePath property: VHD/CIM image path on Network Share. - * + * * @param imagePath the imagePath value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -138,7 +145,7 @@ public ExpandMsixImageProperties withImagePath(String imagePath) { /** * Get the packageName property: Package Name from appxmanifest.xml. - * + * * @return the packageName value. */ public String packageName() { @@ -147,7 +154,7 @@ public String packageName() { /** * Set the packageName property: Package Name from appxmanifest.xml. - * + * * @param packageName the packageName value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -159,7 +166,7 @@ public ExpandMsixImageProperties withPackageName(String packageName) { /** * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @return the packageFamilyName value. */ public String packageFamilyName() { @@ -169,7 +176,7 @@ public String packageFamilyName() { /** * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @param packageFamilyName the packageFamilyName value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -180,7 +187,7 @@ public ExpandMsixImageProperties withPackageFamilyName(String packageFamilyName) /** * Get the packageFullName property: Package Full Name from appxmanifest.xml. - * + * * @return the packageFullName value. */ public String packageFullName() { @@ -189,7 +196,7 @@ public String packageFullName() { /** * Set the packageFullName property: Package Full Name from appxmanifest.xml. - * + * * @param packageFullName the packageFullName value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -200,7 +207,7 @@ public ExpandMsixImageProperties withPackageFullName(String packageFullName) { /** * Get the displayName property: User friendly Name to be displayed in the portal. - * + * * @return the displayName value. */ public String displayName() { @@ -209,7 +216,7 @@ public String displayName() { /** * Set the displayName property: User friendly Name to be displayed in the portal. - * + * * @param displayName the displayName value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -220,7 +227,7 @@ public ExpandMsixImageProperties withDisplayName(String displayName) { /** * Get the packageRelativePath property: Relative Path to the package inside the image. - * + * * @return the packageRelativePath value. */ public String packageRelativePath() { @@ -229,7 +236,7 @@ public String packageRelativePath() { /** * Set the packageRelativePath property: Relative Path to the package inside the image. - * + * * @param packageRelativePath the packageRelativePath value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -240,7 +247,7 @@ public ExpandMsixImageProperties withPackageRelativePath(String packageRelativeP /** * Get the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @return the isRegularRegistration value. */ public Boolean isRegularRegistration() { @@ -249,7 +256,7 @@ public Boolean isRegularRegistration() { /** * Set the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @param isRegularRegistration the isRegularRegistration value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -260,7 +267,7 @@ public ExpandMsixImageProperties withIsRegularRegistration(Boolean isRegularRegi /** * Get the isActive property: Make this version of the package the active one across the hostpool. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -269,7 +276,7 @@ public Boolean isActive() { /** * Set the isActive property: Make this version of the package the active one across the hostpool. - * + * * @param isActive the isActive value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -280,7 +287,7 @@ public ExpandMsixImageProperties withIsActive(Boolean isActive) { /** * Get the packageDependencies property: List of package dependencies. - * + * * @return the packageDependencies value. */ public List packageDependencies() { @@ -289,7 +296,7 @@ public List packageDependencies() { /** * Set the packageDependencies property: List of package dependencies. - * + * * @param packageDependencies the packageDependencies value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -299,8 +306,8 @@ public ExpandMsixImageProperties withPackageDependencies(List packageApplications() { @@ -349,7 +356,7 @@ public List packageApplications() { /** * Set the packageApplications property: List of package applications. - * + * * @param packageApplications the packageApplications value to set. * @return the ExpandMsixImageProperties object itself. */ @@ -358,9 +365,49 @@ public ExpandMsixImageProperties withPackageApplications(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("packageAlias", this.packageAlias); + jsonWriter.writeStringField("imagePath", this.imagePath); + jsonWriter.writeStringField("packageName", this.packageName); + jsonWriter.writeStringField("packageFamilyName", this.packageFamilyName); + jsonWriter.writeStringField("packageFullName", this.packageFullName); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("packageRelativePath", this.packageRelativePath); + jsonWriter.writeBooleanField("isRegularRegistration", this.isRegularRegistration); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeArrayField("packageDependencies", this.packageDependencies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("lastUpdated", + this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated)); + jsonWriter.writeArrayField("packageApplications", this.packageApplications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("certificateName", this.certificateName); + jsonWriter.writeStringField("certificateExpiry", + this.certificateExpiry == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.certificateExpiry)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpandMsixImageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpandMsixImageProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpandMsixImageProperties. + */ + public static ExpandMsixImageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpandMsixImageProperties deserializedExpandMsixImageProperties = new ExpandMsixImageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("packageAlias".equals(fieldName)) { + deserializedExpandMsixImageProperties.packageAlias = reader.getString(); + } else if ("imagePath".equals(fieldName)) { + deserializedExpandMsixImageProperties.imagePath = reader.getString(); + } else if ("packageName".equals(fieldName)) { + deserializedExpandMsixImageProperties.packageName = reader.getString(); + } else if ("packageFamilyName".equals(fieldName)) { + deserializedExpandMsixImageProperties.packageFamilyName = reader.getString(); + } else if ("packageFullName".equals(fieldName)) { + deserializedExpandMsixImageProperties.packageFullName = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedExpandMsixImageProperties.displayName = reader.getString(); + } else if ("packageRelativePath".equals(fieldName)) { + deserializedExpandMsixImageProperties.packageRelativePath = reader.getString(); + } else if ("isRegularRegistration".equals(fieldName)) { + deserializedExpandMsixImageProperties.isRegularRegistration + = reader.getNullable(JsonReader::getBoolean); + } else if ("isActive".equals(fieldName)) { + deserializedExpandMsixImageProperties.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("packageDependencies".equals(fieldName)) { + List packageDependencies + = reader.readArray(reader1 -> MsixPackageDependencies.fromJson(reader1)); + deserializedExpandMsixImageProperties.packageDependencies = packageDependencies; + } else if ("version".equals(fieldName)) { + deserializedExpandMsixImageProperties.version = reader.getString(); + } else if ("lastUpdated".equals(fieldName)) { + deserializedExpandMsixImageProperties.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("packageApplications".equals(fieldName)) { + List packageApplications + = reader.readArray(reader1 -> MsixPackageApplications.fromJson(reader1)); + deserializedExpandMsixImageProperties.packageApplications = packageApplications; + } else if ("certificateName".equals(fieldName)) { + deserializedExpandMsixImageProperties.certificateName = reader.getString(); + } else if ("certificateExpiry".equals(fieldName)) { + deserializedExpandMsixImageProperties.certificateExpiry = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedExpandMsixImageProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java index ba3ef226255a..9c4860fd3e2e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolInner.java @@ -7,9 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; @@ -19,90 +22,173 @@ import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Represents a HostPool definition. */ +/** + * Represents a HostPool definition. + */ @Fluent public final class HostPoolInner extends ResourceModelWithAllowedPropertySet { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for HostPool + */ + private HostPoolPropertiesInner innerProperties = new HostPoolPropertiesInner(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for HostPool + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header + * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested + * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. */ - @JsonProperty(value = "properties", required = true) - private HostPoolPropertiesInner innerProperties = new HostPoolPropertiesInner(); + private String etag; - /** Creates an instance of HostPoolInner class. */ + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HostPoolInner class. + */ public HostPoolInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for HostPool. + * + * @return the innerProperties value. + */ + private HostPoolPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ + @Override public SystemData systemData() { return this.systemData; } /** - * Get the innerProperties property: Detailed properties for HostPool. - * - * @return the innerProperties value. + * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be + * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from + * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), + * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value. */ - private HostPoolPropertiesInner innerProperties() { - return this.innerProperties; + @Override + public String etag() { + return this.etag; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public HostPoolInner withManagedBy(String managedBy) { super.withManagedBy(managedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HostPoolInner withKind(String kind) { super.withKind(kind); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HostPoolInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HostPoolInner withSku(ResourceModelWithAllowedPropertySetSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HostPoolInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { super.withPlan(plan); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HostPoolInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public HostPoolInner withTags(Map tags) { super.withTags(tags); @@ -111,7 +197,7 @@ public HostPoolInner withTags(Map tags) { /** * Get the objectId property: ObjectId of HostPool. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -120,7 +206,7 @@ public String objectId() { /** * Get the friendlyName property: Friendly name of HostPool. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -129,7 +215,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of HostPool. - * + * * @param friendlyName the friendlyName value to set. * @return the HostPoolInner object itself. */ @@ -143,7 +229,7 @@ public HostPoolInner withFriendlyName(String friendlyName) { /** * Get the description property: Description of HostPool. - * + * * @return the description value. */ public String description() { @@ -152,7 +238,7 @@ public String description() { /** * Set the description property: Description of HostPool. - * + * * @param description the description value to set. * @return the HostPoolInner object itself. */ @@ -166,7 +252,7 @@ public HostPoolInner withDescription(String description) { /** * Get the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ public HostPoolType hostPoolType() { @@ -175,7 +261,7 @@ public HostPoolType hostPoolType() { /** * Set the hostPoolType property: HostPool type for desktop. - * + * * @param hostPoolType the hostPoolType value to set. * @return the HostPoolInner object itself. */ @@ -189,7 +275,7 @@ public HostPoolInner withHostPoolType(HostPoolType hostPoolType) { /** * Get the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @return the personalDesktopAssignmentType value. */ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { @@ -198,12 +284,12 @@ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { /** * Set the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set. * @return the HostPoolInner object itself. */ - public HostPoolInner withPersonalDesktopAssignmentType( - PersonalDesktopAssignmentType personalDesktopAssignmentType) { + public HostPoolInner + withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { if (this.innerProperties() == null) { this.innerProperties = new HostPoolPropertiesInner(); } @@ -213,7 +299,7 @@ public HostPoolInner withPersonalDesktopAssignmentType( /** * Get the customRdpProperty property: Custom rdp property of HostPool. - * + * * @return the customRdpProperty value. */ public String customRdpProperty() { @@ -222,7 +308,7 @@ public String customRdpProperty() { /** * Set the customRdpProperty property: Custom rdp property of HostPool. - * + * * @param customRdpProperty the customRdpProperty value to set. * @return the HostPoolInner object itself. */ @@ -236,7 +322,7 @@ public HostPoolInner withCustomRdpProperty(String customRdpProperty) { /** * Get the maxSessionLimit property: The max session limit of HostPool. - * + * * @return the maxSessionLimit value. */ public Integer maxSessionLimit() { @@ -245,7 +331,7 @@ public Integer maxSessionLimit() { /** * Set the maxSessionLimit property: The max session limit of HostPool. - * + * * @param maxSessionLimit the maxSessionLimit value to set. * @return the HostPoolInner object itself. */ @@ -259,7 +345,7 @@ public HostPoolInner withMaxSessionLimit(Integer maxSessionLimit) { /** * Get the loadBalancerType property: The type of the load balancer. - * + * * @return the loadBalancerType value. */ public LoadBalancerType loadBalancerType() { @@ -268,7 +354,7 @@ public LoadBalancerType loadBalancerType() { /** * Set the loadBalancerType property: The type of the load balancer. - * + * * @param loadBalancerType the loadBalancerType value to set. * @return the HostPoolInner object itself. */ @@ -282,7 +368,7 @@ public HostPoolInner withLoadBalancerType(LoadBalancerType loadBalancerType) { /** * Get the ring property: The ring number of HostPool. - * + * * @return the ring value. */ public Integer ring() { @@ -291,7 +377,7 @@ public Integer ring() { /** * Set the ring property: The ring number of HostPool. - * + * * @param ring the ring value to set. * @return the HostPoolInner object itself. */ @@ -305,7 +391,7 @@ public HostPoolInner withRing(Integer ring) { /** * Get the validationEnvironment property: Is validation environment. - * + * * @return the validationEnvironment value. */ public Boolean validationEnvironment() { @@ -314,7 +400,7 @@ public Boolean validationEnvironment() { /** * Set the validationEnvironment property: Is validation environment. - * + * * @param validationEnvironment the validationEnvironment value to set. * @return the HostPoolInner object itself. */ @@ -328,7 +414,7 @@ public HostPoolInner withValidationEnvironment(Boolean validationEnvironment) { /** * Get the registrationInfo property: The registration info of HostPool. - * + * * @return the registrationInfo value. */ public RegistrationInfoInner registrationInfo() { @@ -337,7 +423,7 @@ public RegistrationInfoInner registrationInfo() { /** * Set the registrationInfo property: The registration info of HostPool. - * + * * @param registrationInfo the registrationInfo value to set. * @return the HostPoolInner object itself. */ @@ -351,7 +437,7 @@ public HostPoolInner withRegistrationInfo(RegistrationInfoInner registrationInfo /** * Get the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @return the vmTemplate value. */ public String vmTemplate() { @@ -360,7 +446,7 @@ public String vmTemplate() { /** * Set the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @param vmTemplate the vmTemplate value to set. * @return the HostPoolInner object itself. */ @@ -374,16 +460,25 @@ public HostPoolInner withVmTemplate(String vmTemplate) { /** * Get the applicationGroupReferences property: List of applicationGroup links. - * + * * @return the applicationGroupReferences value. */ public List applicationGroupReferences() { return this.innerProperties() == null ? null : this.innerProperties().applicationGroupReferences(); } + /** + * Get the appAttachPackageReferences property: List of App Attach Package links. + * + * @return the appAttachPackageReferences value. + */ + public List appAttachPackageReferences() { + return this.innerProperties() == null ? null : this.innerProperties().appAttachPackageReferences(); + } + /** * Get the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @return the ssoadfsAuthority value. */ public String ssoadfsAuthority() { @@ -392,7 +487,7 @@ public String ssoadfsAuthority() { /** * Set the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @param ssoadfsAuthority the ssoadfsAuthority value to set. * @return the HostPoolInner object itself. */ @@ -406,7 +501,7 @@ public HostPoolInner withSsoadfsAuthority(String ssoadfsAuthority) { /** * Get the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @return the ssoClientId value. */ public String ssoClientId() { @@ -415,7 +510,7 @@ public String ssoClientId() { /** * Set the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @param ssoClientId the ssoClientId value to set. * @return the HostPoolInner object itself. */ @@ -430,7 +525,7 @@ public HostPoolInner withSsoClientId(String ssoClientId) { /** * Get the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @return the ssoClientSecretKeyVaultPath value. */ public String ssoClientSecretKeyVaultPath() { @@ -440,7 +535,7 @@ public String ssoClientSecretKeyVaultPath() { /** * Set the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set. * @return the HostPoolInner object itself. */ @@ -454,7 +549,7 @@ public HostPoolInner withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVa /** * Get the ssoSecretType property: The type of single sign on Secret Type. - * + * * @return the ssoSecretType value. */ public SsoSecretType ssoSecretType() { @@ -463,7 +558,7 @@ public SsoSecretType ssoSecretType() { /** * Set the ssoSecretType property: The type of single sign on Secret Type. - * + * * @param ssoSecretType the ssoSecretType value to set. * @return the HostPoolInner object itself. */ @@ -478,7 +573,7 @@ public HostPoolInner withSsoSecretType(SsoSecretType ssoSecretType) { /** * Get the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @return the preferredAppGroupType value. */ public PreferredAppGroupType preferredAppGroupType() { @@ -488,7 +583,7 @@ public PreferredAppGroupType preferredAppGroupType() { /** * Set the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @param preferredAppGroupType the preferredAppGroupType value to set. * @return the HostPoolInner object itself. */ @@ -502,7 +597,7 @@ public HostPoolInner withPreferredAppGroupType(PreferredAppGroupType preferredAp /** * Get the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @return the startVMOnConnect value. */ public Boolean startVMOnConnect() { @@ -511,7 +606,7 @@ public Boolean startVMOnConnect() { /** * Set the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @param startVMOnConnect the startVMOnConnect value to set. * @return the HostPoolInner object itself. */ @@ -525,7 +620,7 @@ public HostPoolInner withStartVMOnConnect(Boolean startVMOnConnect) { /** * Get the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ public Boolean cloudPcResource() { @@ -535,7 +630,7 @@ public Boolean cloudPcResource() { /** * Get the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ public HostpoolPublicNetworkAccess publicNetworkAccess() { @@ -545,7 +640,7 @@ public HostpoolPublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the HostPoolInner object itself. */ @@ -560,7 +655,7 @@ public HostPoolInner withPublicNetworkAccess(HostpoolPublicNetworkAccess publicN /** * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @return the agentUpdate value. */ public AgentUpdateProperties agentUpdate() { @@ -570,7 +665,7 @@ public AgentUpdateProperties agentUpdate() { /** * Set the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @param agentUpdate the agentUpdate value to set. * @return the HostPoolInner object itself. */ @@ -585,7 +680,7 @@ public HostPoolInner withAgentUpdate(AgentUpdateProperties agentUpdate) { /** * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -594,20 +689,97 @@ public List privateEndpointConnections() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model HostPoolInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model HostPoolInner")); } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(HostPoolInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedBy", managedBy()); + jsonWriter.writeStringField("kind", kind()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("sku", sku()); + jsonWriter.writeJsonField("plan", plan()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostPoolInner. + */ + public static HostPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolInner deserializedHostPoolInner = new HostPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHostPoolInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHostPoolInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHostPoolInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedHostPoolInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHostPoolInner.withTags(tags); + } else if ("managedBy".equals(fieldName)) { + deserializedHostPoolInner.withManagedBy(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedHostPoolInner.withKind(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedHostPoolInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedHostPoolInner + .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + } else if ("sku".equals(fieldName)) { + deserializedHostPoolInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("plan".equals(fieldName)) { + deserializedHostPoolInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedHostPoolInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedHostPoolInner.innerProperties = HostPoolPropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java index 69441f3879f7..170daf5df4b8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPatchProperties.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdatePatchProperties; import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; @@ -12,126 +16,112 @@ import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of HostPool. */ +/** + * Properties of HostPool. + */ @Fluent -public final class HostPoolPatchProperties { +public final class HostPoolPatchProperties implements JsonSerializable { /* * Friendly name of HostPool. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Description of HostPool. */ - @JsonProperty(value = "description") private String description; /* * Custom rdp property of HostPool. */ - @JsonProperty(value = "customRdpProperty") private String customRdpProperty; /* * The max session limit of HostPool. */ - @JsonProperty(value = "maxSessionLimit") private Integer maxSessionLimit; /* * PersonalDesktopAssignment type for HostPool. */ - @JsonProperty(value = "personalDesktopAssignmentType") private PersonalDesktopAssignmentType personalDesktopAssignmentType; /* * The type of the load balancer. */ - @JsonProperty(value = "loadBalancerType") private LoadBalancerType loadBalancerType; /* * The ring number of HostPool. */ - @JsonProperty(value = "ring") private Integer ring; /* * Is validation environment. */ - @JsonProperty(value = "validationEnvironment") private Boolean validationEnvironment; /* * The registration info of HostPool. */ - @JsonProperty(value = "registrationInfo") private RegistrationInfoPatch registrationInfo; /* * VM template for sessionhosts configuration within hostpool. */ - @JsonProperty(value = "vmTemplate") private String vmTemplate; /* * URL to customer ADFS server for signing WVD SSO certificates. */ - @JsonProperty(value = "ssoadfsAuthority") private String ssoadfsAuthority; /* * ClientId for the registered Relying Party used to issue WVD SSO certificates. */ - @JsonProperty(value = "ssoClientId") private String ssoClientId; /* * Path to Azure KeyVault storing the secret used for communication to ADFS. */ - @JsonProperty(value = "ssoClientSecretKeyVaultPath") private String ssoClientSecretKeyVaultPath; /* * The type of single sign on Secret Type. */ - @JsonProperty(value = "ssoSecretType") private SsoSecretType ssoSecretType; /* * The type of preferred application group type, default to Desktop Application Group */ - @JsonProperty(value = "preferredAppGroupType") private PreferredAppGroupType preferredAppGroupType; /* * The flag to turn on/off StartVMOnConnect feature. */ - @JsonProperty(value = "startVMOnConnect") private Boolean startVMOnConnect; /* * Enabled to allow this resource to be access from the public network */ - @JsonProperty(value = "publicNetworkAccess") private HostpoolPublicNetworkAccess publicNetworkAccess; /* * The session host configuration for updating agent, monitoring agent, and stack component. */ - @JsonProperty(value = "agentUpdate") private AgentUpdatePatchProperties agentUpdate; - /** Creates an instance of HostPoolPatchProperties class. */ + /** + * Creates an instance of HostPoolPatchProperties class. + */ public HostPoolPatchProperties() { } /** * Get the friendlyName property: Friendly name of HostPool. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -140,7 +130,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of HostPool. - * + * * @param friendlyName the friendlyName value to set. * @return the HostPoolPatchProperties object itself. */ @@ -151,7 +141,7 @@ public HostPoolPatchProperties withFriendlyName(String friendlyName) { /** * Get the description property: Description of HostPool. - * + * * @return the description value. */ public String description() { @@ -160,7 +150,7 @@ public String description() { /** * Set the description property: Description of HostPool. - * + * * @param description the description value to set. * @return the HostPoolPatchProperties object itself. */ @@ -171,7 +161,7 @@ public HostPoolPatchProperties withDescription(String description) { /** * Get the customRdpProperty property: Custom rdp property of HostPool. - * + * * @return the customRdpProperty value. */ public String customRdpProperty() { @@ -180,7 +170,7 @@ public String customRdpProperty() { /** * Set the customRdpProperty property: Custom rdp property of HostPool. - * + * * @param customRdpProperty the customRdpProperty value to set. * @return the HostPoolPatchProperties object itself. */ @@ -191,7 +181,7 @@ public HostPoolPatchProperties withCustomRdpProperty(String customRdpProperty) { /** * Get the maxSessionLimit property: The max session limit of HostPool. - * + * * @return the maxSessionLimit value. */ public Integer maxSessionLimit() { @@ -200,7 +190,7 @@ public Integer maxSessionLimit() { /** * Set the maxSessionLimit property: The max session limit of HostPool. - * + * * @param maxSessionLimit the maxSessionLimit value to set. * @return the HostPoolPatchProperties object itself. */ @@ -211,7 +201,7 @@ public HostPoolPatchProperties withMaxSessionLimit(Integer maxSessionLimit) { /** * Get the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @return the personalDesktopAssignmentType value. */ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { @@ -220,19 +210,19 @@ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { /** * Set the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set. * @return the HostPoolPatchProperties object itself. */ - public HostPoolPatchProperties withPersonalDesktopAssignmentType( - PersonalDesktopAssignmentType personalDesktopAssignmentType) { + public HostPoolPatchProperties + withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { this.personalDesktopAssignmentType = personalDesktopAssignmentType; return this; } /** * Get the loadBalancerType property: The type of the load balancer. - * + * * @return the loadBalancerType value. */ public LoadBalancerType loadBalancerType() { @@ -241,7 +231,7 @@ public LoadBalancerType loadBalancerType() { /** * Set the loadBalancerType property: The type of the load balancer. - * + * * @param loadBalancerType the loadBalancerType value to set. * @return the HostPoolPatchProperties object itself. */ @@ -252,7 +242,7 @@ public HostPoolPatchProperties withLoadBalancerType(LoadBalancerType loadBalance /** * Get the ring property: The ring number of HostPool. - * + * * @return the ring value. */ public Integer ring() { @@ -261,7 +251,7 @@ public Integer ring() { /** * Set the ring property: The ring number of HostPool. - * + * * @param ring the ring value to set. * @return the HostPoolPatchProperties object itself. */ @@ -272,7 +262,7 @@ public HostPoolPatchProperties withRing(Integer ring) { /** * Get the validationEnvironment property: Is validation environment. - * + * * @return the validationEnvironment value. */ public Boolean validationEnvironment() { @@ -281,7 +271,7 @@ public Boolean validationEnvironment() { /** * Set the validationEnvironment property: Is validation environment. - * + * * @param validationEnvironment the validationEnvironment value to set. * @return the HostPoolPatchProperties object itself. */ @@ -292,7 +282,7 @@ public HostPoolPatchProperties withValidationEnvironment(Boolean validationEnvir /** * Get the registrationInfo property: The registration info of HostPool. - * + * * @return the registrationInfo value. */ public RegistrationInfoPatch registrationInfo() { @@ -301,7 +291,7 @@ public RegistrationInfoPatch registrationInfo() { /** * Set the registrationInfo property: The registration info of HostPool. - * + * * @param registrationInfo the registrationInfo value to set. * @return the HostPoolPatchProperties object itself. */ @@ -312,7 +302,7 @@ public HostPoolPatchProperties withRegistrationInfo(RegistrationInfoPatch regist /** * Get the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @return the vmTemplate value. */ public String vmTemplate() { @@ -321,7 +311,7 @@ public String vmTemplate() { /** * Set the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @param vmTemplate the vmTemplate value to set. * @return the HostPoolPatchProperties object itself. */ @@ -332,7 +322,7 @@ public HostPoolPatchProperties withVmTemplate(String vmTemplate) { /** * Get the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @return the ssoadfsAuthority value. */ public String ssoadfsAuthority() { @@ -341,7 +331,7 @@ public String ssoadfsAuthority() { /** * Set the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @param ssoadfsAuthority the ssoadfsAuthority value to set. * @return the HostPoolPatchProperties object itself. */ @@ -352,7 +342,7 @@ public HostPoolPatchProperties withSsoadfsAuthority(String ssoadfsAuthority) { /** * Get the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @return the ssoClientId value. */ public String ssoClientId() { @@ -361,7 +351,7 @@ public String ssoClientId() { /** * Set the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @param ssoClientId the ssoClientId value to set. * @return the HostPoolPatchProperties object itself. */ @@ -373,7 +363,7 @@ public HostPoolPatchProperties withSsoClientId(String ssoClientId) { /** * Get the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @return the ssoClientSecretKeyVaultPath value. */ public String ssoClientSecretKeyVaultPath() { @@ -383,7 +373,7 @@ public String ssoClientSecretKeyVaultPath() { /** * Set the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set. * @return the HostPoolPatchProperties object itself. */ @@ -394,7 +384,7 @@ public HostPoolPatchProperties withSsoClientSecretKeyVaultPath(String ssoClientS /** * Get the ssoSecretType property: The type of single sign on Secret Type. - * + * * @return the ssoSecretType value. */ public SsoSecretType ssoSecretType() { @@ -403,7 +393,7 @@ public SsoSecretType ssoSecretType() { /** * Set the ssoSecretType property: The type of single sign on Secret Type. - * + * * @param ssoSecretType the ssoSecretType value to set. * @return the HostPoolPatchProperties object itself. */ @@ -415,7 +405,7 @@ public HostPoolPatchProperties withSsoSecretType(SsoSecretType ssoSecretType) { /** * Get the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @return the preferredAppGroupType value. */ public PreferredAppGroupType preferredAppGroupType() { @@ -425,7 +415,7 @@ public PreferredAppGroupType preferredAppGroupType() { /** * Set the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @param preferredAppGroupType the preferredAppGroupType value to set. * @return the HostPoolPatchProperties object itself. */ @@ -436,7 +426,7 @@ public HostPoolPatchProperties withPreferredAppGroupType(PreferredAppGroupType p /** * Get the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @return the startVMOnConnect value. */ public Boolean startVMOnConnect() { @@ -445,7 +435,7 @@ public Boolean startVMOnConnect() { /** * Set the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @param startVMOnConnect the startVMOnConnect value to set. * @return the HostPoolPatchProperties object itself. */ @@ -456,7 +446,7 @@ public HostPoolPatchProperties withStartVMOnConnect(Boolean startVMOnConnect) { /** * Get the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @return the publicNetworkAccess value. */ public HostpoolPublicNetworkAccess publicNetworkAccess() { @@ -465,7 +455,7 @@ public HostpoolPublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the HostPoolPatchProperties object itself. */ @@ -477,7 +467,7 @@ public HostPoolPatchProperties withPublicNetworkAccess(HostpoolPublicNetworkAcce /** * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @return the agentUpdate value. */ public AgentUpdatePatchProperties agentUpdate() { @@ -487,7 +477,7 @@ public AgentUpdatePatchProperties agentUpdate() { /** * Set the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @param agentUpdate the agentUpdate value to set. * @return the HostPoolPatchProperties object itself. */ @@ -498,7 +488,7 @@ public HostPoolPatchProperties withAgentUpdate(AgentUpdatePatchProperties agentU /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -509,4 +499,100 @@ public void validate() { agentUpdate().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("customRdpProperty", this.customRdpProperty); + jsonWriter.writeNumberField("maxSessionLimit", this.maxSessionLimit); + jsonWriter.writeStringField("personalDesktopAssignmentType", + this.personalDesktopAssignmentType == null ? null : this.personalDesktopAssignmentType.toString()); + jsonWriter.writeStringField("loadBalancerType", + this.loadBalancerType == null ? null : this.loadBalancerType.toString()); + jsonWriter.writeNumberField("ring", this.ring); + jsonWriter.writeBooleanField("validationEnvironment", this.validationEnvironment); + jsonWriter.writeJsonField("registrationInfo", this.registrationInfo); + jsonWriter.writeStringField("vmTemplate", this.vmTemplate); + jsonWriter.writeStringField("ssoadfsAuthority", this.ssoadfsAuthority); + jsonWriter.writeStringField("ssoClientId", this.ssoClientId); + jsonWriter.writeStringField("ssoClientSecretKeyVaultPath", this.ssoClientSecretKeyVaultPath); + jsonWriter.writeStringField("ssoSecretType", this.ssoSecretType == null ? null : this.ssoSecretType.toString()); + jsonWriter.writeStringField("preferredAppGroupType", + this.preferredAppGroupType == null ? null : this.preferredAppGroupType.toString()); + jsonWriter.writeBooleanField("startVMOnConnect", this.startVMOnConnect); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("agentUpdate", this.agentUpdate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolPatchProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HostPoolPatchProperties. + */ + public static HostPoolPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolPatchProperties deserializedHostPoolPatchProperties = new HostPoolPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("friendlyName".equals(fieldName)) { + deserializedHostPoolPatchProperties.friendlyName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedHostPoolPatchProperties.description = reader.getString(); + } else if ("customRdpProperty".equals(fieldName)) { + deserializedHostPoolPatchProperties.customRdpProperty = reader.getString(); + } else if ("maxSessionLimit".equals(fieldName)) { + deserializedHostPoolPatchProperties.maxSessionLimit = reader.getNullable(JsonReader::getInt); + } else if ("personalDesktopAssignmentType".equals(fieldName)) { + deserializedHostPoolPatchProperties.personalDesktopAssignmentType + = PersonalDesktopAssignmentType.fromString(reader.getString()); + } else if ("loadBalancerType".equals(fieldName)) { + deserializedHostPoolPatchProperties.loadBalancerType + = LoadBalancerType.fromString(reader.getString()); + } else if ("ring".equals(fieldName)) { + deserializedHostPoolPatchProperties.ring = reader.getNullable(JsonReader::getInt); + } else if ("validationEnvironment".equals(fieldName)) { + deserializedHostPoolPatchProperties.validationEnvironment + = reader.getNullable(JsonReader::getBoolean); + } else if ("registrationInfo".equals(fieldName)) { + deserializedHostPoolPatchProperties.registrationInfo = RegistrationInfoPatch.fromJson(reader); + } else if ("vmTemplate".equals(fieldName)) { + deserializedHostPoolPatchProperties.vmTemplate = reader.getString(); + } else if ("ssoadfsAuthority".equals(fieldName)) { + deserializedHostPoolPatchProperties.ssoadfsAuthority = reader.getString(); + } else if ("ssoClientId".equals(fieldName)) { + deserializedHostPoolPatchProperties.ssoClientId = reader.getString(); + } else if ("ssoClientSecretKeyVaultPath".equals(fieldName)) { + deserializedHostPoolPatchProperties.ssoClientSecretKeyVaultPath = reader.getString(); + } else if ("ssoSecretType".equals(fieldName)) { + deserializedHostPoolPatchProperties.ssoSecretType = SsoSecretType.fromString(reader.getString()); + } else if ("preferredAppGroupType".equals(fieldName)) { + deserializedHostPoolPatchProperties.preferredAppGroupType + = PreferredAppGroupType.fromString(reader.getString()); + } else if ("startVMOnConnect".equals(fieldName)) { + deserializedHostPoolPatchProperties.startVMOnConnect = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedHostPoolPatchProperties.publicNetworkAccess + = HostpoolPublicNetworkAccess.fromString(reader.getString()); + } else if ("agentUpdate".equals(fieldName)) { + deserializedHostPoolPatchProperties.agentUpdate = AgentUpdatePatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java index 1c5a76f63204..da47368dadee 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/HostPoolPropertiesInner.java @@ -6,166 +6,156 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.SsoSecretType; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Properties of HostPool. */ +/** + * Properties of HostPool. + */ @Fluent -public final class HostPoolPropertiesInner { +public final class HostPoolPropertiesInner implements JsonSerializable { /* * ObjectId of HostPool. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Friendly name of HostPool. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Description of HostPool. */ - @JsonProperty(value = "description") private String description; /* * HostPool type for desktop. */ - @JsonProperty(value = "hostPoolType", required = true) private HostPoolType hostPoolType; /* * PersonalDesktopAssignment type for HostPool. */ - @JsonProperty(value = "personalDesktopAssignmentType") private PersonalDesktopAssignmentType personalDesktopAssignmentType; /* * Custom rdp property of HostPool. */ - @JsonProperty(value = "customRdpProperty") private String customRdpProperty; /* * The max session limit of HostPool. */ - @JsonProperty(value = "maxSessionLimit") private Integer maxSessionLimit; /* * The type of the load balancer. */ - @JsonProperty(value = "loadBalancerType", required = true) private LoadBalancerType loadBalancerType; /* * The ring number of HostPool. */ - @JsonProperty(value = "ring") private Integer ring; /* * Is validation environment. */ - @JsonProperty(value = "validationEnvironment") private Boolean validationEnvironment; /* * The registration info of HostPool. */ - @JsonProperty(value = "registrationInfo") private RegistrationInfoInner registrationInfo; /* * VM template for sessionhosts configuration within hostpool. */ - @JsonProperty(value = "vmTemplate") private String vmTemplate; /* * List of applicationGroup links. */ - @JsonProperty(value = "applicationGroupReferences", access = JsonProperty.Access.WRITE_ONLY) private List applicationGroupReferences; + /* + * List of App Attach Package links. + */ + private List appAttachPackageReferences; + /* * URL to customer ADFS server for signing WVD SSO certificates. */ - @JsonProperty(value = "ssoadfsAuthority") private String ssoadfsAuthority; /* * ClientId for the registered Relying Party used to issue WVD SSO certificates. */ - @JsonProperty(value = "ssoClientId") private String ssoClientId; /* * Path to Azure KeyVault storing the secret used for communication to ADFS. */ - @JsonProperty(value = "ssoClientSecretKeyVaultPath") private String ssoClientSecretKeyVaultPath; /* * The type of single sign on Secret Type. */ - @JsonProperty(value = "ssoSecretType") private SsoSecretType ssoSecretType; /* * The type of preferred application group type, default to Desktop Application Group */ - @JsonProperty(value = "preferredAppGroupType", required = true) private PreferredAppGroupType preferredAppGroupType; /* * The flag to turn on/off StartVMOnConnect feature. */ - @JsonProperty(value = "startVMOnConnect") private Boolean startVMOnConnect; /* * Is cloud pc resource. */ - @JsonProperty(value = "cloudPcResource", access = JsonProperty.Access.WRITE_ONLY) private Boolean cloudPcResource; /* * Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource * to only be accessed via private endpoints */ - @JsonProperty(value = "publicNetworkAccess") private HostpoolPublicNetworkAccess publicNetworkAccess; /* * The session host configuration for updating agent, monitoring agent, and stack component. */ - @JsonProperty(value = "agentUpdate") private AgentUpdateProperties agentUpdate; /* * List of private endpoint connection associated with the specified resource */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; - /** Creates an instance of HostPoolPropertiesInner class. */ + /** + * Creates an instance of HostPoolPropertiesInner class. + */ public HostPoolPropertiesInner() { } /** * Get the objectId property: ObjectId of HostPool. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -174,7 +164,7 @@ public String objectId() { /** * Get the friendlyName property: Friendly name of HostPool. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -183,7 +173,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of HostPool. - * + * * @param friendlyName the friendlyName value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -194,7 +184,7 @@ public HostPoolPropertiesInner withFriendlyName(String friendlyName) { /** * Get the description property: Description of HostPool. - * + * * @return the description value. */ public String description() { @@ -203,7 +193,7 @@ public String description() { /** * Set the description property: Description of HostPool. - * + * * @param description the description value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -214,7 +204,7 @@ public HostPoolPropertiesInner withDescription(String description) { /** * Get the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ public HostPoolType hostPoolType() { @@ -223,7 +213,7 @@ public HostPoolType hostPoolType() { /** * Set the hostPoolType property: HostPool type for desktop. - * + * * @param hostPoolType the hostPoolType value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -234,7 +224,7 @@ public HostPoolPropertiesInner withHostPoolType(HostPoolType hostPoolType) { /** * Get the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @return the personalDesktopAssignmentType value. */ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { @@ -243,19 +233,19 @@ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { /** * Set the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set. * @return the HostPoolPropertiesInner object itself. */ - public HostPoolPropertiesInner withPersonalDesktopAssignmentType( - PersonalDesktopAssignmentType personalDesktopAssignmentType) { + public HostPoolPropertiesInner + withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { this.personalDesktopAssignmentType = personalDesktopAssignmentType; return this; } /** * Get the customRdpProperty property: Custom rdp property of HostPool. - * + * * @return the customRdpProperty value. */ public String customRdpProperty() { @@ -264,7 +254,7 @@ public String customRdpProperty() { /** * Set the customRdpProperty property: Custom rdp property of HostPool. - * + * * @param customRdpProperty the customRdpProperty value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -275,7 +265,7 @@ public HostPoolPropertiesInner withCustomRdpProperty(String customRdpProperty) { /** * Get the maxSessionLimit property: The max session limit of HostPool. - * + * * @return the maxSessionLimit value. */ public Integer maxSessionLimit() { @@ -284,7 +274,7 @@ public Integer maxSessionLimit() { /** * Set the maxSessionLimit property: The max session limit of HostPool. - * + * * @param maxSessionLimit the maxSessionLimit value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -295,7 +285,7 @@ public HostPoolPropertiesInner withMaxSessionLimit(Integer maxSessionLimit) { /** * Get the loadBalancerType property: The type of the load balancer. - * + * * @return the loadBalancerType value. */ public LoadBalancerType loadBalancerType() { @@ -304,7 +294,7 @@ public LoadBalancerType loadBalancerType() { /** * Set the loadBalancerType property: The type of the load balancer. - * + * * @param loadBalancerType the loadBalancerType value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -315,7 +305,7 @@ public HostPoolPropertiesInner withLoadBalancerType(LoadBalancerType loadBalance /** * Get the ring property: The ring number of HostPool. - * + * * @return the ring value. */ public Integer ring() { @@ -324,7 +314,7 @@ public Integer ring() { /** * Set the ring property: The ring number of HostPool. - * + * * @param ring the ring value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -335,7 +325,7 @@ public HostPoolPropertiesInner withRing(Integer ring) { /** * Get the validationEnvironment property: Is validation environment. - * + * * @return the validationEnvironment value. */ public Boolean validationEnvironment() { @@ -344,7 +334,7 @@ public Boolean validationEnvironment() { /** * Set the validationEnvironment property: Is validation environment. - * + * * @param validationEnvironment the validationEnvironment value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -355,7 +345,7 @@ public HostPoolPropertiesInner withValidationEnvironment(Boolean validationEnvir /** * Get the registrationInfo property: The registration info of HostPool. - * + * * @return the registrationInfo value. */ public RegistrationInfoInner registrationInfo() { @@ -364,7 +354,7 @@ public RegistrationInfoInner registrationInfo() { /** * Set the registrationInfo property: The registration info of HostPool. - * + * * @param registrationInfo the registrationInfo value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -375,7 +365,7 @@ public HostPoolPropertiesInner withRegistrationInfo(RegistrationInfoInner regist /** * Get the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @return the vmTemplate value. */ public String vmTemplate() { @@ -384,7 +374,7 @@ public String vmTemplate() { /** * Set the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @param vmTemplate the vmTemplate value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -395,16 +385,25 @@ public HostPoolPropertiesInner withVmTemplate(String vmTemplate) { /** * Get the applicationGroupReferences property: List of applicationGroup links. - * + * * @return the applicationGroupReferences value. */ public List applicationGroupReferences() { return this.applicationGroupReferences; } + /** + * Get the appAttachPackageReferences property: List of App Attach Package links. + * + * @return the appAttachPackageReferences value. + */ + public List appAttachPackageReferences() { + return this.appAttachPackageReferences; + } + /** * Get the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @return the ssoadfsAuthority value. */ public String ssoadfsAuthority() { @@ -413,7 +412,7 @@ public String ssoadfsAuthority() { /** * Set the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @param ssoadfsAuthority the ssoadfsAuthority value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -424,7 +423,7 @@ public HostPoolPropertiesInner withSsoadfsAuthority(String ssoadfsAuthority) { /** * Get the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @return the ssoClientId value. */ public String ssoClientId() { @@ -433,7 +432,7 @@ public String ssoClientId() { /** * Set the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @param ssoClientId the ssoClientId value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -445,7 +444,7 @@ public HostPoolPropertiesInner withSsoClientId(String ssoClientId) { /** * Get the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @return the ssoClientSecretKeyVaultPath value. */ public String ssoClientSecretKeyVaultPath() { @@ -455,7 +454,7 @@ public String ssoClientSecretKeyVaultPath() { /** * Set the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -466,7 +465,7 @@ public HostPoolPropertiesInner withSsoClientSecretKeyVaultPath(String ssoClientS /** * Get the ssoSecretType property: The type of single sign on Secret Type. - * + * * @return the ssoSecretType value. */ public SsoSecretType ssoSecretType() { @@ -475,7 +474,7 @@ public SsoSecretType ssoSecretType() { /** * Set the ssoSecretType property: The type of single sign on Secret Type. - * + * * @param ssoSecretType the ssoSecretType value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -487,7 +486,7 @@ public HostPoolPropertiesInner withSsoSecretType(SsoSecretType ssoSecretType) { /** * Get the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @return the preferredAppGroupType value. */ public PreferredAppGroupType preferredAppGroupType() { @@ -497,7 +496,7 @@ public PreferredAppGroupType preferredAppGroupType() { /** * Set the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @param preferredAppGroupType the preferredAppGroupType value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -508,7 +507,7 @@ public HostPoolPropertiesInner withPreferredAppGroupType(PreferredAppGroupType p /** * Get the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @return the startVMOnConnect value. */ public Boolean startVMOnConnect() { @@ -517,7 +516,7 @@ public Boolean startVMOnConnect() { /** * Set the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @param startVMOnConnect the startVMOnConnect value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -528,7 +527,7 @@ public HostPoolPropertiesInner withStartVMOnConnect(Boolean startVMOnConnect) { /** * Get the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ public Boolean cloudPcResource() { @@ -538,7 +537,7 @@ public Boolean cloudPcResource() { /** * Get the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ public HostpoolPublicNetworkAccess publicNetworkAccess() { @@ -548,7 +547,7 @@ public HostpoolPublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -560,7 +559,7 @@ public HostPoolPropertiesInner withPublicNetworkAccess(HostpoolPublicNetworkAcce /** * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @return the agentUpdate value. */ public AgentUpdateProperties agentUpdate() { @@ -570,7 +569,7 @@ public AgentUpdateProperties agentUpdate() { /** * Set the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @param agentUpdate the agentUpdate value to set. * @return the HostPoolPropertiesInner object itself. */ @@ -582,7 +581,7 @@ public HostPoolPropertiesInner withAgentUpdate(AgentUpdateProperties agentUpdate /** * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -591,30 +590,27 @@ public List privateEndpointConnections() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (hostPoolType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property hostPoolType in model HostPoolPropertiesInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostPoolType in model HostPoolPropertiesInner")); } if (loadBalancerType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property loadBalancerType in model HostPoolPropertiesInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property loadBalancerType in model HostPoolPropertiesInner")); } if (registrationInfo() != null) { registrationInfo().validate(); } if (preferredAppGroupType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property preferredAppGroupType in model HostPoolPropertiesInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property preferredAppGroupType in model HostPoolPropertiesInner")); } if (agentUpdate() != null) { agentUpdate().validate(); @@ -625,4 +621,118 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(HostPoolPropertiesInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostPoolType", this.hostPoolType == null ? null : this.hostPoolType.toString()); + jsonWriter.writeStringField("loadBalancerType", + this.loadBalancerType == null ? null : this.loadBalancerType.toString()); + jsonWriter.writeStringField("preferredAppGroupType", + this.preferredAppGroupType == null ? null : this.preferredAppGroupType.toString()); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("personalDesktopAssignmentType", + this.personalDesktopAssignmentType == null ? null : this.personalDesktopAssignmentType.toString()); + jsonWriter.writeStringField("customRdpProperty", this.customRdpProperty); + jsonWriter.writeNumberField("maxSessionLimit", this.maxSessionLimit); + jsonWriter.writeNumberField("ring", this.ring); + jsonWriter.writeBooleanField("validationEnvironment", this.validationEnvironment); + jsonWriter.writeJsonField("registrationInfo", this.registrationInfo); + jsonWriter.writeStringField("vmTemplate", this.vmTemplate); + jsonWriter.writeStringField("ssoadfsAuthority", this.ssoadfsAuthority); + jsonWriter.writeStringField("ssoClientId", this.ssoClientId); + jsonWriter.writeStringField("ssoClientSecretKeyVaultPath", this.ssoClientSecretKeyVaultPath); + jsonWriter.writeStringField("ssoSecretType", this.ssoSecretType == null ? null : this.ssoSecretType.toString()); + jsonWriter.writeBooleanField("startVMOnConnect", this.startVMOnConnect); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("agentUpdate", this.agentUpdate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolPropertiesInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostPoolPropertiesInner. + */ + public static HostPoolPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolPropertiesInner deserializedHostPoolPropertiesInner = new HostPoolPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostPoolType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.hostPoolType = HostPoolType.fromString(reader.getString()); + } else if ("loadBalancerType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.loadBalancerType + = LoadBalancerType.fromString(reader.getString()); + } else if ("preferredAppGroupType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.preferredAppGroupType + = PreferredAppGroupType.fromString(reader.getString()); + } else if ("objectId".equals(fieldName)) { + deserializedHostPoolPropertiesInner.objectId = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedHostPoolPropertiesInner.friendlyName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedHostPoolPropertiesInner.description = reader.getString(); + } else if ("personalDesktopAssignmentType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.personalDesktopAssignmentType + = PersonalDesktopAssignmentType.fromString(reader.getString()); + } else if ("customRdpProperty".equals(fieldName)) { + deserializedHostPoolPropertiesInner.customRdpProperty = reader.getString(); + } else if ("maxSessionLimit".equals(fieldName)) { + deserializedHostPoolPropertiesInner.maxSessionLimit = reader.getNullable(JsonReader::getInt); + } else if ("ring".equals(fieldName)) { + deserializedHostPoolPropertiesInner.ring = reader.getNullable(JsonReader::getInt); + } else if ("validationEnvironment".equals(fieldName)) { + deserializedHostPoolPropertiesInner.validationEnvironment + = reader.getNullable(JsonReader::getBoolean); + } else if ("registrationInfo".equals(fieldName)) { + deserializedHostPoolPropertiesInner.registrationInfo = RegistrationInfoInner.fromJson(reader); + } else if ("vmTemplate".equals(fieldName)) { + deserializedHostPoolPropertiesInner.vmTemplate = reader.getString(); + } else if ("applicationGroupReferences".equals(fieldName)) { + List applicationGroupReferences = reader.readArray(reader1 -> reader1.getString()); + deserializedHostPoolPropertiesInner.applicationGroupReferences = applicationGroupReferences; + } else if ("appAttachPackageReferences".equals(fieldName)) { + List appAttachPackageReferences = reader.readArray(reader1 -> reader1.getString()); + deserializedHostPoolPropertiesInner.appAttachPackageReferences = appAttachPackageReferences; + } else if ("ssoadfsAuthority".equals(fieldName)) { + deserializedHostPoolPropertiesInner.ssoadfsAuthority = reader.getString(); + } else if ("ssoClientId".equals(fieldName)) { + deserializedHostPoolPropertiesInner.ssoClientId = reader.getString(); + } else if ("ssoClientSecretKeyVaultPath".equals(fieldName)) { + deserializedHostPoolPropertiesInner.ssoClientSecretKeyVaultPath = reader.getString(); + } else if ("ssoSecretType".equals(fieldName)) { + deserializedHostPoolPropertiesInner.ssoSecretType = SsoSecretType.fromString(reader.getString()); + } else if ("startVMOnConnect".equals(fieldName)) { + deserializedHostPoolPropertiesInner.startVMOnConnect = reader.getNullable(JsonReader::getBoolean); + } else if ("cloudPcResource".equals(fieldName)) { + deserializedHostPoolPropertiesInner.cloudPcResource = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedHostPoolPropertiesInner.publicNetworkAccess + = HostpoolPublicNetworkAccess.fromString(reader.getString()); + } else if ("agentUpdate".equals(fieldName)) { + deserializedHostPoolPropertiesInner.agentUpdate = AgentUpdateProperties.fromJson(reader); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnection.fromJson(reader1)); + deserializedHostPoolPropertiesInner.privateEndpointConnections = privateEndpointConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolPropertiesInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java index 8c5bc71f9980..35af92687897 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageInner.java @@ -8,34 +8,63 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** Schema for MSIX Package properties. */ +/** + * Schema for MSIX Package properties. + */ @Fluent public final class MsixPackageInner extends ProxyResource { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for MSIX Package + */ + private MsixPackageProperties innerProperties = new MsixPackageProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for MSIX Package + * The type of the resource. */ - @JsonProperty(value = "properties", required = true) - private MsixPackageProperties innerProperties = new MsixPackageProperties(); + private String type; + + /* + * The name of the resource. + */ + private String name; - /** Creates an instance of MsixPackageInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MsixPackageInner class. + */ public MsixPackageInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for MSIX Package. + * + * @return the innerProperties value. + */ + private MsixPackageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -43,17 +72,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for MSIX Package. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private MsixPackageProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the imagePath property: VHD/CIM image path on Network Share. - * + * * @return the imagePath value. */ public String imagePath() { @@ -62,7 +112,7 @@ public String imagePath() { /** * Set the imagePath property: VHD/CIM image path on Network Share. - * + * * @param imagePath the imagePath value to set. * @return the MsixPackageInner object itself. */ @@ -76,7 +126,7 @@ public MsixPackageInner withImagePath(String imagePath) { /** * Get the packageName property: Package Name from appxmanifest.xml. - * + * * @return the packageName value. */ public String packageName() { @@ -85,7 +135,7 @@ public String packageName() { /** * Set the packageName property: Package Name from appxmanifest.xml. - * + * * @param packageName the packageName value to set. * @return the MsixPackageInner object itself. */ @@ -100,7 +150,7 @@ public MsixPackageInner withPackageName(String packageName) { /** * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @return the packageFamilyName value. */ public String packageFamilyName() { @@ -110,7 +160,7 @@ public String packageFamilyName() { /** * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @param packageFamilyName the packageFamilyName value to set. * @return the MsixPackageInner object itself. */ @@ -124,7 +174,7 @@ public MsixPackageInner withPackageFamilyName(String packageFamilyName) { /** * Get the displayName property: User friendly Name to be displayed in the portal. - * + * * @return the displayName value. */ public String displayName() { @@ -133,7 +183,7 @@ public String displayName() { /** * Set the displayName property: User friendly Name to be displayed in the portal. - * + * * @param displayName the displayName value to set. * @return the MsixPackageInner object itself. */ @@ -147,7 +197,7 @@ public MsixPackageInner withDisplayName(String displayName) { /** * Get the packageRelativePath property: Relative Path to the package inside the image. - * + * * @return the packageRelativePath value. */ public String packageRelativePath() { @@ -156,7 +206,7 @@ public String packageRelativePath() { /** * Set the packageRelativePath property: Relative Path to the package inside the image. - * + * * @param packageRelativePath the packageRelativePath value to set. * @return the MsixPackageInner object itself. */ @@ -170,7 +220,7 @@ public MsixPackageInner withPackageRelativePath(String packageRelativePath) { /** * Get the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @return the isRegularRegistration value. */ public Boolean isRegularRegistration() { @@ -179,7 +229,7 @@ public Boolean isRegularRegistration() { /** * Set the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @param isRegularRegistration the isRegularRegistration value to set. * @return the MsixPackageInner object itself. */ @@ -193,7 +243,7 @@ public MsixPackageInner withIsRegularRegistration(Boolean isRegularRegistration) /** * Get the isActive property: Make this version of the package the active one across the hostpool. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -202,7 +252,7 @@ public Boolean isActive() { /** * Set the isActive property: Make this version of the package the active one across the hostpool. - * + * * @param isActive the isActive value to set. * @return the MsixPackageInner object itself. */ @@ -216,7 +266,7 @@ public MsixPackageInner withIsActive(Boolean isActive) { /** * Get the packageDependencies property: List of package dependencies. - * + * * @return the packageDependencies value. */ public List packageDependencies() { @@ -225,7 +275,7 @@ public List packageDependencies() { /** * Set the packageDependencies property: List of package dependencies. - * + * * @param packageDependencies the packageDependencies value to set. * @return the MsixPackageInner object itself. */ @@ -238,8 +288,8 @@ public MsixPackageInner withPackageDependencies(List pa } /** - * Get the version property: Package Version found in the appxmanifest.xml. - * + * Get the version property: Package version found in the appxmanifest.xml. + * * @return the version value. */ public String version() { @@ -247,8 +297,8 @@ public String version() { } /** - * Set the version property: Package Version found in the appxmanifest.xml. - * + * Set the version property: Package version found in the appxmanifest.xml. + * * @param version the version value to set. * @return the MsixPackageInner object itself. */ @@ -262,7 +312,7 @@ public MsixPackageInner withVersion(String version) { /** * Get the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * + * * @return the lastUpdated value. */ public OffsetDateTime lastUpdated() { @@ -271,7 +321,7 @@ public OffsetDateTime lastUpdated() { /** * Set the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * + * * @param lastUpdated the lastUpdated value to set. * @return the MsixPackageInner object itself. */ @@ -285,7 +335,7 @@ public MsixPackageInner withLastUpdated(OffsetDateTime lastUpdated) { /** * Get the packageApplications property: List of package applications. - * + * * @return the packageApplications value. */ public List packageApplications() { @@ -294,7 +344,7 @@ public List packageApplications() { /** * Set the packageApplications property: List of package applications. - * + * * @param packageApplications the packageApplications value to set. * @return the MsixPackageInner object itself. */ @@ -308,19 +358,63 @@ public MsixPackageInner withPackageApplications(List pa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model MsixPackageInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model MsixPackageInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(MsixPackageInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackageInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MsixPackageInner. + */ + public static MsixPackageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackageInner deserializedMsixPackageInner = new MsixPackageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMsixPackageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMsixPackageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMsixPackageInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMsixPackageInner.innerProperties = MsixPackageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMsixPackageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackageInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java index accc572ba392..d08a5b947167 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackagePatchProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** MSIX Package properties that can be patched. */ +/** + * MSIX Package properties that can be patched. + */ @Fluent -public final class MsixPackagePatchProperties { +public final class MsixPackagePatchProperties implements JsonSerializable { /* * Set a version of the package to be active across hostpool. */ - @JsonProperty(value = "isActive") private Boolean isActive; /* * Set Registration mode. Regular or Delayed. */ - @JsonProperty(value = "isRegularRegistration") private Boolean isRegularRegistration; /* * Display name for MSIX Package. */ - @JsonProperty(value = "displayName") private String displayName; - /** Creates an instance of MsixPackagePatchProperties class. */ + /** + * Creates an instance of MsixPackagePatchProperties class. + */ public MsixPackagePatchProperties() { } /** * Get the isActive property: Set a version of the package to be active across hostpool. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -43,7 +48,7 @@ public Boolean isActive() { /** * Set the isActive property: Set a version of the package to be active across hostpool. - * + * * @param isActive the isActive value to set. * @return the MsixPackagePatchProperties object itself. */ @@ -54,7 +59,7 @@ public MsixPackagePatchProperties withIsActive(Boolean isActive) { /** * Get the isRegularRegistration property: Set Registration mode. Regular or Delayed. - * + * * @return the isRegularRegistration value. */ public Boolean isRegularRegistration() { @@ -63,7 +68,7 @@ public Boolean isRegularRegistration() { /** * Set the isRegularRegistration property: Set Registration mode. Regular or Delayed. - * + * * @param isRegularRegistration the isRegularRegistration value to set. * @return the MsixPackagePatchProperties object itself. */ @@ -74,7 +79,7 @@ public MsixPackagePatchProperties withIsRegularRegistration(Boolean isRegularReg /** * Get the displayName property: Display name for MSIX Package. - * + * * @return the displayName value. */ public String displayName() { @@ -83,7 +88,7 @@ public String displayName() { /** * Set the displayName property: Display name for MSIX Package. - * + * * @param displayName the displayName value to set. * @return the MsixPackagePatchProperties object itself. */ @@ -94,9 +99,52 @@ public MsixPackagePatchProperties withDisplayName(String displayName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeBooleanField("isRegularRegistration", this.isRegularRegistration); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackagePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackagePatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MsixPackagePatchProperties. + */ + public static MsixPackagePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackagePatchProperties deserializedMsixPackagePatchProperties = new MsixPackagePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isActive".equals(fieldName)) { + deserializedMsixPackagePatchProperties.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("isRegularRegistration".equals(fieldName)) { + deserializedMsixPackagePatchProperties.isRegularRegistration + = reader.getNullable(JsonReader::getBoolean); + } else if ("displayName".equals(fieldName)) { + deserializedMsixPackagePatchProperties.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackagePatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java index 1ada5f495a17..e2f6d8ce77b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/MsixPackageProperties.java @@ -5,88 +5,87 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** Schema for MSIX Package properties. */ +/** + * Schema for MSIX Package properties. + */ @Fluent -public final class MsixPackageProperties { +public final class MsixPackageProperties implements JsonSerializable { /* * VHD/CIM image path on Network Share. */ - @JsonProperty(value = "imagePath") private String imagePath; /* * Package Name from appxmanifest.xml. */ - @JsonProperty(value = "packageName") private String packageName; /* * Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. */ - @JsonProperty(value = "packageFamilyName") private String packageFamilyName; /* * User friendly Name to be displayed in the portal. */ - @JsonProperty(value = "displayName") private String displayName; /* * Relative Path to the package inside the image. */ - @JsonProperty(value = "packageRelativePath") private String packageRelativePath; /* * Specifies how to register Package in feed. */ - @JsonProperty(value = "isRegularRegistration") private Boolean isRegularRegistration; /* * Make this version of the package the active one across the hostpool. */ - @JsonProperty(value = "isActive") private Boolean isActive; /* * List of package dependencies. */ - @JsonProperty(value = "packageDependencies") private List packageDependencies; /* - * Package Version found in the appxmanifest.xml. + * Package version found in the appxmanifest.xml. */ - @JsonProperty(value = "version") private String version; /* * Date Package was last updated, found in the appxmanifest.xml. */ - @JsonProperty(value = "lastUpdated") private OffsetDateTime lastUpdated; /* * List of package applications. */ - @JsonProperty(value = "packageApplications") private List packageApplications; - /** Creates an instance of MsixPackageProperties class. */ + /** + * Creates an instance of MsixPackageProperties class. + */ public MsixPackageProperties() { } /** * Get the imagePath property: VHD/CIM image path on Network Share. - * + * * @return the imagePath value. */ public String imagePath() { @@ -95,7 +94,7 @@ public String imagePath() { /** * Set the imagePath property: VHD/CIM image path on Network Share. - * + * * @param imagePath the imagePath value to set. * @return the MsixPackageProperties object itself. */ @@ -106,7 +105,7 @@ public MsixPackageProperties withImagePath(String imagePath) { /** * Get the packageName property: Package Name from appxmanifest.xml. - * + * * @return the packageName value. */ public String packageName() { @@ -115,7 +114,7 @@ public String packageName() { /** * Set the packageName property: Package Name from appxmanifest.xml. - * + * * @param packageName the packageName value to set. * @return the MsixPackageProperties object itself. */ @@ -127,7 +126,7 @@ public MsixPackageProperties withPackageName(String packageName) { /** * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @return the packageFamilyName value. */ public String packageFamilyName() { @@ -137,7 +136,7 @@ public String packageFamilyName() { /** * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @param packageFamilyName the packageFamilyName value to set. * @return the MsixPackageProperties object itself. */ @@ -148,7 +147,7 @@ public MsixPackageProperties withPackageFamilyName(String packageFamilyName) { /** * Get the displayName property: User friendly Name to be displayed in the portal. - * + * * @return the displayName value. */ public String displayName() { @@ -157,7 +156,7 @@ public String displayName() { /** * Set the displayName property: User friendly Name to be displayed in the portal. - * + * * @param displayName the displayName value to set. * @return the MsixPackageProperties object itself. */ @@ -168,7 +167,7 @@ public MsixPackageProperties withDisplayName(String displayName) { /** * Get the packageRelativePath property: Relative Path to the package inside the image. - * + * * @return the packageRelativePath value. */ public String packageRelativePath() { @@ -177,7 +176,7 @@ public String packageRelativePath() { /** * Set the packageRelativePath property: Relative Path to the package inside the image. - * + * * @param packageRelativePath the packageRelativePath value to set. * @return the MsixPackageProperties object itself. */ @@ -188,7 +187,7 @@ public MsixPackageProperties withPackageRelativePath(String packageRelativePath) /** * Get the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @return the isRegularRegistration value. */ public Boolean isRegularRegistration() { @@ -197,7 +196,7 @@ public Boolean isRegularRegistration() { /** * Set the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @param isRegularRegistration the isRegularRegistration value to set. * @return the MsixPackageProperties object itself. */ @@ -208,7 +207,7 @@ public MsixPackageProperties withIsRegularRegistration(Boolean isRegularRegistra /** * Get the isActive property: Make this version of the package the active one across the hostpool. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -217,7 +216,7 @@ public Boolean isActive() { /** * Set the isActive property: Make this version of the package the active one across the hostpool. - * + * * @param isActive the isActive value to set. * @return the MsixPackageProperties object itself. */ @@ -228,7 +227,7 @@ public MsixPackageProperties withIsActive(Boolean isActive) { /** * Get the packageDependencies property: List of package dependencies. - * + * * @return the packageDependencies value. */ public List packageDependencies() { @@ -237,7 +236,7 @@ public List packageDependencies() { /** * Set the packageDependencies property: List of package dependencies. - * + * * @param packageDependencies the packageDependencies value to set. * @return the MsixPackageProperties object itself. */ @@ -247,8 +246,8 @@ public MsixPackageProperties withPackageDependencies(List packageApplications() { @@ -297,7 +296,7 @@ public List packageApplications() { /** * Set the packageApplications property: List of package applications. - * + * * @param packageApplications the packageApplications value to set. * @return the MsixPackageProperties object itself. */ @@ -308,7 +307,7 @@ public MsixPackageProperties withPackageApplications(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("imagePath", this.imagePath); + jsonWriter.writeStringField("packageName", this.packageName); + jsonWriter.writeStringField("packageFamilyName", this.packageFamilyName); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("packageRelativePath", this.packageRelativePath); + jsonWriter.writeBooleanField("isRegularRegistration", this.isRegularRegistration); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeArrayField("packageDependencies", this.packageDependencies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("lastUpdated", + this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated)); + jsonWriter.writeArrayField("packageApplications", this.packageApplications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackageProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MsixPackageProperties. + */ + public static MsixPackageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackageProperties deserializedMsixPackageProperties = new MsixPackageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imagePath".equals(fieldName)) { + deserializedMsixPackageProperties.imagePath = reader.getString(); + } else if ("packageName".equals(fieldName)) { + deserializedMsixPackageProperties.packageName = reader.getString(); + } else if ("packageFamilyName".equals(fieldName)) { + deserializedMsixPackageProperties.packageFamilyName = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMsixPackageProperties.displayName = reader.getString(); + } else if ("packageRelativePath".equals(fieldName)) { + deserializedMsixPackageProperties.packageRelativePath = reader.getString(); + } else if ("isRegularRegistration".equals(fieldName)) { + deserializedMsixPackageProperties.isRegularRegistration + = reader.getNullable(JsonReader::getBoolean); + } else if ("isActive".equals(fieldName)) { + deserializedMsixPackageProperties.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("packageDependencies".equals(fieldName)) { + List packageDependencies + = reader.readArray(reader1 -> MsixPackageDependencies.fromJson(reader1)); + deserializedMsixPackageProperties.packageDependencies = packageDependencies; + } else if ("version".equals(fieldName)) { + deserializedMsixPackageProperties.version = reader.getString(); + } else if ("lastUpdated".equals(fieldName)) { + deserializedMsixPackageProperties.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("packageApplications".equals(fieldName)) { + List packageApplications + = reader.readArray(reader1 -> MsixPackageApplications.fromJson(reader1)); + deserializedMsixPackageProperties.packageApplications = packageApplications; + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackageProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionProperties.java index 38057b464ed5..cc7adc4c52ce 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionProperties.java @@ -6,39 +6,60 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; +import java.util.List; -/** Properties of the PrivateEndpointConnectProperties. */ +/** + * Properties of the private endpoint connection. + */ @Fluent -public final class PrivateEndpointConnectionProperties { +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { /* - * The resource of private end point. + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The private endpoint resource. */ - @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; /* * A collection of information about the state of the connection between service consumer and provider. */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * The provisioning state of the private endpoint connection resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; - /** Creates an instance of PrivateEndpointConnectionProperties class. */ + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ public PrivateEndpointConnectionProperties() { } /** - * Get the privateEndpoint property: The resource of private end point. - * + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -46,8 +67,8 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The resource of private end point. - * + * Set the privateEndpoint property: The private endpoint resource. + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. */ @@ -59,7 +80,7 @@ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint p /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -69,19 +90,19 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } /** * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -90,7 +111,7 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -98,15 +119,61 @@ public void validate() { privateEndpoint().validate(); } if (privateLinkServiceConnectionState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); } else { privateLinkServiceConnectionState().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java index 625ff47548f1..4843880c9de8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateEndpointConnectionWithSystemDataInner.java @@ -6,55 +6,224 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; +import java.util.List; -/** The Private Endpoint Connection resource. */ +/** + * The Private Endpoint Connection resource. + */ @Fluent public final class PrivateEndpointConnectionWithSystemDataInner extends PrivateEndpointConnection { /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of PrivateEndpointConnectionWithSystemDataInner class. */ + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionWithSystemDataInner class. + */ public PrivateEndpointConnectionWithSystemDataInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ + @Override public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ @Override + public String id() { + return this.id; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionWithSystemDataInner object itself. + */ public PrivateEndpointConnectionWithSystemDataInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - super.withPrivateEndpoint(privateEndpoint); + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); return this; } - /** {@inheritDoc} */ - @Override - public PrivateEndpointConnectionWithSystemDataInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - super.withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionWithSystemDataInner object itself. + */ + public PrivateEndpointConnectionWithSystemDataInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionWithSystemDataInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionWithSystemDataInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionWithSystemDataInner. + */ + public static PrivateEndpointConnectionWithSystemDataInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionWithSystemDataInner deserializedPrivateEndpointConnectionWithSystemDataInner + = new PrivateEndpointConnectionWithSystemDataInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionWithSystemDataInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionWithSystemDataInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionWithSystemDataInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionWithSystemDataInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionWithSystemDataInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionWithSystemDataInner; + }); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java index bcbcdafc61ba..10863e24af40 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceInner.java @@ -6,34 +6,100 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** A private link resource. */ +/** + * A private link resource. + */ @Fluent public final class PrivateLinkResourceInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; - /** Creates an instance of PrivateLinkResourceInner class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ public PrivateLinkResourceInner() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateLinkResourceProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -42,7 +108,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -51,7 +117,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -60,7 +126,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResourceInner object itself. */ @@ -74,7 +140,7 @@ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneN /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -82,4 +148,50 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java index c6b1b9b130d0..301b26108ac8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/PrivateLinkResourceProperties.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Properties of a private link resource. */ +/** + * Properties of a private link resource. + */ @Fluent -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * The private link resource required member names. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * The private link resource Private link DNS zone name. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; - /** Creates an instance of PrivateLinkResourceProperties class. */ + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ public PrivateLinkResourceProperties() { } /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -44,7 +49,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -53,7 +58,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -62,7 +67,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResourceProperties object itself. */ @@ -73,9 +78,53 @@ public PrivateLinkResourceProperties withRequiredZoneNames(List required /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java index 5f0231ddac67..8d63fb5f4950 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationInfoInner.java @@ -5,38 +5,45 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenOperation; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** Represents a RegistrationInfo definition. */ +/** + * Represents a RegistrationInfo definition. + */ @Fluent -public final class RegistrationInfoInner { +public final class RegistrationInfoInner implements JsonSerializable { /* * Expiration time of registration token. */ - @JsonProperty(value = "expirationTime") private OffsetDateTime expirationTime; /* * The registration token base64 encoded string. */ - @JsonProperty(value = "token") private String token; /* * The type of resetting the token. */ - @JsonProperty(value = "registrationTokenOperation") private RegistrationTokenOperation registrationTokenOperation; - /** Creates an instance of RegistrationInfoInner class. */ + /** + * Creates an instance of RegistrationInfoInner class. + */ public RegistrationInfoInner() { } /** * Get the expirationTime property: Expiration time of registration token. - * + * * @return the expirationTime value. */ public OffsetDateTime expirationTime() { @@ -45,7 +52,7 @@ public OffsetDateTime expirationTime() { /** * Set the expirationTime property: Expiration time of registration token. - * + * * @param expirationTime the expirationTime value to set. * @return the RegistrationInfoInner object itself. */ @@ -56,7 +63,7 @@ public RegistrationInfoInner withExpirationTime(OffsetDateTime expirationTime) { /** * Get the token property: The registration token base64 encoded string. - * + * * @return the token value. */ public String token() { @@ -65,7 +72,7 @@ public String token() { /** * Set the token property: The registration token base64 encoded string. - * + * * @param token the token value to set. * @return the RegistrationInfoInner object itself. */ @@ -76,7 +83,7 @@ public RegistrationInfoInner withToken(String token) { /** * Get the registrationTokenOperation property: The type of resetting the token. - * + * * @return the registrationTokenOperation value. */ public RegistrationTokenOperation registrationTokenOperation() { @@ -85,7 +92,7 @@ public RegistrationTokenOperation registrationTokenOperation() { /** * Set the registrationTokenOperation property: The type of resetting the token. - * + * * @param registrationTokenOperation the registrationTokenOperation value to set. * @return the RegistrationInfoInner object itself. */ @@ -96,9 +103,55 @@ public RegistrationInfoInner withRegistrationTokenOperation(RegistrationTokenOpe /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expirationTime", + this.expirationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTime)); + jsonWriter.writeStringField("token", this.token); + jsonWriter.writeStringField("registrationTokenOperation", + this.registrationTokenOperation == null ? null : this.registrationTokenOperation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistrationInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistrationInfoInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistrationInfoInner. + */ + public static RegistrationInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistrationInfoInner deserializedRegistrationInfoInner = new RegistrationInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirationTime".equals(fieldName)) { + deserializedRegistrationInfoInner.expirationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("token".equals(fieldName)) { + deserializedRegistrationInfoInner.token = reader.getString(); + } else if ("registrationTokenOperation".equals(fieldName)) { + deserializedRegistrationInfoInner.registrationTokenOperation + = RegistrationTokenOperation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistrationInfoInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java new file mode 100644 index 000000000000..f33c65e10d74 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/RegistrationTokenListInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; +import java.io.IOException; +import java.util.List; + +/** + * RegistrationTokenList + * + * List of RegistrationToken definitions. + */ +@Fluent +public final class RegistrationTokenListInner implements JsonSerializable { + /* + * List of RegistrationToken definitions. + */ + private List value; + + /* + * Link to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of RegistrationTokenListInner class. + */ + public RegistrationTokenListInner() { + } + + /** + * Get the value property: List of RegistrationToken definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of RegistrationToken definitions. + * + * @param value the value value to set. + * @return the RegistrationTokenListInner object itself. + */ + public RegistrationTokenListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistrationTokenListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistrationTokenListInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistrationTokenListInner. + */ + public static RegistrationTokenListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistrationTokenListInner deserializedRegistrationTokenListInner = new RegistrationTokenListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RegistrationTokenMinimal.fromJson(reader1)); + deserializedRegistrationTokenListInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRegistrationTokenListInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistrationTokenListInner; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java index a831f4453f31..e2aebc82c232 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ResourceProviderOperationInner.java @@ -5,44 +5,48 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.OperationProperties; import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Supported operation of this resource provider. */ +/** + * Supported operation of this resource provider. + */ @Fluent -public final class ResourceProviderOperationInner { +public final class ResourceProviderOperationInner implements JsonSerializable { /* * 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; /* * Is a data action. */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; /* * Properties of the operation */ - @JsonProperty(value = "properties") private OperationProperties properties; - /** Creates an instance of ResourceProviderOperationInner class. */ + /** + * Creates an instance of ResourceProviderOperationInner class. + */ public ResourceProviderOperationInner() { } /** * Get the name property: Operation name, in format of {provider}/{resource}/{operation}. - * + * * @return the name value. */ public String name() { @@ -51,7 +55,7 @@ public String name() { /** * Set the name property: Operation name, in format of {provider}/{resource}/{operation}. - * + * * @param name the name value to set. * @return the ResourceProviderOperationInner object itself. */ @@ -62,7 +66,7 @@ public ResourceProviderOperationInner withName(String name) { /** * Get the display property: Display metadata associated with the operation. - * + * * @return the display value. */ public ResourceProviderOperationDisplay display() { @@ -71,7 +75,7 @@ public ResourceProviderOperationDisplay display() { /** * Set the display property: Display metadata associated with the operation. - * + * * @param display the display value to set. * @return the ResourceProviderOperationInner object itself. */ @@ -82,7 +86,7 @@ public ResourceProviderOperationInner withDisplay(ResourceProviderOperationDispl /** * Get the isDataAction property: Is a data action. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -91,7 +95,7 @@ public Boolean isDataAction() { /** * Set the isDataAction property: Is a data action. - * + * * @param isDataAction the isDataAction value to set. * @return the ResourceProviderOperationInner object itself. */ @@ -102,7 +106,7 @@ public ResourceProviderOperationInner withIsDataAction(Boolean isDataAction) { /** * Get the properties property: Properties of the operation. - * + * * @return the properties value. */ public OperationProperties properties() { @@ -111,7 +115,7 @@ public OperationProperties properties() { /** * Set the properties property: Properties of the operation. - * + * * @param properties the properties value to set. * @return the ResourceProviderOperationInner object itself. */ @@ -122,7 +126,7 @@ public ResourceProviderOperationInner withProperties(OperationProperties propert /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -133,4 +137,52 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProviderOperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProviderOperationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceProviderOperationInner. + */ + public static ResourceProviderOperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProviderOperationInner deserializedResourceProviderOperationInner + = new ResourceProviderOperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceProviderOperationInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedResourceProviderOperationInner.display + = ResourceProviderOperationDisplay.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedResourceProviderOperationInner.isDataAction + = reader.getNullable(JsonReader::getBoolean); + } else if ("properties".equals(fieldName)) { + deserializedResourceProviderOperationInner.properties = OperationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProviderOperationInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java index 5d1edd7520cb..0bb60c207fb4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanInner.java @@ -7,6 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; @@ -14,94 +17,175 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; /** * ScalingPlan - * - *

Represents a scaling plan definition. + * + * Represents a scaling plan definition. */ @Fluent public final class ScalingPlanInner extends ResourceModelWithAllowedPropertySet { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for scaling plan. + */ + private ScalingPlanProperties innerProperties = new ScalingPlanProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for scaling plan. + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header + * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested + * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. */ - @JsonProperty(value = "properties", required = true) - private ScalingPlanProperties innerProperties = new ScalingPlanProperties(); + private String etag; + + /* + * The type of the resource. + */ + private String type; - /** Creates an instance of ScalingPlanInner class. */ + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ScalingPlanInner class. + */ public ScalingPlanInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for scaling plan. + * + * @return the innerProperties value. + */ + private ScalingPlanProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ + @Override public SystemData systemData() { return this.systemData; } /** - * Get the innerProperties property: Detailed properties for scaling plan. - * - * @return the innerProperties value. + * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be + * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from + * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), + * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value. */ - private ScalingPlanProperties innerProperties() { - return this.innerProperties; + @Override + public String etag() { + return this.etag; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withManagedBy(String managedBy) { super.withManagedBy(managedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withKind(String kind) { super.withKind(kind); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withSku(ResourceModelWithAllowedPropertySetSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { super.withPlan(plan); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ScalingPlanInner withTags(Map tags) { super.withTags(tags); @@ -110,7 +194,7 @@ public ScalingPlanInner withTags(Map tags) { /** * Get the objectId property: ObjectId of scaling plan. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -119,7 +203,7 @@ public String objectId() { /** * Get the description property: Description of scaling plan. - * + * * @return the description value. */ public String description() { @@ -128,7 +212,7 @@ public String description() { /** * Set the description property: Description of scaling plan. - * + * * @param description the description value to set. * @return the ScalingPlanInner object itself. */ @@ -142,7 +226,7 @@ public ScalingPlanInner withDescription(String description) { /** * Get the friendlyName property: User friendly name of scaling plan. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -151,7 +235,7 @@ public String friendlyName() { /** * Set the friendlyName property: User friendly name of scaling plan. - * + * * @param friendlyName the friendlyName value to set. * @return the ScalingPlanInner object itself. */ @@ -165,7 +249,7 @@ public ScalingPlanInner withFriendlyName(String friendlyName) { /** * Get the timeZone property: Timezone of the scaling plan. - * + * * @return the timeZone value. */ public String timeZone() { @@ -174,7 +258,7 @@ public String timeZone() { /** * Set the timeZone property: Timezone of the scaling plan. - * + * * @param timeZone the timeZone value to set. * @return the ScalingPlanInner object itself. */ @@ -188,7 +272,7 @@ public ScalingPlanInner withTimeZone(String timeZone) { /** * Get the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ public ScalingHostPoolType hostPoolType() { @@ -197,7 +281,7 @@ public ScalingHostPoolType hostPoolType() { /** * Set the hostPoolType property: HostPool type for desktop. - * + * * @param hostPoolType the hostPoolType value to set. * @return the ScalingPlanInner object itself. */ @@ -211,7 +295,7 @@ public ScalingPlanInner withHostPoolType(ScalingHostPoolType hostPoolType) { /** * Get the exclusionTag property: Exclusion tag for scaling plan. - * + * * @return the exclusionTag value. */ public String exclusionTag() { @@ -220,7 +304,7 @@ public String exclusionTag() { /** * Set the exclusionTag property: Exclusion tag for scaling plan. - * + * * @param exclusionTag the exclusionTag value to set. * @return the ScalingPlanInner object itself. */ @@ -234,7 +318,7 @@ public ScalingPlanInner withExclusionTag(String exclusionTag) { /** * Get the schedules property: List of ScalingPlanPooledSchedule definitions. - * + * * @return the schedules value. */ public List schedules() { @@ -243,7 +327,7 @@ public List schedules() { /** * Set the schedules property: List of ScalingPlanPooledSchedule definitions. - * + * * @param schedules the schedules value to set. * @return the ScalingPlanInner object itself. */ @@ -257,7 +341,7 @@ public ScalingPlanInner withSchedules(List schedules) { /** * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @return the hostPoolReferences value. */ public List hostPoolReferences() { @@ -266,7 +350,7 @@ public List hostPoolReferences() { /** * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @param hostPoolReferences the hostPoolReferences value to set. * @return the ScalingPlanInner object itself. */ @@ -280,21 +364,98 @@ public ScalingPlanInner withHostPoolReferences(List ho /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ScalingPlanInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ScalingPlanInner")); } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedBy", managedBy()); + jsonWriter.writeStringField("kind", kind()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("sku", sku()); + jsonWriter.writeJsonField("plan", plan()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScalingPlanInner. + */ + public static ScalingPlanInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanInner deserializedScalingPlanInner = new ScalingPlanInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScalingPlanInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScalingPlanInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedScalingPlanInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedScalingPlanInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedScalingPlanInner.withTags(tags); + } else if ("managedBy".equals(fieldName)) { + deserializedScalingPlanInner.withManagedBy(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedScalingPlanInner.withKind(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedScalingPlanInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedScalingPlanInner + .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + } else if ("sku".equals(fieldName)) { + deserializedScalingPlanInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("plan".equals(fieldName)) { + deserializedScalingPlanInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedScalingPlanInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedScalingPlanInner.innerProperties = ScalingPlanProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java index f45e9b0364c2..ee719f82bc8f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPatchProperties.java @@ -5,57 +5,59 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Scaling plan properties. */ +/** + * Scaling plan properties. + */ @Fluent -public final class ScalingPlanPatchProperties { +public final class ScalingPlanPatchProperties implements JsonSerializable { /* * Description of scaling plan. */ - @JsonProperty(value = "description") private String description; /* * User friendly name of scaling plan. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Timezone of the scaling plan. */ - @JsonProperty(value = "timeZone") private String timeZone; /* * Exclusion tag for scaling plan. */ - @JsonProperty(value = "exclusionTag") private String exclusionTag; /* * List of ScalingSchedule definitions. */ - @JsonProperty(value = "schedules") private List schedules; /* * List of ScalingHostPoolReference definitions. */ - @JsonProperty(value = "hostPoolReferences") private List hostPoolReferences; - /** Creates an instance of ScalingPlanPatchProperties class. */ + /** + * Creates an instance of ScalingPlanPatchProperties class. + */ public ScalingPlanPatchProperties() { } /** * Get the description property: Description of scaling plan. - * + * * @return the description value. */ public String description() { @@ -64,7 +66,7 @@ public String description() { /** * Set the description property: Description of scaling plan. - * + * * @param description the description value to set. * @return the ScalingPlanPatchProperties object itself. */ @@ -75,7 +77,7 @@ public ScalingPlanPatchProperties withDescription(String description) { /** * Get the friendlyName property: User friendly name of scaling plan. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -84,7 +86,7 @@ public String friendlyName() { /** * Set the friendlyName property: User friendly name of scaling plan. - * + * * @param friendlyName the friendlyName value to set. * @return the ScalingPlanPatchProperties object itself. */ @@ -95,7 +97,7 @@ public ScalingPlanPatchProperties withFriendlyName(String friendlyName) { /** * Get the timeZone property: Timezone of the scaling plan. - * + * * @return the timeZone value. */ public String timeZone() { @@ -104,7 +106,7 @@ public String timeZone() { /** * Set the timeZone property: Timezone of the scaling plan. - * + * * @param timeZone the timeZone value to set. * @return the ScalingPlanPatchProperties object itself. */ @@ -115,7 +117,7 @@ public ScalingPlanPatchProperties withTimeZone(String timeZone) { /** * Get the exclusionTag property: Exclusion tag for scaling plan. - * + * * @return the exclusionTag value. */ public String exclusionTag() { @@ -124,7 +126,7 @@ public String exclusionTag() { /** * Set the exclusionTag property: Exclusion tag for scaling plan. - * + * * @param exclusionTag the exclusionTag value to set. * @return the ScalingPlanPatchProperties object itself. */ @@ -135,7 +137,7 @@ public ScalingPlanPatchProperties withExclusionTag(String exclusionTag) { /** * Get the schedules property: List of ScalingSchedule definitions. - * + * * @return the schedules value. */ public List schedules() { @@ -144,7 +146,7 @@ public List schedules() { /** * Set the schedules property: List of ScalingSchedule definitions. - * + * * @param schedules the schedules value to set. * @return the ScalingPlanPatchProperties object itself. */ @@ -155,7 +157,7 @@ public ScalingPlanPatchProperties withSchedules(List schedules) /** * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @return the hostPoolReferences value. */ public List hostPoolReferences() { @@ -164,7 +166,7 @@ public List hostPoolReferences() { /** * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @param hostPoolReferences the hostPoolReferences value to set. * @return the ScalingPlanPatchProperties object itself. */ @@ -175,7 +177,7 @@ public ScalingPlanPatchProperties withHostPoolReferences(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeStringField("exclusionTag", this.exclusionTag); + jsonWriter.writeArrayField("schedules", this.schedules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("hostPoolReferences", this.hostPoolReferences, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPatchProperties. + */ + public static ScalingPlanPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPatchProperties deserializedScalingPlanPatchProperties = new ScalingPlanPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedScalingPlanPatchProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedScalingPlanPatchProperties.friendlyName = reader.getString(); + } else if ("timeZone".equals(fieldName)) { + deserializedScalingPlanPatchProperties.timeZone = reader.getString(); + } else if ("exclusionTag".equals(fieldName)) { + deserializedScalingPlanPatchProperties.exclusionTag = reader.getString(); + } else if ("schedules".equals(fieldName)) { + List schedules = reader.readArray(reader1 -> ScalingSchedule.fromJson(reader1)); + deserializedScalingPlanPatchProperties.schedules = schedules; + } else if ("hostPoolReferences".equals(fieldName)) { + List hostPoolReferences + = reader.readArray(reader1 -> ScalingHostPoolReference.fromJson(reader1)); + deserializedScalingPlanPatchProperties.hostPoolReferences = hostPoolReferences; + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java index 96c8a3393c45..b571d059ba0e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleInner.java @@ -8,36 +8,65 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; import com.azure.resourcemanager.desktopvirtualization.models.Time; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Represents a ScalingPlanPersonalSchedule definition. */ +/** + * Represents a ScalingPlanPersonalSchedule definition. + */ @Fluent public final class ScalingPlanPersonalScheduleInner extends ProxyResource { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for ScalingPlanPersonalSchedule + */ + private ScalingPlanPersonalScheduleProperties innerProperties = new ScalingPlanPersonalScheduleProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for ScalingPlanPersonalSchedule + * The type of the resource. */ - @JsonProperty(value = "properties", required = true) - private ScalingPlanPersonalScheduleProperties innerProperties = new ScalingPlanPersonalScheduleProperties(); + private String type; + + /* + * The name of the resource. + */ + private String name; - /** Creates an instance of ScalingPlanPersonalScheduleInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ScalingPlanPersonalScheduleInner class. + */ public ScalingPlanPersonalScheduleInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for ScalingPlanPersonalSchedule. + * + * @return the innerProperties value. + */ + private ScalingPlanPersonalScheduleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -45,17 +74,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for ScalingPlanPersonalSchedule. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private ScalingPlanPersonalScheduleProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -64,7 +114,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -78,7 +128,7 @@ public ScalingPlanPersonalScheduleInner withDaysOfWeek(List daysOfWee /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -87,7 +137,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -102,7 +152,7 @@ public ScalingPlanPersonalScheduleInner withRampUpStartTime(Time rampUpStartTime /** * Get the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in * the hostpool. - * + * * @return the rampUpAutoStartHosts value. */ public StartupBehavior rampUpAutoStartHosts() { @@ -112,7 +162,7 @@ public StartupBehavior rampUpAutoStartHosts() { /** * Set the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in * the hostpool. - * + * * @param rampUpAutoStartHosts the rampUpAutoStartHosts value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -128,7 +178,7 @@ public ScalingPlanPersonalScheduleInner withRampUpAutoStartHosts(StartupBehavior * Get the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning * them on manually. - * + * * @return the rampUpStartVMOnConnect value. */ public SetStartVMOnConnect rampUpStartVMOnConnect() { @@ -139,7 +189,7 @@ public SetStartVMOnConnect rampUpStartVMOnConnect() { * Set the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning * them on manually. - * + * * @param rampUpStartVMOnConnect the rampUpStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -153,7 +203,7 @@ public ScalingPlanPersonalScheduleInner withRampUpStartVMOnConnect(SetStartVMOnC /** * Get the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @return the rampUpActionOnDisconnect value. */ public SessionHandlingOperation rampUpActionOnDisconnect() { @@ -162,12 +212,12 @@ public SessionHandlingOperation rampUpActionOnDisconnect() { /** * Set the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @param rampUpActionOnDisconnect the rampUpActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withRampUpActionOnDisconnect( - SessionHandlingOperation rampUpActionOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -178,7 +228,7 @@ public ScalingPlanPersonalScheduleInner withRampUpActionOnDisconnect( /** * Get the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnDisconnect value. */ public Integer rampUpMinutesToWaitOnDisconnect() { @@ -188,12 +238,12 @@ public Integer rampUpMinutesToWaitOnDisconnect() { /** * Set the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @param rampUpMinutesToWaitOnDisconnect the rampUpMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withRampUpMinutesToWaitOnDisconnect( - Integer rampUpMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -203,7 +253,7 @@ public ScalingPlanPersonalScheduleInner withRampUpMinutesToWaitOnDisconnect( /** * Get the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @return the rampUpActionOnLogoff value. */ public SessionHandlingOperation rampUpActionOnLogoff() { @@ -212,7 +262,7 @@ public SessionHandlingOperation rampUpActionOnLogoff() { /** * Set the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @param rampUpActionOnLogoff the rampUpActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -227,7 +277,7 @@ public ScalingPlanPersonalScheduleInner withRampUpActionOnLogoff(SessionHandling /** * Get the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnLogoff value. */ public Integer rampUpMinutesToWaitOnLogoff() { @@ -237,7 +287,7 @@ public Integer rampUpMinutesToWaitOnLogoff() { /** * Set the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @param rampUpMinutesToWaitOnLogoff the rampUpMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -251,7 +301,7 @@ public ScalingPlanPersonalScheduleInner withRampUpMinutesToWaitOnLogoff(Integer /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -260,7 +310,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -275,7 +325,7 @@ public ScalingPlanPersonalScheduleInner withPeakStartTime(Time peakStartTime) { /** * Get the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @return the peakStartVMOnConnect value. */ public SetStartVMOnConnect peakStartVMOnConnect() { @@ -285,7 +335,7 @@ public SetStartVMOnConnect peakStartVMOnConnect() { /** * Set the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @param peakStartVMOnConnect the peakStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -299,7 +349,7 @@ public ScalingPlanPersonalScheduleInner withPeakStartVMOnConnect(SetStartVMOnCon /** * Get the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @return the peakActionOnDisconnect value. */ public SessionHandlingOperation peakActionOnDisconnect() { @@ -308,12 +358,12 @@ public SessionHandlingOperation peakActionOnDisconnect() { /** * Set the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @param peakActionOnDisconnect the peakActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withPeakActionOnDisconnect( - SessionHandlingOperation peakActionOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -324,7 +374,7 @@ public ScalingPlanPersonalScheduleInner withPeakActionOnDisconnect( /** * Get the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session * handling action when a user disconnects during the peak period. - * + * * @return the peakMinutesToWaitOnDisconnect value. */ public Integer peakMinutesToWaitOnDisconnect() { @@ -334,7 +384,7 @@ public Integer peakMinutesToWaitOnDisconnect() { /** * Set the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session * handling action when a user disconnects during the peak period. - * + * * @param peakMinutesToWaitOnDisconnect the peakMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -348,7 +398,7 @@ public ScalingPlanPersonalScheduleInner withPeakMinutesToWaitOnDisconnect(Intege /** * Get the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @return the peakActionOnLogoff value. */ public SessionHandlingOperation peakActionOnLogoff() { @@ -357,7 +407,7 @@ public SessionHandlingOperation peakActionOnLogoff() { /** * Set the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @param peakActionOnLogoff the peakActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -372,7 +422,7 @@ public ScalingPlanPersonalScheduleInner withPeakActionOnLogoff(SessionHandlingOp /** * Get the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @return the peakMinutesToWaitOnLogoff value. */ public Integer peakMinutesToWaitOnLogoff() { @@ -382,7 +432,7 @@ public Integer peakMinutesToWaitOnLogoff() { /** * Set the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @param peakMinutesToWaitOnLogoff the peakMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -396,7 +446,7 @@ public ScalingPlanPersonalScheduleInner withPeakMinutesToWaitOnLogoff(Integer pe /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -405,7 +455,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -420,7 +470,7 @@ public ScalingPlanPersonalScheduleInner withRampDownStartTime(Time rampDownStart /** * Get the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @return the rampDownStartVMOnConnect value. */ public SetStartVMOnConnect rampDownStartVMOnConnect() { @@ -430,7 +480,7 @@ public SetStartVMOnConnect rampDownStartVMOnConnect() { /** * Set the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @param rampDownStartVMOnConnect the rampDownStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -445,7 +495,7 @@ public ScalingPlanPersonalScheduleInner withRampDownStartVMOnConnect(SetStartVMO /** * Get the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @return the rampDownActionOnDisconnect value. */ public SessionHandlingOperation rampDownActionOnDisconnect() { @@ -455,12 +505,12 @@ public SessionHandlingOperation rampDownActionOnDisconnect() { /** * Set the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @param rampDownActionOnDisconnect the rampDownActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withRampDownActionOnDisconnect( - SessionHandlingOperation rampDownActionOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -471,7 +521,7 @@ public ScalingPlanPersonalScheduleInner withRampDownActionOnDisconnect( /** * Get the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnDisconnect value. */ public Integer rampDownMinutesToWaitOnDisconnect() { @@ -481,12 +531,12 @@ public Integer rampDownMinutesToWaitOnDisconnect() { /** * Set the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @param rampDownMinutesToWaitOnDisconnect the rampDownMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withRampDownMinutesToWaitOnDisconnect( - Integer rampDownMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -496,7 +546,7 @@ public ScalingPlanPersonalScheduleInner withRampDownMinutesToWaitOnDisconnect( /** * Get the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @return the rampDownActionOnLogoff value. */ public SessionHandlingOperation rampDownActionOnLogoff() { @@ -505,12 +555,12 @@ public SessionHandlingOperation rampDownActionOnLogoff() { /** * Set the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @param rampDownActionOnLogoff the rampDownActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withRampDownActionOnLogoff( - SessionHandlingOperation rampDownActionOnLogoff) { + public ScalingPlanPersonalScheduleInner + withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -521,7 +571,7 @@ public ScalingPlanPersonalScheduleInner withRampDownActionOnLogoff( /** * Get the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnLogoff value. */ public Integer rampDownMinutesToWaitOnLogoff() { @@ -531,7 +581,7 @@ public Integer rampDownMinutesToWaitOnLogoff() { /** * Set the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp down period. - * + * * @param rampDownMinutesToWaitOnLogoff the rampDownMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -545,7 +595,7 @@ public ScalingPlanPersonalScheduleInner withRampDownMinutesToWaitOnLogoff(Intege /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -554,7 +604,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -569,7 +619,7 @@ public ScalingPlanPersonalScheduleInner withOffPeakStartTime(Time offPeakStartTi /** * Get the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @return the offPeakStartVMOnConnect value. */ public SetStartVMOnConnect offPeakStartVMOnConnect() { @@ -579,7 +629,7 @@ public SetStartVMOnConnect offPeakStartVMOnConnect() { /** * Set the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @param offPeakStartVMOnConnect the offPeakStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -594,7 +644,7 @@ public ScalingPlanPersonalScheduleInner withOffPeakStartVMOnConnect(SetStartVMOn /** * Get the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @return the offPeakActionOnDisconnect value. */ public SessionHandlingOperation offPeakActionOnDisconnect() { @@ -604,12 +654,12 @@ public SessionHandlingOperation offPeakActionOnDisconnect() { /** * Set the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @param offPeakActionOnDisconnect the offPeakActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withOffPeakActionOnDisconnect( - SessionHandlingOperation offPeakActionOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -620,7 +670,7 @@ public ScalingPlanPersonalScheduleInner withOffPeakActionOnDisconnect( /** * Get the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnDisconnect value. */ public Integer offPeakMinutesToWaitOnDisconnect() { @@ -630,12 +680,12 @@ public Integer offPeakMinutesToWaitOnDisconnect() { /** * Set the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @param offPeakMinutesToWaitOnDisconnect the offPeakMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ - public ScalingPlanPersonalScheduleInner withOffPeakMinutesToWaitOnDisconnect( - Integer offPeakMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleInner + withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -645,7 +695,7 @@ public ScalingPlanPersonalScheduleInner withOffPeakMinutesToWaitOnDisconnect( /** * Get the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @return the offPeakActionOnLogoff value. */ public SessionHandlingOperation offPeakActionOnLogoff() { @@ -654,7 +704,7 @@ public SessionHandlingOperation offPeakActionOnLogoff() { /** * Set the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @param offPeakActionOnLogoff the offPeakActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -669,7 +719,7 @@ public ScalingPlanPersonalScheduleInner withOffPeakActionOnLogoff(SessionHandlin /** * Get the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnLogoff value. */ public Integer offPeakMinutesToWaitOnLogoff() { @@ -679,7 +729,7 @@ public Integer offPeakMinutesToWaitOnLogoff() { /** * Set the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @param offPeakMinutesToWaitOnLogoff the offPeakMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleInner object itself. */ @@ -693,19 +743,65 @@ public ScalingPlanPersonalScheduleInner withOffPeakMinutesToWaitOnLogoff(Integer /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ScalingPlanPersonalScheduleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ScalingPlanPersonalScheduleInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPersonalScheduleInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPersonalScheduleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPersonalScheduleInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScalingPlanPersonalScheduleInner. + */ + public static ScalingPlanPersonalScheduleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPersonalScheduleInner deserializedScalingPlanPersonalScheduleInner + = new ScalingPlanPersonalScheduleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleInner.innerProperties + = ScalingPlanPersonalScheduleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPersonalScheduleInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java index ef7679fe3be0..727528381460 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPersonalScheduleProperties.java @@ -5,189 +5,172 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; import com.azure.resourcemanager.desktopvirtualization.models.Time; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A ScalingPlanPersonalSchedule. */ +/** + * A ScalingPlanPersonalSchedule. + */ @Fluent -public final class ScalingPlanPersonalScheduleProperties { +public final class ScalingPlanPersonalScheduleProperties + implements JsonSerializable { /* * Set of days of the week on which this schedule is active. */ - @JsonProperty(value = "daysOfWeek") private List daysOfWeek; /* * Starting time for ramp up period. */ - @JsonProperty(value = "rampUpStartTime") private Time rampUpStartTime; /* * The desired startup behavior during the ramp up period for personal vms in the hostpool. */ - @JsonProperty(value = "rampUpAutoStartHosts") private StartupBehavior rampUpAutoStartHosts; /* * The desired configuration of Start VM On Connect for the hostpool during the ramp up phase. If this is disabled, * session hosts must be turned on using rampUpAutoStartHosts or by turning them on manually. */ - @JsonProperty(value = "rampUpStartVMOnConnect") private SetStartVMOnConnect rampUpStartVMOnConnect; /* * Action to be taken after a user disconnect during the ramp up period. */ - @JsonProperty(value = "rampUpActionOnDisconnect") private SessionHandlingOperation rampUpActionOnDisconnect; /* * The time in minutes to wait before performing the desired session handling action when a user disconnects during * the ramp up period. */ - @JsonProperty(value = "rampUpMinutesToWaitOnDisconnect") private Integer rampUpMinutesToWaitOnDisconnect; /* * Action to be taken after a logoff during the ramp up period. */ - @JsonProperty(value = "rampUpActionOnLogoff") private SessionHandlingOperation rampUpActionOnLogoff; /* - * The time in minutes to wait before performing the desired session handling action when a user logs off during - * the ramp up period. + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * ramp up period. */ - @JsonProperty(value = "rampUpMinutesToWaitOnLogoff") private Integer rampUpMinutesToWaitOnLogoff; /* * Starting time for peak period. */ - @JsonProperty(value = "peakStartTime") private Time peakStartTime; /* * The desired configuration of Start VM On Connect for the hostpool during the peak phase. */ - @JsonProperty(value = "peakStartVMOnConnect") private SetStartVMOnConnect peakStartVMOnConnect; /* * Action to be taken after a user disconnect during the peak period. */ - @JsonProperty(value = "peakActionOnDisconnect") private SessionHandlingOperation peakActionOnDisconnect; /* * The time in minutes to wait before performing the desired session handling action when a user disconnects during * the peak period. */ - @JsonProperty(value = "peakMinutesToWaitOnDisconnect") private Integer peakMinutesToWaitOnDisconnect; /* * Action to be taken after a logoff during the peak period. */ - @JsonProperty(value = "peakActionOnLogoff") private SessionHandlingOperation peakActionOnLogoff; /* - * The time in minutes to wait before performing the desired session handling action when a user logs off during - * the peak period. + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * peak period. */ - @JsonProperty(value = "peakMinutesToWaitOnLogoff") private Integer peakMinutesToWaitOnLogoff; /* * Starting time for ramp down period. */ - @JsonProperty(value = "rampDownStartTime") private Time rampDownStartTime; /* * The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. */ - @JsonProperty(value = "rampDownStartVMOnConnect") private SetStartVMOnConnect rampDownStartVMOnConnect; /* * Action to be taken after a user disconnect during the ramp down period. */ - @JsonProperty(value = "rampDownActionOnDisconnect") private SessionHandlingOperation rampDownActionOnDisconnect; /* * The time in minutes to wait before performing the desired session handling action when a user disconnects during * the ramp down period. */ - @JsonProperty(value = "rampDownMinutesToWaitOnDisconnect") private Integer rampDownMinutesToWaitOnDisconnect; /* * Action to be taken after a logoff during the ramp down period. */ - @JsonProperty(value = "rampDownActionOnLogoff") private SessionHandlingOperation rampDownActionOnLogoff; /* - * The time in minutes to wait before performing the desired session handling action when a user logs off during - * the ramp down period. + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * ramp down period. */ - @JsonProperty(value = "rampDownMinutesToWaitOnLogoff") private Integer rampDownMinutesToWaitOnLogoff; /* * Starting time for off-peak period. */ - @JsonProperty(value = "offPeakStartTime") private Time offPeakStartTime; /* * The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. */ - @JsonProperty(value = "offPeakStartVMOnConnect") private SetStartVMOnConnect offPeakStartVMOnConnect; /* * Action to be taken after a user disconnect during the off-peak period. */ - @JsonProperty(value = "offPeakActionOnDisconnect") private SessionHandlingOperation offPeakActionOnDisconnect; /* * The time in minutes to wait before performing the desired session handling action when a user disconnects during * the off-peak period. */ - @JsonProperty(value = "offPeakMinutesToWaitOnDisconnect") private Integer offPeakMinutesToWaitOnDisconnect; /* * Action to be taken after a logoff during the off-peak period. */ - @JsonProperty(value = "offPeakActionOnLogoff") private SessionHandlingOperation offPeakActionOnLogoff; /* - * The time in minutes to wait before performing the desired session handling action when a user logs off during - * the off-peak period. + * The time in minutes to wait before performing the desired session handling action when a user logs off during the + * off-peak period. */ - @JsonProperty(value = "offPeakMinutesToWaitOnLogoff") private Integer offPeakMinutesToWaitOnLogoff; - /** Creates an instance of ScalingPlanPersonalScheduleProperties class. */ + /** + * Creates an instance of ScalingPlanPersonalScheduleProperties class. + */ public ScalingPlanPersonalScheduleProperties() { } /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -196,7 +179,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -207,7 +190,7 @@ public ScalingPlanPersonalScheduleProperties withDaysOfWeek(List days /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -216,7 +199,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -228,7 +211,7 @@ public ScalingPlanPersonalScheduleProperties withRampUpStartTime(Time rampUpStar /** * Get the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in * the hostpool. - * + * * @return the rampUpAutoStartHosts value. */ public StartupBehavior rampUpAutoStartHosts() { @@ -238,7 +221,7 @@ public StartupBehavior rampUpAutoStartHosts() { /** * Set the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in * the hostpool. - * + * * @param rampUpAutoStartHosts the rampUpAutoStartHosts value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -251,7 +234,7 @@ public ScalingPlanPersonalScheduleProperties withRampUpAutoStartHosts(StartupBeh * Get the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning * them on manually. - * + * * @return the rampUpStartVMOnConnect value. */ public SetStartVMOnConnect rampUpStartVMOnConnect() { @@ -262,19 +245,19 @@ public SetStartVMOnConnect rampUpStartVMOnConnect() { * Set the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning * them on manually. - * + * * @param rampUpStartVMOnConnect the rampUpStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampUpStartVMOnConnect( - SetStartVMOnConnect rampUpStartVMOnConnect) { + public ScalingPlanPersonalScheduleProperties + withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) { this.rampUpStartVMOnConnect = rampUpStartVMOnConnect; return this; } /** * Get the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @return the rampUpActionOnDisconnect value. */ public SessionHandlingOperation rampUpActionOnDisconnect() { @@ -283,12 +266,12 @@ public SessionHandlingOperation rampUpActionOnDisconnect() { /** * Set the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @param rampUpActionOnDisconnect the rampUpActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampUpActionOnDisconnect( - SessionHandlingOperation rampUpActionOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { this.rampUpActionOnDisconnect = rampUpActionOnDisconnect; return this; } @@ -296,7 +279,7 @@ public ScalingPlanPersonalScheduleProperties withRampUpActionOnDisconnect( /** * Get the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnDisconnect value. */ public Integer rampUpMinutesToWaitOnDisconnect() { @@ -306,19 +289,19 @@ public Integer rampUpMinutesToWaitOnDisconnect() { /** * Set the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @param rampUpMinutesToWaitOnDisconnect the rampUpMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampUpMinutesToWaitOnDisconnect( - Integer rampUpMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { this.rampUpMinutesToWaitOnDisconnect = rampUpMinutesToWaitOnDisconnect; return this; } /** * Get the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @return the rampUpActionOnLogoff value. */ public SessionHandlingOperation rampUpActionOnLogoff() { @@ -327,12 +310,12 @@ public SessionHandlingOperation rampUpActionOnLogoff() { /** * Set the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @param rampUpActionOnLogoff the rampUpActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampUpActionOnLogoff( - SessionHandlingOperation rampUpActionOnLogoff) { + public ScalingPlanPersonalScheduleProperties + withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) { this.rampUpActionOnLogoff = rampUpActionOnLogoff; return this; } @@ -340,7 +323,7 @@ public ScalingPlanPersonalScheduleProperties withRampUpActionOnLogoff( /** * Get the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnLogoff value. */ public Integer rampUpMinutesToWaitOnLogoff() { @@ -350,7 +333,7 @@ public Integer rampUpMinutesToWaitOnLogoff() { /** * Set the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @param rampUpMinutesToWaitOnLogoff the rampUpMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -361,7 +344,7 @@ public ScalingPlanPersonalScheduleProperties withRampUpMinutesToWaitOnLogoff(Int /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -370,7 +353,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -382,7 +365,7 @@ public ScalingPlanPersonalScheduleProperties withPeakStartTime(Time peakStartTim /** * Get the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @return the peakStartVMOnConnect value. */ public SetStartVMOnConnect peakStartVMOnConnect() { @@ -392,7 +375,7 @@ public SetStartVMOnConnect peakStartVMOnConnect() { /** * Set the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @param peakStartVMOnConnect the peakStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -403,7 +386,7 @@ public ScalingPlanPersonalScheduleProperties withPeakStartVMOnConnect(SetStartVM /** * Get the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @return the peakActionOnDisconnect value. */ public SessionHandlingOperation peakActionOnDisconnect() { @@ -412,12 +395,12 @@ public SessionHandlingOperation peakActionOnDisconnect() { /** * Set the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @param peakActionOnDisconnect the peakActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withPeakActionOnDisconnect( - SessionHandlingOperation peakActionOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { this.peakActionOnDisconnect = peakActionOnDisconnect; return this; } @@ -425,7 +408,7 @@ public ScalingPlanPersonalScheduleProperties withPeakActionOnDisconnect( /** * Get the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session * handling action when a user disconnects during the peak period. - * + * * @return the peakMinutesToWaitOnDisconnect value. */ public Integer peakMinutesToWaitOnDisconnect() { @@ -435,19 +418,19 @@ public Integer peakMinutesToWaitOnDisconnect() { /** * Set the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session * handling action when a user disconnects during the peak period. - * + * * @param peakMinutesToWaitOnDisconnect the peakMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withPeakMinutesToWaitOnDisconnect( - Integer peakMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) { this.peakMinutesToWaitOnDisconnect = peakMinutesToWaitOnDisconnect; return this; } /** * Get the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @return the peakActionOnLogoff value. */ public SessionHandlingOperation peakActionOnLogoff() { @@ -456,7 +439,7 @@ public SessionHandlingOperation peakActionOnLogoff() { /** * Set the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @param peakActionOnLogoff the peakActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -468,7 +451,7 @@ public ScalingPlanPersonalScheduleProperties withPeakActionOnLogoff(SessionHandl /** * Get the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @return the peakMinutesToWaitOnLogoff value. */ public Integer peakMinutesToWaitOnLogoff() { @@ -478,7 +461,7 @@ public Integer peakMinutesToWaitOnLogoff() { /** * Set the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @param peakMinutesToWaitOnLogoff the peakMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -489,7 +472,7 @@ public ScalingPlanPersonalScheduleProperties withPeakMinutesToWaitOnLogoff(Integ /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -498,7 +481,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -510,7 +493,7 @@ public ScalingPlanPersonalScheduleProperties withRampDownStartTime(Time rampDown /** * Get the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @return the rampDownStartVMOnConnect value. */ public SetStartVMOnConnect rampDownStartVMOnConnect() { @@ -520,12 +503,12 @@ public SetStartVMOnConnect rampDownStartVMOnConnect() { /** * Set the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @param rampDownStartVMOnConnect the rampDownStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampDownStartVMOnConnect( - SetStartVMOnConnect rampDownStartVMOnConnect) { + public ScalingPlanPersonalScheduleProperties + withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) { this.rampDownStartVMOnConnect = rampDownStartVMOnConnect; return this; } @@ -533,7 +516,7 @@ public ScalingPlanPersonalScheduleProperties withRampDownStartVMOnConnect( /** * Get the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @return the rampDownActionOnDisconnect value. */ public SessionHandlingOperation rampDownActionOnDisconnect() { @@ -543,12 +526,12 @@ public SessionHandlingOperation rampDownActionOnDisconnect() { /** * Set the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @param rampDownActionOnDisconnect the rampDownActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampDownActionOnDisconnect( - SessionHandlingOperation rampDownActionOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { this.rampDownActionOnDisconnect = rampDownActionOnDisconnect; return this; } @@ -556,7 +539,7 @@ public ScalingPlanPersonalScheduleProperties withRampDownActionOnDisconnect( /** * Get the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnDisconnect value. */ public Integer rampDownMinutesToWaitOnDisconnect() { @@ -566,19 +549,19 @@ public Integer rampDownMinutesToWaitOnDisconnect() { /** * Set the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @param rampDownMinutesToWaitOnDisconnect the rampDownMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampDownMinutesToWaitOnDisconnect( - Integer rampDownMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { this.rampDownMinutesToWaitOnDisconnect = rampDownMinutesToWaitOnDisconnect; return this; } /** * Get the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @return the rampDownActionOnLogoff value. */ public SessionHandlingOperation rampDownActionOnLogoff() { @@ -587,12 +570,12 @@ public SessionHandlingOperation rampDownActionOnLogoff() { /** * Set the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @param rampDownActionOnLogoff the rampDownActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampDownActionOnLogoff( - SessionHandlingOperation rampDownActionOnLogoff) { + public ScalingPlanPersonalScheduleProperties + withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { this.rampDownActionOnLogoff = rampDownActionOnLogoff; return this; } @@ -600,7 +583,7 @@ public ScalingPlanPersonalScheduleProperties withRampDownActionOnLogoff( /** * Get the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnLogoff value. */ public Integer rampDownMinutesToWaitOnLogoff() { @@ -610,19 +593,19 @@ public Integer rampDownMinutesToWaitOnLogoff() { /** * Set the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp down period. - * + * * @param rampDownMinutesToWaitOnLogoff the rampDownMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withRampDownMinutesToWaitOnLogoff( - Integer rampDownMinutesToWaitOnLogoff) { + public ScalingPlanPersonalScheduleProperties + withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff) { this.rampDownMinutesToWaitOnLogoff = rampDownMinutesToWaitOnLogoff; return this; } /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -631,7 +614,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ @@ -643,7 +626,7 @@ public ScalingPlanPersonalScheduleProperties withOffPeakStartTime(Time offPeakSt /** * Get the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @return the offPeakStartVMOnConnect value. */ public SetStartVMOnConnect offPeakStartVMOnConnect() { @@ -653,12 +636,12 @@ public SetStartVMOnConnect offPeakStartVMOnConnect() { /** * Set the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @param offPeakStartVMOnConnect the offPeakStartVMOnConnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withOffPeakStartVMOnConnect( - SetStartVMOnConnect offPeakStartVMOnConnect) { + public ScalingPlanPersonalScheduleProperties + withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) { this.offPeakStartVMOnConnect = offPeakStartVMOnConnect; return this; } @@ -666,7 +649,7 @@ public ScalingPlanPersonalScheduleProperties withOffPeakStartVMOnConnect( /** * Get the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @return the offPeakActionOnDisconnect value. */ public SessionHandlingOperation offPeakActionOnDisconnect() { @@ -676,12 +659,12 @@ public SessionHandlingOperation offPeakActionOnDisconnect() { /** * Set the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @param offPeakActionOnDisconnect the offPeakActionOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withOffPeakActionOnDisconnect( - SessionHandlingOperation offPeakActionOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { this.offPeakActionOnDisconnect = offPeakActionOnDisconnect; return this; } @@ -689,7 +672,7 @@ public ScalingPlanPersonalScheduleProperties withOffPeakActionOnDisconnect( /** * Get the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnDisconnect value. */ public Integer offPeakMinutesToWaitOnDisconnect() { @@ -699,19 +682,19 @@ public Integer offPeakMinutesToWaitOnDisconnect() { /** * Set the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @param offPeakMinutesToWaitOnDisconnect the offPeakMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withOffPeakMinutesToWaitOnDisconnect( - Integer offPeakMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleProperties + withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { this.offPeakMinutesToWaitOnDisconnect = offPeakMinutesToWaitOnDisconnect; return this; } /** * Get the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @return the offPeakActionOnLogoff value. */ public SessionHandlingOperation offPeakActionOnLogoff() { @@ -720,12 +703,12 @@ public SessionHandlingOperation offPeakActionOnLogoff() { /** * Set the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @param offPeakActionOnLogoff the offPeakActionOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withOffPeakActionOnLogoff( - SessionHandlingOperation offPeakActionOnLogoff) { + public ScalingPlanPersonalScheduleProperties + withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) { this.offPeakActionOnLogoff = offPeakActionOnLogoff; return this; } @@ -733,7 +716,7 @@ public ScalingPlanPersonalScheduleProperties withOffPeakActionOnLogoff( /** * Get the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnLogoff value. */ public Integer offPeakMinutesToWaitOnLogoff() { @@ -743,19 +726,19 @@ public Integer offPeakMinutesToWaitOnLogoff() { /** * Set the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @param offPeakMinutesToWaitOnLogoff the offPeakMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalScheduleProperties object itself. */ - public ScalingPlanPersonalScheduleProperties withOffPeakMinutesToWaitOnLogoff( - Integer offPeakMinutesToWaitOnLogoff) { + public ScalingPlanPersonalScheduleProperties + withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) { this.offPeakMinutesToWaitOnLogoff = offPeakMinutesToWaitOnLogoff; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -772,4 +755,152 @@ public void validate() { offPeakStartTime().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpAutoStartHosts", + this.rampUpAutoStartHosts == null ? null : this.rampUpAutoStartHosts.toString()); + jsonWriter.writeStringField("rampUpStartVMOnConnect", + this.rampUpStartVMOnConnect == null ? null : this.rampUpStartVMOnConnect.toString()); + jsonWriter.writeStringField("rampUpActionOnDisconnect", + this.rampUpActionOnDisconnect == null ? null : this.rampUpActionOnDisconnect.toString()); + jsonWriter.writeNumberField("rampUpMinutesToWaitOnDisconnect", this.rampUpMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("rampUpActionOnLogoff", + this.rampUpActionOnLogoff == null ? null : this.rampUpActionOnLogoff.toString()); + jsonWriter.writeNumberField("rampUpMinutesToWaitOnLogoff", this.rampUpMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakStartVMOnConnect", + this.peakStartVMOnConnect == null ? null : this.peakStartVMOnConnect.toString()); + jsonWriter.writeStringField("peakActionOnDisconnect", + this.peakActionOnDisconnect == null ? null : this.peakActionOnDisconnect.toString()); + jsonWriter.writeNumberField("peakMinutesToWaitOnDisconnect", this.peakMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("peakActionOnLogoff", + this.peakActionOnLogoff == null ? null : this.peakActionOnLogoff.toString()); + jsonWriter.writeNumberField("peakMinutesToWaitOnLogoff", this.peakMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownStartVMOnConnect", + this.rampDownStartVMOnConnect == null ? null : this.rampDownStartVMOnConnect.toString()); + jsonWriter.writeStringField("rampDownActionOnDisconnect", + this.rampDownActionOnDisconnect == null ? null : this.rampDownActionOnDisconnect.toString()); + jsonWriter.writeNumberField("rampDownMinutesToWaitOnDisconnect", this.rampDownMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("rampDownActionOnLogoff", + this.rampDownActionOnLogoff == null ? null : this.rampDownActionOnLogoff.toString()); + jsonWriter.writeNumberField("rampDownMinutesToWaitOnLogoff", this.rampDownMinutesToWaitOnLogoff); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakStartVMOnConnect", + this.offPeakStartVMOnConnect == null ? null : this.offPeakStartVMOnConnect.toString()); + jsonWriter.writeStringField("offPeakActionOnDisconnect", + this.offPeakActionOnDisconnect == null ? null : this.offPeakActionOnDisconnect.toString()); + jsonWriter.writeNumberField("offPeakMinutesToWaitOnDisconnect", this.offPeakMinutesToWaitOnDisconnect); + jsonWriter.writeStringField("offPeakActionOnLogoff", + this.offPeakActionOnLogoff == null ? null : this.offPeakActionOnLogoff.toString()); + jsonWriter.writeNumberField("offPeakMinutesToWaitOnLogoff", this.offPeakMinutesToWaitOnLogoff); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPersonalScheduleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPersonalScheduleProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPersonalScheduleProperties. + */ + public static ScalingPlanPersonalScheduleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPersonalScheduleProperties deserializedScalingPlanPersonalScheduleProperties + = new ScalingPlanPersonalScheduleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); + deserializedScalingPlanPersonalScheduleProperties.daysOfWeek = daysOfWeek; + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpAutoStartHosts".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpAutoStartHosts + = StartupBehavior.fromString(reader.getString()); + } else if ("rampUpStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("rampUpActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampUpMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampUpMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampUpMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakStartTime = Time.fromJson(reader); + } else if ("peakStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("peakActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("peakMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("peakActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("peakMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.peakMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("rampDownActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampDownMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("rampDownMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.rampDownMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakStartVMOnConnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakStartVMOnConnect + = SetStartVMOnConnect.fromString(reader.getString()); + } else if ("offPeakActionOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakActionOnDisconnect + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("offPeakMinutesToWaitOnDisconnect".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakMinutesToWaitOnDisconnect + = reader.getNullable(JsonReader::getInt); + } else if ("offPeakActionOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakActionOnLogoff + = SessionHandlingOperation.fromString(reader.getString()); + } else if ("offPeakMinutesToWaitOnLogoff".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleProperties.offPeakMinutesToWaitOnLogoff + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPersonalScheduleProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java index 42558d7dc480..3a4f6eaeaa8c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleInner.java @@ -8,35 +8,64 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Represents a ScalingPlanPooledSchedule definition. */ +/** + * Represents a ScalingPlanPooledSchedule definition. + */ @Fluent public final class ScalingPlanPooledScheduleInner extends ProxyResource { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for ScalingPlanPooledSchedule + */ + private ScalingPlanPooledScheduleProperties innerProperties = new ScalingPlanPooledScheduleProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for ScalingPlanPooledSchedule + * The type of the resource. */ - @JsonProperty(value = "properties", required = true) - private ScalingPlanPooledScheduleProperties innerProperties = new ScalingPlanPooledScheduleProperties(); + private String type; + + /* + * The name of the resource. + */ + private String name; - /** Creates an instance of ScalingPlanPooledScheduleInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ScalingPlanPooledScheduleInner class. + */ public ScalingPlanPooledScheduleInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for ScalingPlanPooledSchedule. + * + * @return the innerProperties value. + */ + private ScalingPlanPooledScheduleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -44,17 +73,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for ScalingPlanPooledSchedule. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private ScalingPlanPooledScheduleProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -63,7 +113,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -77,7 +127,7 @@ public ScalingPlanPooledScheduleInner withDaysOfWeek(List daysOfWeek) /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -86,7 +136,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -100,7 +150,7 @@ public ScalingPlanPooledScheduleInner withRampUpStartTime(Time rampUpStartTime) /** * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @return the rampUpLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { @@ -109,12 +159,12 @@ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { /** * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ - public ScalingPlanPooledScheduleInner withRampUpLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleInner + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -124,7 +174,7 @@ public ScalingPlanPooledScheduleInner withRampUpLoadBalancingAlgorithm( /** * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @return the rampUpMinimumHostsPct value. */ public Integer rampUpMinimumHostsPct() { @@ -133,7 +183,7 @@ public Integer rampUpMinimumHostsPct() { /** * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -147,7 +197,7 @@ public ScalingPlanPooledScheduleInner withRampUpMinimumHostsPct(Integer rampUpMi /** * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @return the rampUpCapacityThresholdPct value. */ public Integer rampUpCapacityThresholdPct() { @@ -156,7 +206,7 @@ public Integer rampUpCapacityThresholdPct() { /** * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -170,7 +220,7 @@ public ScalingPlanPooledScheduleInner withRampUpCapacityThresholdPct(Integer ram /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -179,7 +229,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -193,7 +243,7 @@ public ScalingPlanPooledScheduleInner withPeakStartTime(Time peakStartTime) { /** * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @return the peakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { @@ -202,12 +252,12 @@ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { /** * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ - public ScalingPlanPooledScheduleInner withPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleInner + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -217,7 +267,7 @@ public ScalingPlanPooledScheduleInner withPeakLoadBalancingAlgorithm( /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -226,7 +276,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -240,7 +290,7 @@ public ScalingPlanPooledScheduleInner withRampDownStartTime(Time rampDownStartTi /** * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @return the rampDownLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { @@ -249,12 +299,12 @@ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { /** * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ - public ScalingPlanPooledScheduleInner withRampDownLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleInner + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -264,7 +314,7 @@ public ScalingPlanPooledScheduleInner withRampDownLoadBalancingAlgorithm( /** * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @return the rampDownMinimumHostsPct value. */ public Integer rampDownMinimumHostsPct() { @@ -273,7 +323,7 @@ public Integer rampDownMinimumHostsPct() { /** * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -287,7 +337,7 @@ public ScalingPlanPooledScheduleInner withRampDownMinimumHostsPct(Integer rampDo /** * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @return the rampDownCapacityThresholdPct value. */ public Integer rampDownCapacityThresholdPct() { @@ -296,7 +346,7 @@ public Integer rampDownCapacityThresholdPct() { /** * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -310,7 +360,7 @@ public ScalingPlanPooledScheduleInner withRampDownCapacityThresholdPct(Integer r /** * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @return the rampDownForceLogoffUsers value. */ public Boolean rampDownForceLogoffUsers() { @@ -319,7 +369,7 @@ public Boolean rampDownForceLogoffUsers() { /** * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -333,7 +383,7 @@ public ScalingPlanPooledScheduleInner withRampDownForceLogoffUsers(Boolean rampD /** * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @return the rampDownStopHostsWhen value. */ public StopHostsWhen rampDownStopHostsWhen() { @@ -342,7 +392,7 @@ public StopHostsWhen rampDownStopHostsWhen() { /** * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -356,7 +406,7 @@ public ScalingPlanPooledScheduleInner withRampDownStopHostsWhen(StopHostsWhen ra /** * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @return the rampDownWaitTimeMinutes value. */ public Integer rampDownWaitTimeMinutes() { @@ -365,7 +415,7 @@ public Integer rampDownWaitTimeMinutes() { /** * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -379,7 +429,7 @@ public ScalingPlanPooledScheduleInner withRampDownWaitTimeMinutes(Integer rampDo /** * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @return the rampDownNotificationMessage value. */ public String rampDownNotificationMessage() { @@ -388,7 +438,7 @@ public String rampDownNotificationMessage() { /** * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -402,7 +452,7 @@ public ScalingPlanPooledScheduleInner withRampDownNotificationMessage(String ram /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -411,7 +461,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ @@ -425,7 +475,7 @@ public ScalingPlanPooledScheduleInner withOffPeakStartTime(Time offPeakStartTime /** * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @return the offPeakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { @@ -434,12 +484,12 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { /** * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleInner object itself. */ - public ScalingPlanPooledScheduleInner withOffPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleInner + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -449,19 +499,65 @@ public ScalingPlanPooledScheduleInner withOffPeakLoadBalancingAlgorithm( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ScalingPlanPooledScheduleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ScalingPlanPooledScheduleInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanPooledScheduleInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPooledScheduleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPooledScheduleInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScalingPlanPooledScheduleInner. + */ + public static ScalingPlanPooledScheduleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPooledScheduleInner deserializedScalingPlanPooledScheduleInner + = new ScalingPlanPooledScheduleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScalingPlanPooledScheduleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScalingPlanPooledScheduleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedScalingPlanPooledScheduleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedScalingPlanPooledScheduleInner.innerProperties + = ScalingPlanPooledScheduleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedScalingPlanPooledScheduleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPooledScheduleInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java index 93b650a07c2f..9c4a8262bcc5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanPooledScheduleProperties.java @@ -5,125 +5,117 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A ScalingPlanPooledSchedule. */ +/** + * A ScalingPlanPooledSchedule. + */ @Fluent -public final class ScalingPlanPooledScheduleProperties { +public final class ScalingPlanPooledScheduleProperties + implements JsonSerializable { /* * Set of days of the week on which this schedule is active. */ - @JsonProperty(value = "daysOfWeek") private List daysOfWeek; /* * Starting time for ramp up period. */ - @JsonProperty(value = "rampUpStartTime") private Time rampUpStartTime; /* * Load balancing algorithm for ramp up period. */ - @JsonProperty(value = "rampUpLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm; /* * Minimum host percentage for ramp up period. */ - @JsonProperty(value = "rampUpMinimumHostsPct") private Integer rampUpMinimumHostsPct; /* * Capacity threshold for ramp up period. */ - @JsonProperty(value = "rampUpCapacityThresholdPct") private Integer rampUpCapacityThresholdPct; /* * Starting time for peak period. */ - @JsonProperty(value = "peakStartTime") private Time peakStartTime; /* * Load balancing algorithm for peak period. */ - @JsonProperty(value = "peakLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm; /* * Starting time for ramp down period. */ - @JsonProperty(value = "rampDownStartTime") private Time rampDownStartTime; /* * Load balancing algorithm for ramp down period. */ - @JsonProperty(value = "rampDownLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm; /* * Minimum host percentage for ramp down period. */ - @JsonProperty(value = "rampDownMinimumHostsPct") private Integer rampDownMinimumHostsPct; /* * Capacity threshold for ramp down period. */ - @JsonProperty(value = "rampDownCapacityThresholdPct") private Integer rampDownCapacityThresholdPct; /* * Should users be logged off forcefully from hosts. */ - @JsonProperty(value = "rampDownForceLogoffUsers") private Boolean rampDownForceLogoffUsers; /* * Specifies when to stop hosts during ramp down period. */ - @JsonProperty(value = "rampDownStopHostsWhen") private StopHostsWhen rampDownStopHostsWhen; /* * Number of minutes to wait to stop hosts during ramp down period. */ - @JsonProperty(value = "rampDownWaitTimeMinutes") private Integer rampDownWaitTimeMinutes; /* * Notification message for users during ramp down period. */ - @JsonProperty(value = "rampDownNotificationMessage") private String rampDownNotificationMessage; /* * Starting time for off-peak period. */ - @JsonProperty(value = "offPeakStartTime") private Time offPeakStartTime; /* * Load balancing algorithm for off-peak period. */ - @JsonProperty(value = "offPeakLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm; - /** Creates an instance of ScalingPlanPooledScheduleProperties class. */ + /** + * Creates an instance of ScalingPlanPooledScheduleProperties class. + */ public ScalingPlanPooledScheduleProperties() { } /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -132,7 +124,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -143,7 +135,7 @@ public ScalingPlanPooledScheduleProperties withDaysOfWeek(List daysOf /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -152,7 +144,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -163,7 +155,7 @@ public ScalingPlanPooledScheduleProperties withRampUpStartTime(Time rampUpStartT /** * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @return the rampUpLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { @@ -172,19 +164,19 @@ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { /** * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ - public ScalingPlanPooledScheduleProperties withRampUpLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleProperties + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { this.rampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm; return this; } /** * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @return the rampUpMinimumHostsPct value. */ public Integer rampUpMinimumHostsPct() { @@ -193,7 +185,7 @@ public Integer rampUpMinimumHostsPct() { /** * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -204,7 +196,7 @@ public ScalingPlanPooledScheduleProperties withRampUpMinimumHostsPct(Integer ram /** * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @return the rampUpCapacityThresholdPct value. */ public Integer rampUpCapacityThresholdPct() { @@ -213,7 +205,7 @@ public Integer rampUpCapacityThresholdPct() { /** * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -224,7 +216,7 @@ public ScalingPlanPooledScheduleProperties withRampUpCapacityThresholdPct(Intege /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -233,7 +225,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -244,7 +236,7 @@ public ScalingPlanPooledScheduleProperties withPeakStartTime(Time peakStartTime) /** * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @return the peakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { @@ -253,19 +245,19 @@ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { /** * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ - public ScalingPlanPooledScheduleProperties withPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleProperties + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { this.peakLoadBalancingAlgorithm = peakLoadBalancingAlgorithm; return this; } /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -274,7 +266,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -285,7 +277,7 @@ public ScalingPlanPooledScheduleProperties withRampDownStartTime(Time rampDownSt /** * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @return the rampDownLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { @@ -294,19 +286,19 @@ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { /** * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ - public ScalingPlanPooledScheduleProperties withRampDownLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleProperties + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { this.rampDownLoadBalancingAlgorithm = rampDownLoadBalancingAlgorithm; return this; } /** * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @return the rampDownMinimumHostsPct value. */ public Integer rampDownMinimumHostsPct() { @@ -315,7 +307,7 @@ public Integer rampDownMinimumHostsPct() { /** * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -326,7 +318,7 @@ public ScalingPlanPooledScheduleProperties withRampDownMinimumHostsPct(Integer r /** * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @return the rampDownCapacityThresholdPct value. */ public Integer rampDownCapacityThresholdPct() { @@ -335,7 +327,7 @@ public Integer rampDownCapacityThresholdPct() { /** * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -346,7 +338,7 @@ public ScalingPlanPooledScheduleProperties withRampDownCapacityThresholdPct(Inte /** * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @return the rampDownForceLogoffUsers value. */ public Boolean rampDownForceLogoffUsers() { @@ -355,7 +347,7 @@ public Boolean rampDownForceLogoffUsers() { /** * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -366,7 +358,7 @@ public ScalingPlanPooledScheduleProperties withRampDownForceLogoffUsers(Boolean /** * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @return the rampDownStopHostsWhen value. */ public StopHostsWhen rampDownStopHostsWhen() { @@ -375,7 +367,7 @@ public StopHostsWhen rampDownStopHostsWhen() { /** * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -386,7 +378,7 @@ public ScalingPlanPooledScheduleProperties withRampDownStopHostsWhen(StopHostsWh /** * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @return the rampDownWaitTimeMinutes value. */ public Integer rampDownWaitTimeMinutes() { @@ -395,7 +387,7 @@ public Integer rampDownWaitTimeMinutes() { /** * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -406,7 +398,7 @@ public ScalingPlanPooledScheduleProperties withRampDownWaitTimeMinutes(Integer r /** * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @return the rampDownNotificationMessage value. */ public String rampDownNotificationMessage() { @@ -415,7 +407,7 @@ public String rampDownNotificationMessage() { /** * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -426,7 +418,7 @@ public ScalingPlanPooledScheduleProperties withRampDownNotificationMessage(Strin /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -435,7 +427,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ @@ -446,7 +438,7 @@ public ScalingPlanPooledScheduleProperties withOffPeakStartTime(Time offPeakStar /** * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @return the offPeakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { @@ -455,19 +447,19 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { /** * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledScheduleProperties object itself. */ - public ScalingPlanPooledScheduleProperties withOffPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleProperties + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { this.offPeakLoadBalancingAlgorithm = offPeakLoadBalancingAlgorithm; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -484,4 +476,107 @@ public void validate() { offPeakStartTime().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", + this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampUpMinimumHostsPct", this.rampUpMinimumHostsPct); + jsonWriter.writeNumberField("rampUpCapacityThresholdPct", this.rampUpCapacityThresholdPct); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakLoadBalancingAlgorithm", + this.peakLoadBalancingAlgorithm == null ? null : this.peakLoadBalancingAlgorithm.toString()); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownLoadBalancingAlgorithm", + this.rampDownLoadBalancingAlgorithm == null ? null : this.rampDownLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampDownMinimumHostsPct", this.rampDownMinimumHostsPct); + jsonWriter.writeNumberField("rampDownCapacityThresholdPct", this.rampDownCapacityThresholdPct); + jsonWriter.writeBooleanField("rampDownForceLogoffUsers", this.rampDownForceLogoffUsers); + jsonWriter.writeStringField("rampDownStopHostsWhen", + this.rampDownStopHostsWhen == null ? null : this.rampDownStopHostsWhen.toString()); + jsonWriter.writeNumberField("rampDownWaitTimeMinutes", this.rampDownWaitTimeMinutes); + jsonWriter.writeStringField("rampDownNotificationMessage", this.rampDownNotificationMessage); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakLoadBalancingAlgorithm", + this.offPeakLoadBalancingAlgorithm == null ? null : this.offPeakLoadBalancingAlgorithm.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPooledScheduleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPooledScheduleProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPooledScheduleProperties. + */ + public static ScalingPlanPooledScheduleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPooledScheduleProperties deserializedScalingPlanPooledScheduleProperties + = new ScalingPlanPooledScheduleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); + deserializedScalingPlanPooledScheduleProperties.daysOfWeek = daysOfWeek; + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampUpLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampUpMinimumHostsPct".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampUpMinimumHostsPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampUpCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampUpCapacityThresholdPct + = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.peakStartTime = Time.fromJson(reader); + } else if ("peakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.peakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownMinimumHostsPct".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownMinimumHostsPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownCapacityThresholdPct".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownCapacityThresholdPct + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownForceLogoffUsers".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownForceLogoffUsers + = reader.getNullable(JsonReader::getBoolean); + } else if ("rampDownStopHostsWhen".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownStopHostsWhen + = StopHostsWhen.fromString(reader.getString()); + } else if ("rampDownWaitTimeMinutes".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownWaitTimeMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("rampDownNotificationMessage".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.rampDownNotificationMessage = reader.getString(); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingPlanPooledScheduleProperties.offPeakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPooledScheduleProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java index 73fcf6c87140..f74bbdbdb6b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/ScalingPlanProperties.java @@ -6,70 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference; import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Scaling plan properties. */ +/** + * Scaling plan properties. + */ @Fluent -public final class ScalingPlanProperties { +public final class ScalingPlanProperties implements JsonSerializable { /* * ObjectId of scaling plan. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Description of scaling plan. */ - @JsonProperty(value = "description") private String description; /* * User friendly name of scaling plan. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Timezone of the scaling plan. */ - @JsonProperty(value = "timeZone", required = true) private String timeZone; /* * HostPool type for desktop. */ - @JsonProperty(value = "hostPoolType") private ScalingHostPoolType hostPoolType; /* * Exclusion tag for scaling plan. */ - @JsonProperty(value = "exclusionTag") private String exclusionTag; /* * List of ScalingPlanPooledSchedule definitions. */ - @JsonProperty(value = "schedules") private List schedules; /* * List of ScalingHostPoolReference definitions. */ - @JsonProperty(value = "hostPoolReferences") private List hostPoolReferences; - /** Creates an instance of ScalingPlanProperties class. */ + /** + * Creates an instance of ScalingPlanProperties class. + */ public ScalingPlanProperties() { } /** * Get the objectId property: ObjectId of scaling plan. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -78,7 +78,7 @@ public String objectId() { /** * Get the description property: Description of scaling plan. - * + * * @return the description value. */ public String description() { @@ -87,7 +87,7 @@ public String description() { /** * Set the description property: Description of scaling plan. - * + * * @param description the description value to set. * @return the ScalingPlanProperties object itself. */ @@ -98,7 +98,7 @@ public ScalingPlanProperties withDescription(String description) { /** * Get the friendlyName property: User friendly name of scaling plan. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -107,7 +107,7 @@ public String friendlyName() { /** * Set the friendlyName property: User friendly name of scaling plan. - * + * * @param friendlyName the friendlyName value to set. * @return the ScalingPlanProperties object itself. */ @@ -118,7 +118,7 @@ public ScalingPlanProperties withFriendlyName(String friendlyName) { /** * Get the timeZone property: Timezone of the scaling plan. - * + * * @return the timeZone value. */ public String timeZone() { @@ -127,7 +127,7 @@ public String timeZone() { /** * Set the timeZone property: Timezone of the scaling plan. - * + * * @param timeZone the timeZone value to set. * @return the ScalingPlanProperties object itself. */ @@ -138,7 +138,7 @@ public ScalingPlanProperties withTimeZone(String timeZone) { /** * Get the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ public ScalingHostPoolType hostPoolType() { @@ -147,7 +147,7 @@ public ScalingHostPoolType hostPoolType() { /** * Set the hostPoolType property: HostPool type for desktop. - * + * * @param hostPoolType the hostPoolType value to set. * @return the ScalingPlanProperties object itself. */ @@ -158,7 +158,7 @@ public ScalingPlanProperties withHostPoolType(ScalingHostPoolType hostPoolType) /** * Get the exclusionTag property: Exclusion tag for scaling plan. - * + * * @return the exclusionTag value. */ public String exclusionTag() { @@ -167,7 +167,7 @@ public String exclusionTag() { /** * Set the exclusionTag property: Exclusion tag for scaling plan. - * + * * @param exclusionTag the exclusionTag value to set. * @return the ScalingPlanProperties object itself. */ @@ -178,7 +178,7 @@ public ScalingPlanProperties withExclusionTag(String exclusionTag) { /** * Get the schedules property: List of ScalingPlanPooledSchedule definitions. - * + * * @return the schedules value. */ public List schedules() { @@ -187,7 +187,7 @@ public List schedules() { /** * Set the schedules property: List of ScalingPlanPooledSchedule definitions. - * + * * @param schedules the schedules value to set. * @return the ScalingPlanProperties object itself. */ @@ -198,7 +198,7 @@ public ScalingPlanProperties withSchedules(List schedules) { /** * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @return the hostPoolReferences value. */ public List hostPoolReferences() { @@ -207,7 +207,7 @@ public List hostPoolReferences() { /** * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @param hostPoolReferences the hostPoolReferences value to set. * @return the ScalingPlanProperties object itself. */ @@ -218,14 +218,13 @@ public ScalingPlanProperties withHostPoolReferences(List e.validate()); @@ -236,4 +235,65 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ScalingPlanProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("hostPoolType", this.hostPoolType == null ? null : this.hostPoolType.toString()); + jsonWriter.writeStringField("exclusionTag", this.exclusionTag); + jsonWriter.writeArrayField("schedules", this.schedules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("hostPoolReferences", this.hostPoolReferences, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScalingPlanProperties. + */ + public static ScalingPlanProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanProperties deserializedScalingPlanProperties = new ScalingPlanProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeZone".equals(fieldName)) { + deserializedScalingPlanProperties.timeZone = reader.getString(); + } else if ("objectId".equals(fieldName)) { + deserializedScalingPlanProperties.objectId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedScalingPlanProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedScalingPlanProperties.friendlyName = reader.getString(); + } else if ("hostPoolType".equals(fieldName)) { + deserializedScalingPlanProperties.hostPoolType = ScalingHostPoolType.fromString(reader.getString()); + } else if ("exclusionTag".equals(fieldName)) { + deserializedScalingPlanProperties.exclusionTag = reader.getString(); + } else if ("schedules".equals(fieldName)) { + List schedules = reader.readArray(reader1 -> ScalingSchedule.fromJson(reader1)); + deserializedScalingPlanProperties.schedules = schedules; + } else if ("hostPoolReferences".equals(fieldName)) { + List hostPoolReferences + = reader.readArray(reader1 -> ScalingHostPoolReference.fromJson(reader1)); + deserializedScalingPlanProperties.hostPoolReferences = hostPoolReferences; + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java index fa94341d807a..700013657574 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostInner.java @@ -7,35 +7,64 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport; import com.azure.resourcemanager.desktopvirtualization.models.Status; import com.azure.resourcemanager.desktopvirtualization.models.UpdateState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** Represents a SessionHost definition. */ +/** + * Represents a SessionHost definition. + */ @Fluent public final class SessionHostInner extends ProxyResource { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for SessionHost + */ + private SessionHostProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for SessionHost + * The type of the resource. */ - @JsonProperty(value = "properties") - private SessionHostProperties innerProperties; + private String type; - /** Creates an instance of SessionHostInner class. */ + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SessionHostInner class. + */ public SessionHostInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for SessionHost. + * + * @return the innerProperties value. + */ + private SessionHostProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -43,17 +72,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for SessionHost. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private SessionHostProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the objectId property: ObjectId of SessionHost. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -62,7 +112,7 @@ public String objectId() { /** * Get the lastHeartBeat property: Last heart beat from SessionHost. - * + * * @return the lastHeartBeat value. */ public OffsetDateTime lastHeartBeat() { @@ -71,7 +121,7 @@ public OffsetDateTime lastHeartBeat() { /** * Set the lastHeartBeat property: Last heart beat from SessionHost. - * + * * @param lastHeartBeat the lastHeartBeat value to set. * @return the SessionHostInner object itself. */ @@ -85,7 +135,7 @@ public SessionHostInner withLastHeartBeat(OffsetDateTime lastHeartBeat) { /** * Get the sessions property: Number of sessions on SessionHost. - * + * * @return the sessions value. */ public Integer sessions() { @@ -94,7 +144,7 @@ public Integer sessions() { /** * Set the sessions property: Number of sessions on SessionHost. - * + * * @param sessions the sessions value to set. * @return the SessionHostInner object itself. */ @@ -108,7 +158,7 @@ public SessionHostInner withSessions(Integer sessions) { /** * Get the agentVersion property: Version of agent on SessionHost. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -117,7 +167,7 @@ public String agentVersion() { /** * Set the agentVersion property: Version of agent on SessionHost. - * + * * @param agentVersion the agentVersion value to set. * @return the SessionHostInner object itself. */ @@ -131,7 +181,7 @@ public SessionHostInner withAgentVersion(String agentVersion) { /** * Get the allowNewSession property: Allow a new session. - * + * * @return the allowNewSession value. */ public Boolean allowNewSession() { @@ -140,7 +190,7 @@ public Boolean allowNewSession() { /** * Set the allowNewSession property: Allow a new session. - * + * * @param allowNewSession the allowNewSession value to set. * @return the SessionHostInner object itself. */ @@ -154,7 +204,7 @@ public SessionHostInner withAllowNewSession(Boolean allowNewSession) { /** * Get the virtualMachineId property: Virtual Machine Id of SessionHost's underlying virtual machine. - * + * * @return the virtualMachineId value. */ public String virtualMachineId() { @@ -163,7 +213,7 @@ public String virtualMachineId() { /** * Get the resourceId property: Resource Id of SessionHost's underlying virtual machine. - * + * * @return the resourceId value. */ public String resourceId() { @@ -172,7 +222,7 @@ public String resourceId() { /** * Get the assignedUser property: User assigned to SessionHost. - * + * * @return the assignedUser value. */ public String assignedUser() { @@ -181,7 +231,7 @@ public String assignedUser() { /** * Set the assignedUser property: User assigned to SessionHost. - * + * * @param assignedUser the assignedUser value to set. * @return the SessionHostInner object itself. */ @@ -195,7 +245,7 @@ public SessionHostInner withAssignedUser(String assignedUser) { /** * Get the friendlyName property: Friendly name of SessionHost. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -204,7 +254,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of SessionHost. - * + * * @param friendlyName the friendlyName value to set. * @return the SessionHostInner object itself. */ @@ -218,7 +268,7 @@ public SessionHostInner withFriendlyName(String friendlyName) { /** * Get the status property: Status for a SessionHost. - * + * * @return the status value. */ public Status status() { @@ -227,7 +277,7 @@ public Status status() { /** * Set the status property: Status for a SessionHost. - * + * * @param status the status value to set. * @return the SessionHostInner object itself. */ @@ -241,7 +291,7 @@ public SessionHostInner withStatus(Status status) { /** * Get the statusTimestamp property: The timestamp of the status. - * + * * @return the statusTimestamp value. */ public OffsetDateTime statusTimestamp() { @@ -250,7 +300,7 @@ public OffsetDateTime statusTimestamp() { /** * Get the osVersion property: The version of the OS on the session host. - * + * * @return the osVersion value. */ public String osVersion() { @@ -259,7 +309,7 @@ public String osVersion() { /** * Set the osVersion property: The version of the OS on the session host. - * + * * @param osVersion the osVersion value to set. * @return the SessionHostInner object itself. */ @@ -273,7 +323,7 @@ public SessionHostInner withOsVersion(String osVersion) { /** * Get the sxSStackVersion property: The version of the side by side stack on the session host. - * + * * @return the sxSStackVersion value. */ public String sxSStackVersion() { @@ -282,7 +332,7 @@ public String sxSStackVersion() { /** * Set the sxSStackVersion property: The version of the side by side stack on the session host. - * + * * @param sxSStackVersion the sxSStackVersion value to set. * @return the SessionHostInner object itself. */ @@ -296,7 +346,7 @@ public SessionHostInner withSxSStackVersion(String sxSStackVersion) { /** * Get the updateState property: Update state of a SessionHost. - * + * * @return the updateState value. */ public UpdateState updateState() { @@ -305,7 +355,7 @@ public UpdateState updateState() { /** * Set the updateState property: Update state of a SessionHost. - * + * * @param updateState the updateState value to set. * @return the SessionHostInner object itself. */ @@ -319,7 +369,7 @@ public SessionHostInner withUpdateState(UpdateState updateState) { /** * Get the lastUpdateTime property: The timestamp of the last update. - * + * * @return the lastUpdateTime value. */ public OffsetDateTime lastUpdateTime() { @@ -328,7 +378,7 @@ public OffsetDateTime lastUpdateTime() { /** * Get the updateErrorMessage property: The error message. - * + * * @return the updateErrorMessage value. */ public String updateErrorMessage() { @@ -337,7 +387,7 @@ public String updateErrorMessage() { /** * Set the updateErrorMessage property: The error message. - * + * * @param updateErrorMessage the updateErrorMessage value to set. * @return the SessionHostInner object itself. */ @@ -351,7 +401,7 @@ public SessionHostInner withUpdateErrorMessage(String updateErrorMessage) { /** * Get the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. - * + * * @return the sessionHostHealthCheckResults value. */ public List sessionHostHealthCheckResults() { @@ -360,7 +410,7 @@ public List sessionHostHealthCheckResults() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -368,4 +418,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SessionHostInner. + */ + public static SessionHostInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostInner deserializedSessionHostInner = new SessionHostInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSessionHostInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionHostInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSessionHostInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSessionHostInner.innerProperties = SessionHostProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSessionHostInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java index 9a71b1b6ab2a..662ac2a2511c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostPatchProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** SessionHost properties that can be patched. */ +/** + * SessionHost properties that can be patched. + */ @Fluent -public final class SessionHostPatchProperties { +public final class SessionHostPatchProperties implements JsonSerializable { /* * Allow a new session. */ - @JsonProperty(value = "allowNewSession") private Boolean allowNewSession; /* * User assigned to SessionHost. */ - @JsonProperty(value = "assignedUser") private String assignedUser; /* * Friendly name of SessionHost */ - @JsonProperty(value = "friendlyName") private String friendlyName; - /** Creates an instance of SessionHostPatchProperties class. */ + /** + * Creates an instance of SessionHostPatchProperties class. + */ public SessionHostPatchProperties() { } /** * Get the allowNewSession property: Allow a new session. - * + * * @return the allowNewSession value. */ public Boolean allowNewSession() { @@ -43,7 +48,7 @@ public Boolean allowNewSession() { /** * Set the allowNewSession property: Allow a new session. - * + * * @param allowNewSession the allowNewSession value to set. * @return the SessionHostPatchProperties object itself. */ @@ -54,7 +59,7 @@ public SessionHostPatchProperties withAllowNewSession(Boolean allowNewSession) { /** * Get the assignedUser property: User assigned to SessionHost. - * + * * @return the assignedUser value. */ public String assignedUser() { @@ -63,7 +68,7 @@ public String assignedUser() { /** * Set the assignedUser property: User assigned to SessionHost. - * + * * @param assignedUser the assignedUser value to set. * @return the SessionHostPatchProperties object itself. */ @@ -74,7 +79,7 @@ public SessionHostPatchProperties withAssignedUser(String assignedUser) { /** * Get the friendlyName property: Friendly name of SessionHost. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -83,7 +88,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of SessionHost. - * + * * @param friendlyName the friendlyName value to set. * @return the SessionHostPatchProperties object itself. */ @@ -94,9 +99,51 @@ public SessionHostPatchProperties withFriendlyName(String friendlyName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowNewSession", this.allowNewSession); + jsonWriter.writeStringField("assignedUser", this.assignedUser); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostPatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionHostPatchProperties. + */ + public static SessionHostPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostPatchProperties deserializedSessionHostPatchProperties = new SessionHostPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowNewSession".equals(fieldName)) { + deserializedSessionHostPatchProperties.allowNewSession = reader.getNullable(JsonReader::getBoolean); + } else if ("assignedUser".equals(fieldName)) { + deserializedSessionHostPatchProperties.assignedUser = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedSessionHostPatchProperties.friendlyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java index e59277002883..fae62d39ef12 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/SessionHostProperties.java @@ -5,125 +5,118 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport; import com.azure.resourcemanager.desktopvirtualization.models.Status; import com.azure.resourcemanager.desktopvirtualization.models.UpdateState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; -/** Schema for SessionHost properties. */ +/** + * Schema for SessionHost properties. + */ @Fluent -public final class SessionHostProperties { +public final class SessionHostProperties implements JsonSerializable { /* * ObjectId of SessionHost. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Last heart beat from SessionHost. */ - @JsonProperty(value = "lastHeartBeat") private OffsetDateTime lastHeartBeat; /* * Number of sessions on SessionHost. */ - @JsonProperty(value = "sessions") private Integer sessions; /* * Version of agent on SessionHost. */ - @JsonProperty(value = "agentVersion") private String agentVersion; /* * Allow a new session. */ - @JsonProperty(value = "allowNewSession") private Boolean allowNewSession; /* * Virtual Machine Id of SessionHost's underlying virtual machine. */ - @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) private String virtualMachineId; /* * Resource Id of SessionHost's underlying virtual machine. */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) private String resourceId; /* * User assigned to SessionHost. */ - @JsonProperty(value = "assignedUser") private String assignedUser; /* * Friendly name of SessionHost */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * Status for a SessionHost. */ - @JsonProperty(value = "status") private Status status; /* * The timestamp of the status. */ - @JsonProperty(value = "statusTimestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime statusTimestamp; /* * The version of the OS on the session host. */ - @JsonProperty(value = "osVersion") private String osVersion; /* * The version of the side by side stack on the session host. */ - @JsonProperty(value = "sxSStackVersion") private String sxSStackVersion; /* * Update state of a SessionHost. */ - @JsonProperty(value = "updateState") private UpdateState updateState; /* * The timestamp of the last update. */ - @JsonProperty(value = "lastUpdateTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdateTime; /* * The error message. */ - @JsonProperty(value = "updateErrorMessage") private String updateErrorMessage; /* * List of SessionHostHealthCheckReports */ - @JsonProperty(value = "sessionHostHealthCheckResults", access = JsonProperty.Access.WRITE_ONLY) private List sessionHostHealthCheckResults; - /** Creates an instance of SessionHostProperties class. */ + /** + * Creates an instance of SessionHostProperties class. + */ public SessionHostProperties() { } /** * Get the objectId property: ObjectId of SessionHost. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -132,7 +125,7 @@ public String objectId() { /** * Get the lastHeartBeat property: Last heart beat from SessionHost. - * + * * @return the lastHeartBeat value. */ public OffsetDateTime lastHeartBeat() { @@ -141,7 +134,7 @@ public OffsetDateTime lastHeartBeat() { /** * Set the lastHeartBeat property: Last heart beat from SessionHost. - * + * * @param lastHeartBeat the lastHeartBeat value to set. * @return the SessionHostProperties object itself. */ @@ -152,7 +145,7 @@ public SessionHostProperties withLastHeartBeat(OffsetDateTime lastHeartBeat) { /** * Get the sessions property: Number of sessions on SessionHost. - * + * * @return the sessions value. */ public Integer sessions() { @@ -161,7 +154,7 @@ public Integer sessions() { /** * Set the sessions property: Number of sessions on SessionHost. - * + * * @param sessions the sessions value to set. * @return the SessionHostProperties object itself. */ @@ -172,7 +165,7 @@ public SessionHostProperties withSessions(Integer sessions) { /** * Get the agentVersion property: Version of agent on SessionHost. - * + * * @return the agentVersion value. */ public String agentVersion() { @@ -181,7 +174,7 @@ public String agentVersion() { /** * Set the agentVersion property: Version of agent on SessionHost. - * + * * @param agentVersion the agentVersion value to set. * @return the SessionHostProperties object itself. */ @@ -192,7 +185,7 @@ public SessionHostProperties withAgentVersion(String agentVersion) { /** * Get the allowNewSession property: Allow a new session. - * + * * @return the allowNewSession value. */ public Boolean allowNewSession() { @@ -201,7 +194,7 @@ public Boolean allowNewSession() { /** * Set the allowNewSession property: Allow a new session. - * + * * @param allowNewSession the allowNewSession value to set. * @return the SessionHostProperties object itself. */ @@ -212,7 +205,7 @@ public SessionHostProperties withAllowNewSession(Boolean allowNewSession) { /** * Get the virtualMachineId property: Virtual Machine Id of SessionHost's underlying virtual machine. - * + * * @return the virtualMachineId value. */ public String virtualMachineId() { @@ -221,7 +214,7 @@ public String virtualMachineId() { /** * Get the resourceId property: Resource Id of SessionHost's underlying virtual machine. - * + * * @return the resourceId value. */ public String resourceId() { @@ -230,7 +223,7 @@ public String resourceId() { /** * Get the assignedUser property: User assigned to SessionHost. - * + * * @return the assignedUser value. */ public String assignedUser() { @@ -239,7 +232,7 @@ public String assignedUser() { /** * Set the assignedUser property: User assigned to SessionHost. - * + * * @param assignedUser the assignedUser value to set. * @return the SessionHostProperties object itself. */ @@ -250,7 +243,7 @@ public SessionHostProperties withAssignedUser(String assignedUser) { /** * Get the friendlyName property: Friendly name of SessionHost. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -259,7 +252,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of SessionHost. - * + * * @param friendlyName the friendlyName value to set. * @return the SessionHostProperties object itself. */ @@ -270,7 +263,7 @@ public SessionHostProperties withFriendlyName(String friendlyName) { /** * Get the status property: Status for a SessionHost. - * + * * @return the status value. */ public Status status() { @@ -279,7 +272,7 @@ public Status status() { /** * Set the status property: Status for a SessionHost. - * + * * @param status the status value to set. * @return the SessionHostProperties object itself. */ @@ -290,7 +283,7 @@ public SessionHostProperties withStatus(Status status) { /** * Get the statusTimestamp property: The timestamp of the status. - * + * * @return the statusTimestamp value. */ public OffsetDateTime statusTimestamp() { @@ -299,7 +292,7 @@ public OffsetDateTime statusTimestamp() { /** * Get the osVersion property: The version of the OS on the session host. - * + * * @return the osVersion value. */ public String osVersion() { @@ -308,7 +301,7 @@ public String osVersion() { /** * Set the osVersion property: The version of the OS on the session host. - * + * * @param osVersion the osVersion value to set. * @return the SessionHostProperties object itself. */ @@ -319,7 +312,7 @@ public SessionHostProperties withOsVersion(String osVersion) { /** * Get the sxSStackVersion property: The version of the side by side stack on the session host. - * + * * @return the sxSStackVersion value. */ public String sxSStackVersion() { @@ -328,7 +321,7 @@ public String sxSStackVersion() { /** * Set the sxSStackVersion property: The version of the side by side stack on the session host. - * + * * @param sxSStackVersion the sxSStackVersion value to set. * @return the SessionHostProperties object itself. */ @@ -339,7 +332,7 @@ public SessionHostProperties withSxSStackVersion(String sxSStackVersion) { /** * Get the updateState property: Update state of a SessionHost. - * + * * @return the updateState value. */ public UpdateState updateState() { @@ -348,7 +341,7 @@ public UpdateState updateState() { /** * Set the updateState property: Update state of a SessionHost. - * + * * @param updateState the updateState value to set. * @return the SessionHostProperties object itself. */ @@ -359,7 +352,7 @@ public SessionHostProperties withUpdateState(UpdateState updateState) { /** * Get the lastUpdateTime property: The timestamp of the last update. - * + * * @return the lastUpdateTime value. */ public OffsetDateTime lastUpdateTime() { @@ -368,7 +361,7 @@ public OffsetDateTime lastUpdateTime() { /** * Get the updateErrorMessage property: The error message. - * + * * @return the updateErrorMessage value. */ public String updateErrorMessage() { @@ -377,7 +370,7 @@ public String updateErrorMessage() { /** * Set the updateErrorMessage property: The error message. - * + * * @param updateErrorMessage the updateErrorMessage value to set. * @return the SessionHostProperties object itself. */ @@ -388,7 +381,7 @@ public SessionHostProperties withUpdateErrorMessage(String updateErrorMessage) { /** * Get the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. - * + * * @return the sessionHostHealthCheckResults value. */ public List sessionHostHealthCheckResults() { @@ -397,7 +390,7 @@ public List sessionHostHealthCheckResults() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -405,4 +398,88 @@ public void validate() { sessionHostHealthCheckResults().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastHeartBeat", + this.lastHeartBeat == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastHeartBeat)); + jsonWriter.writeNumberField("sessions", this.sessions); + jsonWriter.writeStringField("agentVersion", this.agentVersion); + jsonWriter.writeBooleanField("allowNewSession", this.allowNewSession); + jsonWriter.writeStringField("assignedUser", this.assignedUser); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("osVersion", this.osVersion); + jsonWriter.writeStringField("sxSStackVersion", this.sxSStackVersion); + jsonWriter.writeStringField("updateState", this.updateState == null ? null : this.updateState.toString()); + jsonWriter.writeStringField("updateErrorMessage", this.updateErrorMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionHostProperties. + */ + public static SessionHostProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostProperties deserializedSessionHostProperties = new SessionHostProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectId".equals(fieldName)) { + deserializedSessionHostProperties.objectId = reader.getString(); + } else if ("lastHeartBeat".equals(fieldName)) { + deserializedSessionHostProperties.lastHeartBeat = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sessions".equals(fieldName)) { + deserializedSessionHostProperties.sessions = reader.getNullable(JsonReader::getInt); + } else if ("agentVersion".equals(fieldName)) { + deserializedSessionHostProperties.agentVersion = reader.getString(); + } else if ("allowNewSession".equals(fieldName)) { + deserializedSessionHostProperties.allowNewSession = reader.getNullable(JsonReader::getBoolean); + } else if ("virtualMachineId".equals(fieldName)) { + deserializedSessionHostProperties.virtualMachineId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedSessionHostProperties.resourceId = reader.getString(); + } else if ("assignedUser".equals(fieldName)) { + deserializedSessionHostProperties.assignedUser = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedSessionHostProperties.friendlyName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSessionHostProperties.status = Status.fromString(reader.getString()); + } else if ("statusTimestamp".equals(fieldName)) { + deserializedSessionHostProperties.statusTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("osVersion".equals(fieldName)) { + deserializedSessionHostProperties.osVersion = reader.getString(); + } else if ("sxSStackVersion".equals(fieldName)) { + deserializedSessionHostProperties.sxSStackVersion = reader.getString(); + } else if ("updateState".equals(fieldName)) { + deserializedSessionHostProperties.updateState = UpdateState.fromString(reader.getString()); + } else if ("lastUpdateTime".equals(fieldName)) { + deserializedSessionHostProperties.lastUpdateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updateErrorMessage".equals(fieldName)) { + deserializedSessionHostProperties.updateErrorMessage = reader.getString(); + } else if ("sessionHostHealthCheckResults".equals(fieldName)) { + List sessionHostHealthCheckResults + = reader.readArray(reader1 -> SessionHostHealthCheckReport.fromJson(reader1)); + deserializedSessionHostProperties.sessionHostHealthCheckResults = sessionHostHealthCheckResults; + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java index 7e6345c2bab5..ea4281357070 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemInner.java @@ -6,33 +6,99 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Represents a StartMenuItem definition. */ +/** + * Represents a StartMenuItem definition. + */ @Fluent public final class StartMenuItemInner extends ProxyResource { /* * Detailed properties for StartMenuItem */ - @JsonProperty(value = "properties") private StartMenuItemProperties innerProperties; - /** Creates an instance of StartMenuItemInner class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of StartMenuItemInner class. + */ public StartMenuItemInner() { } /** * Get the innerProperties property: Detailed properties for StartMenuItem. - * + * * @return the innerProperties value. */ private StartMenuItemProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the appAlias property: Alias of StartMenuItem. - * + * * @return the appAlias value. */ public String appAlias() { @@ -41,7 +107,7 @@ public String appAlias() { /** * Set the appAlias property: Alias of StartMenuItem. - * + * * @param appAlias the appAlias value to set. * @return the StartMenuItemInner object itself. */ @@ -55,7 +121,7 @@ public StartMenuItemInner withAppAlias(String appAlias) { /** * Get the filePath property: Path to the file of StartMenuItem. - * + * * @return the filePath value. */ public String filePath() { @@ -64,7 +130,7 @@ public String filePath() { /** * Set the filePath property: Path to the file of StartMenuItem. - * + * * @param filePath the filePath value to set. * @return the StartMenuItemInner object itself. */ @@ -78,7 +144,7 @@ public StartMenuItemInner withFilePath(String filePath) { /** * Get the commandLineArguments property: Command line arguments for StartMenuItem. - * + * * @return the commandLineArguments value. */ public String commandLineArguments() { @@ -87,7 +153,7 @@ public String commandLineArguments() { /** * Set the commandLineArguments property: Command line arguments for StartMenuItem. - * + * * @param commandLineArguments the commandLineArguments value to set. * @return the StartMenuItemInner object itself. */ @@ -101,7 +167,7 @@ public StartMenuItemInner withCommandLineArguments(String commandLineArguments) /** * Get the iconPath property: Path to the icon. - * + * * @return the iconPath value. */ public String iconPath() { @@ -110,7 +176,7 @@ public String iconPath() { /** * Set the iconPath property: Path to the icon. - * + * * @param iconPath the iconPath value to set. * @return the StartMenuItemInner object itself. */ @@ -124,7 +190,7 @@ public StartMenuItemInner withIconPath(String iconPath) { /** * Get the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ public Integer iconIndex() { @@ -133,7 +199,7 @@ public Integer iconIndex() { /** * Set the iconIndex property: Index of the icon. - * + * * @param iconIndex the iconIndex value to set. * @return the StartMenuItemInner object itself. */ @@ -147,7 +213,7 @@ public StartMenuItemInner withIconIndex(Integer iconIndex) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -155,4 +221,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StartMenuItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StartMenuItemInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StartMenuItemInner. + */ + public static StartMenuItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StartMenuItemInner deserializedStartMenuItemInner = new StartMenuItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStartMenuItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStartMenuItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStartMenuItemInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStartMenuItemInner.innerProperties = StartMenuItemProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedStartMenuItemInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStartMenuItemInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java index 6ae58ea60c2f..852802ab2642 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/StartMenuItemProperties.java @@ -5,48 +5,51 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Schema for StartMenuItem properties. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Schema for StartMenuItem properties. + */ @Fluent -public final class StartMenuItemProperties { +public final class StartMenuItemProperties implements JsonSerializable { /* * Alias of StartMenuItem. */ - @JsonProperty(value = "appAlias") private String appAlias; /* * Path to the file of StartMenuItem. */ - @JsonProperty(value = "filePath") private String filePath; /* * Command line arguments for StartMenuItem. */ - @JsonProperty(value = "commandLineArguments") private String commandLineArguments; /* * Path to the icon. */ - @JsonProperty(value = "iconPath") private String iconPath; /* * Index of the icon. */ - @JsonProperty(value = "iconIndex") private Integer iconIndex; - /** Creates an instance of StartMenuItemProperties class. */ + /** + * Creates an instance of StartMenuItemProperties class. + */ public StartMenuItemProperties() { } /** * Get the appAlias property: Alias of StartMenuItem. - * + * * @return the appAlias value. */ public String appAlias() { @@ -55,7 +58,7 @@ public String appAlias() { /** * Set the appAlias property: Alias of StartMenuItem. - * + * * @param appAlias the appAlias value to set. * @return the StartMenuItemProperties object itself. */ @@ -66,7 +69,7 @@ public StartMenuItemProperties withAppAlias(String appAlias) { /** * Get the filePath property: Path to the file of StartMenuItem. - * + * * @return the filePath value. */ public String filePath() { @@ -75,7 +78,7 @@ public String filePath() { /** * Set the filePath property: Path to the file of StartMenuItem. - * + * * @param filePath the filePath value to set. * @return the StartMenuItemProperties object itself. */ @@ -86,7 +89,7 @@ public StartMenuItemProperties withFilePath(String filePath) { /** * Get the commandLineArguments property: Command line arguments for StartMenuItem. - * + * * @return the commandLineArguments value. */ public String commandLineArguments() { @@ -95,7 +98,7 @@ public String commandLineArguments() { /** * Set the commandLineArguments property: Command line arguments for StartMenuItem. - * + * * @param commandLineArguments the commandLineArguments value to set. * @return the StartMenuItemProperties object itself. */ @@ -106,7 +109,7 @@ public StartMenuItemProperties withCommandLineArguments(String commandLineArgume /** * Get the iconPath property: Path to the icon. - * + * * @return the iconPath value. */ public String iconPath() { @@ -115,7 +118,7 @@ public String iconPath() { /** * Set the iconPath property: Path to the icon. - * + * * @param iconPath the iconPath value to set. * @return the StartMenuItemProperties object itself. */ @@ -126,7 +129,7 @@ public StartMenuItemProperties withIconPath(String iconPath) { /** * Get the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ public Integer iconIndex() { @@ -135,7 +138,7 @@ public Integer iconIndex() { /** * Set the iconIndex property: Index of the icon. - * + * * @param iconIndex the iconIndex value to set. * @return the StartMenuItemProperties object itself. */ @@ -146,9 +149,57 @@ public StartMenuItemProperties withIconIndex(Integer iconIndex) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appAlias", this.appAlias); + jsonWriter.writeStringField("filePath", this.filePath); + jsonWriter.writeStringField("commandLineArguments", this.commandLineArguments); + jsonWriter.writeStringField("iconPath", this.iconPath); + jsonWriter.writeNumberField("iconIndex", this.iconIndex); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StartMenuItemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StartMenuItemProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StartMenuItemProperties. + */ + public static StartMenuItemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StartMenuItemProperties deserializedStartMenuItemProperties = new StartMenuItemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appAlias".equals(fieldName)) { + deserializedStartMenuItemProperties.appAlias = reader.getString(); + } else if ("filePath".equals(fieldName)) { + deserializedStartMenuItemProperties.filePath = reader.getString(); + } else if ("commandLineArguments".equals(fieldName)) { + deserializedStartMenuItemProperties.commandLineArguments = reader.getString(); + } else if ("iconPath".equals(fieldName)) { + deserializedStartMenuItemProperties.iconPath = reader.getString(); + } else if ("iconIndex".equals(fieldName)) { + deserializedStartMenuItemProperties.iconIndex = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedStartMenuItemProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java index 2246919d2539..ddac38af2a37 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionInner.java @@ -7,33 +7,62 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; -/** Represents a UserSession definition. */ +/** + * Represents a UserSession definition. + */ @Fluent public final class UserSessionInner extends ProxyResource { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for UserSession + */ + private UserSessionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for UserSession + * The type of the resource. */ - @JsonProperty(value = "properties") - private UserSessionProperties innerProperties; + private String type; + + /* + * The name of the resource. + */ + private String name; - /** Creates an instance of UserSessionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of UserSessionInner class. + */ public UserSessionInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for UserSession. + * + * @return the innerProperties value. + */ + private UserSessionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -41,17 +70,38 @@ public SystemData systemData() { } /** - * Get the innerProperties property: Detailed properties for UserSession. - * - * @return the innerProperties value. + * Get the type property: The type of the resource. + * + * @return the type value. */ - private UserSessionProperties innerProperties() { - return this.innerProperties; + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** * Get the objectId property: ObjectId of user session. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -60,7 +110,7 @@ public String objectId() { /** * Get the userPrincipalName property: The user principal name. - * + * * @return the userPrincipalName value. */ public String userPrincipalName() { @@ -69,7 +119,7 @@ public String userPrincipalName() { /** * Set the userPrincipalName property: The user principal name. - * + * * @param userPrincipalName the userPrincipalName value to set. * @return the UserSessionInner object itself. */ @@ -83,7 +133,7 @@ public UserSessionInner withUserPrincipalName(String userPrincipalName) { /** * Get the applicationType property: Application type of application. - * + * * @return the applicationType value. */ public ApplicationType applicationType() { @@ -92,7 +142,7 @@ public ApplicationType applicationType() { /** * Set the applicationType property: Application type of application. - * + * * @param applicationType the applicationType value to set. * @return the UserSessionInner object itself. */ @@ -106,7 +156,7 @@ public UserSessionInner withApplicationType(ApplicationType applicationType) { /** * Get the sessionState property: State of user session. - * + * * @return the sessionState value. */ public SessionState sessionState() { @@ -115,7 +165,7 @@ public SessionState sessionState() { /** * Set the sessionState property: State of user session. - * + * * @param sessionState the sessionState value to set. * @return the UserSessionInner object itself. */ @@ -129,7 +179,7 @@ public UserSessionInner withSessionState(SessionState sessionState) { /** * Get the activeDirectoryUsername property: The active directory user name. - * + * * @return the activeDirectoryUsername value. */ public String activeDirectoryUsername() { @@ -138,7 +188,7 @@ public String activeDirectoryUsername() { /** * Set the activeDirectoryUsername property: The active directory user name. - * + * * @param activeDirectoryUsername the activeDirectoryUsername value to set. * @return the UserSessionInner object itself. */ @@ -152,7 +202,7 @@ public UserSessionInner withActiveDirectoryUsername(String activeDirectoryUserna /** * Get the createTime property: The timestamp of the user session create. - * + * * @return the createTime value. */ public OffsetDateTime createTime() { @@ -161,7 +211,7 @@ public OffsetDateTime createTime() { /** * Set the createTime property: The timestamp of the user session create. - * + * * @param createTime the createTime value to set. * @return the UserSessionInner object itself. */ @@ -175,7 +225,7 @@ public UserSessionInner withCreateTime(OffsetDateTime createTime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -183,4 +233,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserSessionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserSessionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UserSessionInner. + */ + public static UserSessionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserSessionInner deserializedUserSessionInner = new UserSessionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUserSessionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUserSessionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUserSessionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedUserSessionInner.innerProperties = UserSessionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedUserSessionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUserSessionInner; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java index 925653d0fdf5..836ffc197615 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/UserSessionProperties.java @@ -5,57 +5,61 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; import com.azure.resourcemanager.desktopvirtualization.models.SessionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** Schema for UserSession properties. */ +/** + * Schema for UserSession properties. + */ @Fluent -public final class UserSessionProperties { +public final class UserSessionProperties implements JsonSerializable { /* * ObjectId of user session. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * The user principal name. */ - @JsonProperty(value = "userPrincipalName") private String userPrincipalName; /* * Application type of application. */ - @JsonProperty(value = "applicationType") private ApplicationType applicationType; /* * State of user session. */ - @JsonProperty(value = "sessionState") private SessionState sessionState; /* * The active directory user name. */ - @JsonProperty(value = "activeDirectoryUserName") private String activeDirectoryUsername; /* * The timestamp of the user session create. */ - @JsonProperty(value = "createTime") private OffsetDateTime createTime; - /** Creates an instance of UserSessionProperties class. */ + /** + * Creates an instance of UserSessionProperties class. + */ public UserSessionProperties() { } /** * Get the objectId property: ObjectId of user session. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -64,7 +68,7 @@ public String objectId() { /** * Get the userPrincipalName property: The user principal name. - * + * * @return the userPrincipalName value. */ public String userPrincipalName() { @@ -73,7 +77,7 @@ public String userPrincipalName() { /** * Set the userPrincipalName property: The user principal name. - * + * * @param userPrincipalName the userPrincipalName value to set. * @return the UserSessionProperties object itself. */ @@ -84,7 +88,7 @@ public UserSessionProperties withUserPrincipalName(String userPrincipalName) { /** * Get the applicationType property: Application type of application. - * + * * @return the applicationType value. */ public ApplicationType applicationType() { @@ -93,7 +97,7 @@ public ApplicationType applicationType() { /** * Set the applicationType property: Application type of application. - * + * * @param applicationType the applicationType value to set. * @return the UserSessionProperties object itself. */ @@ -104,7 +108,7 @@ public UserSessionProperties withApplicationType(ApplicationType applicationType /** * Get the sessionState property: State of user session. - * + * * @return the sessionState value. */ public SessionState sessionState() { @@ -113,7 +117,7 @@ public SessionState sessionState() { /** * Set the sessionState property: State of user session. - * + * * @param sessionState the sessionState value to set. * @return the UserSessionProperties object itself. */ @@ -124,7 +128,7 @@ public UserSessionProperties withSessionState(SessionState sessionState) { /** * Get the activeDirectoryUsername property: The active directory user name. - * + * * @return the activeDirectoryUsername value. */ public String activeDirectoryUsername() { @@ -133,7 +137,7 @@ public String activeDirectoryUsername() { /** * Set the activeDirectoryUsername property: The active directory user name. - * + * * @param activeDirectoryUsername the activeDirectoryUsername value to set. * @return the UserSessionProperties object itself. */ @@ -144,7 +148,7 @@ public UserSessionProperties withActiveDirectoryUsername(String activeDirectoryU /** * Get the createTime property: The timestamp of the user session create. - * + * * @return the createTime value. */ public OffsetDateTime createTime() { @@ -153,7 +157,7 @@ public OffsetDateTime createTime() { /** * Set the createTime property: The timestamp of the user session create. - * + * * @param createTime the createTime value to set. * @return the UserSessionProperties object itself. */ @@ -164,9 +168,62 @@ public UserSessionProperties withCreateTime(OffsetDateTime createTime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + jsonWriter.writeStringField("applicationType", + this.applicationType == null ? null : this.applicationType.toString()); + jsonWriter.writeStringField("sessionState", this.sessionState == null ? null : this.sessionState.toString()); + jsonWriter.writeStringField("activeDirectoryUserName", this.activeDirectoryUsername); + jsonWriter.writeStringField("createTime", + this.createTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserSessionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserSessionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserSessionProperties. + */ + public static UserSessionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserSessionProperties deserializedUserSessionProperties = new UserSessionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectId".equals(fieldName)) { + deserializedUserSessionProperties.objectId = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedUserSessionProperties.userPrincipalName = reader.getString(); + } else if ("applicationType".equals(fieldName)) { + deserializedUserSessionProperties.applicationType = ApplicationType.fromString(reader.getString()); + } else if ("sessionState".equals(fieldName)) { + deserializedUserSessionProperties.sessionState = SessionState.fromString(reader.getString()); + } else if ("activeDirectoryUserName".equals(fieldName)) { + deserializedUserSessionProperties.activeDirectoryUsername = reader.getString(); + } else if ("createTime".equals(fieldName)) { + deserializedUserSessionProperties.createTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserSessionProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java index 6af070c09a8f..39d06526f2b4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceInner.java @@ -6,96 +6,182 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Represents a Workspace definition. */ +/** + * Represents a Workspace definition. + */ @Fluent public final class WorkspaceInner extends ResourceModelWithAllowedPropertySet { /* - * Metadata pertaining to creation and last modification of the resource. + * Detailed properties for Workspace + */ + private WorkspaceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* - * Detailed properties for Workspace + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header + * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested + * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. */ - @JsonProperty(value = "properties") - private WorkspaceProperties innerProperties; + private String etag; + + /* + * The type of the resource. + */ + private String type; - /** Creates an instance of WorkspaceInner class. */ + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WorkspaceInner class. + */ public WorkspaceInner() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Get the innerProperties property: Detailed properties for Workspace. + * + * @return the innerProperties value. + */ + private WorkspaceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ + @Override public SystemData systemData() { return this.systemData; } /** - * Get the innerProperties property: Detailed properties for Workspace. - * - * @return the innerProperties value. + * Get the etag property: The etag field is *not* required. If it is provided in the response body, it must also be + * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from + * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), + * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @return the etag value. */ - private WorkspaceProperties innerProperties() { - return this.innerProperties; + @Override + public String etag() { + return this.etag; } - /** {@inheritDoc} */ + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withManagedBy(String managedBy) { super.withManagedBy(managedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withKind(String kind) { super.withKind(kind); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withSku(ResourceModelWithAllowedPropertySetSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) { super.withPlan(plan); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public WorkspaceInner withTags(Map tags) { super.withTags(tags); @@ -104,7 +190,7 @@ public WorkspaceInner withTags(Map tags) { /** * Get the objectId property: ObjectId of Workspace. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -113,7 +199,7 @@ public String objectId() { /** * Get the description property: Description of Workspace. - * + * * @return the description value. */ public String description() { @@ -122,7 +208,7 @@ public String description() { /** * Set the description property: Description of Workspace. - * + * * @param description the description value to set. * @return the WorkspaceInner object itself. */ @@ -136,7 +222,7 @@ public WorkspaceInner withDescription(String description) { /** * Get the friendlyName property: Friendly name of Workspace. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -145,7 +231,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Workspace. - * + * * @param friendlyName the friendlyName value to set. * @return the WorkspaceInner object itself. */ @@ -159,7 +245,7 @@ public WorkspaceInner withFriendlyName(String friendlyName) { /** * Get the applicationGroupReferences property: List of applicationGroup resource Ids. - * + * * @return the applicationGroupReferences value. */ public List applicationGroupReferences() { @@ -168,7 +254,7 @@ public List applicationGroupReferences() { /** * Set the applicationGroupReferences property: List of applicationGroup resource Ids. - * + * * @param applicationGroupReferences the applicationGroupReferences value to set. * @return the WorkspaceInner object itself. */ @@ -182,7 +268,7 @@ public WorkspaceInner withApplicationGroupReferences(List applicationGro /** * Get the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ public Boolean cloudPcResource() { @@ -192,7 +278,7 @@ public Boolean cloudPcResource() { /** * Get the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -202,7 +288,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspaceInner object itself. */ @@ -217,7 +303,7 @@ public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkA /** * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -226,14 +312,92 @@ public List privateEndpointConnections() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (plan() != null) { + plan().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedBy", managedBy()); + jsonWriter.writeStringField("kind", kind()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("sku", sku()); + jsonWriter.writeJsonField("plan", plan()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceInner. + */ + public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceInner deserializedWorkspaceInner = new WorkspaceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWorkspaceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWorkspaceInner.withTags(tags); + } else if ("managedBy".equals(fieldName)) { + deserializedWorkspaceInner.withManagedBy(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedWorkspaceInner.withKind(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedWorkspaceInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedWorkspaceInner + .withIdentity(ResourceModelWithAllowedPropertySetIdentity.fromJson(reader)); + } else if ("sku".equals(fieldName)) { + deserializedWorkspaceInner.withSku(ResourceModelWithAllowedPropertySetSku.fromJson(reader)); + } else if ("plan".equals(fieldName)) { + deserializedWorkspaceInner.withPlan(ResourceModelWithAllowedPropertySetPlan.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceInner.innerProperties = WorkspaceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceInner; + }); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java index 4ec700cac29a..6c3ccc7951e1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspacePatchProperties.java @@ -5,44 +5,48 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Workspace properties that can be patched. */ +/** + * Workspace properties that can be patched. + */ @Fluent -public final class WorkspacePatchProperties { +public final class WorkspacePatchProperties implements JsonSerializable { /* * Description of Workspace. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of Workspace. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * List of applicationGroup links. */ - @JsonProperty(value = "applicationGroupReferences") private List applicationGroupReferences; /* * Enabled to allow this resource to be access from the public network */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; - /** Creates an instance of WorkspacePatchProperties class. */ + /** + * Creates an instance of WorkspacePatchProperties class. + */ public WorkspacePatchProperties() { } /** * Get the description property: Description of Workspace. - * + * * @return the description value. */ public String description() { @@ -51,7 +55,7 @@ public String description() { /** * Set the description property: Description of Workspace. - * + * * @param description the description value to set. * @return the WorkspacePatchProperties object itself. */ @@ -62,7 +66,7 @@ public WorkspacePatchProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of Workspace. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -71,7 +75,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Workspace. - * + * * @param friendlyName the friendlyName value to set. * @return the WorkspacePatchProperties object itself. */ @@ -82,7 +86,7 @@ public WorkspacePatchProperties withFriendlyName(String friendlyName) { /** * Get the applicationGroupReferences property: List of applicationGroup links. - * + * * @return the applicationGroupReferences value. */ public List applicationGroupReferences() { @@ -91,7 +95,7 @@ public List applicationGroupReferences() { /** * Set the applicationGroupReferences property: List of applicationGroup links. - * + * * @param applicationGroupReferences the applicationGroupReferences value to set. * @return the WorkspacePatchProperties object itself. */ @@ -102,7 +106,7 @@ public WorkspacePatchProperties withApplicationGroupReferences(List appl /** * Get the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -111,7 +115,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspacePatchProperties object itself. */ @@ -122,9 +126,58 @@ public WorkspacePatchProperties withPublicNetworkAccess(PublicNetworkAccess publ /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeArrayField("applicationGroupReferences", this.applicationGroupReferences, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspacePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspacePatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspacePatchProperties. + */ + public static WorkspacePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspacePatchProperties deserializedWorkspacePatchProperties = new WorkspacePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedWorkspacePatchProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedWorkspacePatchProperties.friendlyName = reader.getString(); + } else if ("applicationGroupReferences".equals(fieldName)) { + List applicationGroupReferences = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspacePatchProperties.applicationGroupReferences = applicationGroupReferences; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedWorkspacePatchProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspacePatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java index aec93ac5b3cd..1c68552c6239 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/WorkspaceProperties.java @@ -5,64 +5,65 @@ package com.azure.resourcemanager.desktopvirtualization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PublicNetworkAccess; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Schema for Workspace properties. */ +/** + * Schema for Workspace properties. + */ @Fluent -public final class WorkspaceProperties { +public final class WorkspaceProperties implements JsonSerializable { /* * ObjectId of Workspace. (internal use) */ - @JsonProperty(value = "objectId", access = JsonProperty.Access.WRITE_ONLY) private String objectId; /* * Description of Workspace. */ - @JsonProperty(value = "description") private String description; /* * Friendly name of Workspace. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * List of applicationGroup resource Ids. */ - @JsonProperty(value = "applicationGroupReferences") private List applicationGroupReferences; /* * Is cloud pc resource. */ - @JsonProperty(value = "cloudPcResource", access = JsonProperty.Access.WRITE_ONLY) private Boolean cloudPcResource; /* * Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource * to only be accessed via private endpoints */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * List of private endpoint connection associated with the specified resource */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; - /** Creates an instance of WorkspaceProperties class. */ + /** + * Creates an instance of WorkspaceProperties class. + */ public WorkspaceProperties() { } /** * Get the objectId property: ObjectId of Workspace. (internal use). - * + * * @return the objectId value. */ public String objectId() { @@ -71,7 +72,7 @@ public String objectId() { /** * Get the description property: Description of Workspace. - * + * * @return the description value. */ public String description() { @@ -80,7 +81,7 @@ public String description() { /** * Set the description property: Description of Workspace. - * + * * @param description the description value to set. * @return the WorkspaceProperties object itself. */ @@ -91,7 +92,7 @@ public WorkspaceProperties withDescription(String description) { /** * Get the friendlyName property: Friendly name of Workspace. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -100,7 +101,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Workspace. - * + * * @param friendlyName the friendlyName value to set. * @return the WorkspaceProperties object itself. */ @@ -111,7 +112,7 @@ public WorkspaceProperties withFriendlyName(String friendlyName) { /** * Get the applicationGroupReferences property: List of applicationGroup resource Ids. - * + * * @return the applicationGroupReferences value. */ public List applicationGroupReferences() { @@ -120,7 +121,7 @@ public List applicationGroupReferences() { /** * Set the applicationGroupReferences property: List of applicationGroup resource Ids. - * + * * @param applicationGroupReferences the applicationGroupReferences value to set. * @return the WorkspaceProperties object itself. */ @@ -131,7 +132,7 @@ public WorkspaceProperties withApplicationGroupReferences(List applicati /** * Get the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ public Boolean cloudPcResource() { @@ -141,7 +142,7 @@ public Boolean cloudPcResource() { /** * Get the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -151,7 +152,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspaceProperties object itself. */ @@ -163,7 +164,7 @@ public WorkspaceProperties withPublicNetworkAccess(PublicNetworkAccess publicNet /** * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -172,7 +173,7 @@ public List privateEndpointConnections() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -180,4 +181,61 @@ public void validate() { privateEndpointConnections().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeArrayField("applicationGroupReferences", this.applicationGroupReferences, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceProperties. + */ + public static WorkspaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceProperties deserializedWorkspaceProperties = new WorkspaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectId".equals(fieldName)) { + deserializedWorkspaceProperties.objectId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedWorkspaceProperties.description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedWorkspaceProperties.friendlyName = reader.getString(); + } else if ("applicationGroupReferences".equals(fieldName)) { + List applicationGroupReferences = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceProperties.applicationGroupReferences = applicationGroupReferences; + } else if ("cloudPcResource".equals(fieldName)) { + deserializedWorkspaceProperties.cloudPcResource = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedWorkspaceProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnection.fromJson(reader1)); + deserializedWorkspaceProperties.privateEndpointConnections = privateEndpointConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java index 54e0b1a1a656..ee25116a1bbf 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for DesktopVirtualizationApiClient. null. */ +/** + * Package containing the inner data models for DesktopVirtualizationApiClient. + * null. + */ package com.azure.resourcemanager.desktopvirtualization.fluent.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java index fd55e7d10125..5637a294910c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for DesktopVirtualizationApiClient. null. */ +/** + * Package containing the service clients for DesktopVirtualizationApiClient. + * null. + */ package com.azure.resourcemanager.desktopvirtualization.fluent; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java new file mode 100644 index 000000000000..1cc118040ec9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatch; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatchProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import java.util.Collections; +import java.util.Map; + +public final class AppAttachPackageImpl + implements AppAttachPackage, AppAttachPackage.Definition, AppAttachPackage.Update { + private AppAttachPackageInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AppAttachPackageProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AppAttachPackageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String appAttachPackageName; + + private AppAttachPackagePatch updateAppAttachPackagePatch; + + public AppAttachPackageImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AppAttachPackage create() { + this.innerObject = serviceManager.serviceClient() + .getAppAttachPackages() + .createOrUpdateWithResponse(resourceGroupName, appAttachPackageName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AppAttachPackage create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppAttachPackages() + .createOrUpdateWithResponse(resourceGroupName, appAttachPackageName, this.innerModel(), context) + .getValue(); + return this; + } + + AppAttachPackageImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = new AppAttachPackageInner(); + this.serviceManager = serviceManager; + this.appAttachPackageName = name; + } + + public AppAttachPackageImpl update() { + this.updateAppAttachPackagePatch = new AppAttachPackagePatch(); + return this; + } + + public AppAttachPackage apply() { + this.innerObject = serviceManager.serviceClient() + .getAppAttachPackages() + .updateWithResponse(resourceGroupName, appAttachPackageName, updateAppAttachPackagePatch, Context.NONE) + .getValue(); + return this; + } + + public AppAttachPackage apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppAttachPackages() + .updateWithResponse(resourceGroupName, appAttachPackageName, updateAppAttachPackagePatch, context) + .getValue(); + return this; + } + + AppAttachPackageImpl(AppAttachPackageInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.appAttachPackageName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "appAttachPackages"); + } + + public AppAttachPackage refresh() { + this.innerObject = serviceManager.serviceClient() + .getAppAttachPackages() + .getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE) + .getValue(); + return this; + } + + public AppAttachPackage refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppAttachPackages() + .getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, context) + .getValue(); + return this; + } + + public AppAttachPackageImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AppAttachPackageImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AppAttachPackageImpl withProperties(AppAttachPackageProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public AppAttachPackageImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public AppAttachPackageImpl withProperties(AppAttachPackagePatchProperties properties) { + this.updateAppAttachPackagePatch.withProperties(properties); + return this; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java new file mode 100644 index 000000000000..cf2623b1ac02 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesClientImpl.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageList; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AppAttachPackageInfoesClient. + */ +public final class AppAttachPackageInfoesClientImpl implements AppAttachPackageInfoesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AppAttachPackageInfoesService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of AppAttachPackageInfoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppAttachPackageInfoesClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service = RestProxy.create(AppAttachPackageInfoesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientAppAttachPackageInfoes to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface AppAttachPackageInfoesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/importAppAttachPackageInfo") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> importMethod(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") ImportPackageInfoRequest importPackageInfoRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> importMethodNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> importMethodSinglePageAsync(String resourceGroupName, + String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (importPackageInfoRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter importPackageInfoRequest is required and cannot be null.")); + } else { + importPackageInfoRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.importMethod(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, importPackageInfoRequest, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> importMethodSinglePageAsync(String resourceGroupName, + String hostPoolName, ImportPackageInfoRequest importPackageInfoRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + if (importPackageInfoRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter importPackageInfoRequest is required and cannot be null.")); + } else { + importPackageInfoRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .importMethod(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, importPackageInfoRequest, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux importMethodAsync(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest) { + return new PagedFlux<>( + () -> importMethodSinglePageAsync(resourceGroupName, hostPoolName, importPackageInfoRequest), + nextLink -> importMethodNextSinglePageAsync(nextLink)); + } + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux importMethodAsync(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest, Context context) { + return new PagedFlux<>( + () -> importMethodSinglePageAsync(resourceGroupName, hostPoolName, importPackageInfoRequest, context), + nextLink -> importMethodNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest) { + return new PagedIterable<>(importMethodAsync(resourceGroupName, hostPoolName, importPackageInfoRequest)); + } + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest, Context context) { + return new PagedIterable<>( + importMethodAsync(resourceGroupName, hostPoolName, importPackageInfoRequest, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> importMethodNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.importMethodNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> importMethodNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.importMethodNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java new file mode 100644 index 000000000000..69b5dc6355d2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackageInfoesImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoes; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; + +public final class AppAttachPackageInfoesImpl implements AppAttachPackageInfoes { + private static final ClientLogger LOGGER = new ClientLogger(AppAttachPackageInfoesImpl.class); + + private final AppAttachPackageInfoesClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public AppAttachPackageInfoesImpl(AppAttachPackageInfoesClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest) { + PagedIterable inner + = this.serviceClient().importMethod(resourceGroupName, hostPoolName, importPackageInfoRequest); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest, Context context) { + PagedIterable inner + = this.serviceClient().importMethod(resourceGroupName, hostPoolName, importPackageInfoRequest, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + private AppAttachPackageInfoesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java new file mode 100644 index 000000000000..ddd69e1dc1d9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesClientImpl.java @@ -0,0 +1,1055 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageList; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AppAttachPackagesClient. + */ +public final class AppAttachPackagesClientImpl implements AppAttachPackagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AppAttachPackagesService service; + + /** + * The service client containing this operation class. + */ + private final DesktopVirtualizationApiClientImpl client; + + /** + * Initializes an instance of AppAttachPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppAttachPackagesClientImpl(DesktopVirtualizationApiClientImpl client) { + this.service + = RestProxy.create(AppAttachPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DesktopVirtualizationApiClientAppAttachPackages to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DesktopVirtualizatio") + public interface AppAttachPackagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, + @BodyParam("application/json") AppAttachPackageInner appAttachPackage, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("appAttachPackageName") String appAttachPackageName, + @BodyParam("application/json") AppAttachPackagePatch appAttachPackagePatch, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/appAttachPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appAttachPackageName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String appAttachPackageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context); + } + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String appAttachPackageName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String appAttachPackageName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); + } + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppAttachPackageInner getByResourceGroup(String resourceGroupName, String appAttachPackageName) { + return getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE).getValue(); + } + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + if (appAttachPackage == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackage is required and cannot be null.")); + } else { + appAttachPackage.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackage, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + if (appAttachPackage == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackage is required and cannot be null.")); + } else { + appAttachPackage.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackage, accept, + context); + } + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage) { + return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String appAttachPackageName, AppAttachPackageInner appAttachPackage, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackage, context) + .block(); + } + + /** + * Create or update an App Attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackage Object containing App Attach Package definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppAttachPackageInner createOrUpdate(String resourceGroupName, String appAttachPackageName, + AppAttachPackageInner appAttachPackage) { + return createOrUpdateWithResponse(resourceGroupName, appAttachPackageName, appAttachPackage, Context.NONE) + .getValue(); + } + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String appAttachPackageName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appAttachPackageName, accept, context); + } + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String appAttachPackageName) { + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName).flatMap(ignored -> Mono.empty()); + } + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String appAttachPackageName, Context context) { + return deleteWithResponseAsync(resourceGroupName, appAttachPackageName, context).block(); + } + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String appAttachPackageName) { + deleteWithResponse(resourceGroupName, appAttachPackageName, Context.NONE); + } + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackagePatch Object containing App Attach Package definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackagePatch appAttachPackagePatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + if (appAttachPackagePatch != null) { + appAttachPackagePatch.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, appAttachPackageName, appAttachPackagePatch, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String appAttachPackageName, AppAttachPackagePatch appAttachPackagePatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (appAttachPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter appAttachPackageName is required and cannot be null.")); + } + if (appAttachPackagePatch != null) { + appAttachPackagePatch.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, appAttachPackageName, appAttachPackagePatch, accept, context); + } + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String appAttachPackageName) { + final AppAttachPackagePatch appAttachPackagePatch = null; + return updateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackagePatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param appAttachPackagePatch Object containing App Attach Package definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String appAttachPackageName, + AppAttachPackagePatch appAttachPackagePatch, Context context) { + return updateWithResponseAsync(resourceGroupName, appAttachPackageName, appAttachPackagePatch, context).block(); + } + + /** + * Update an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schema for App Attach Package properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppAttachPackageInner update(String resourceGroupName, String appAttachPackageName) { + final AppAttachPackagePatch appAttachPackagePatch = null; + return updateWithResponse(resourceGroupName, appAttachPackageName, appAttachPackagePatch, Context.NONE) + .getValue(); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); + } + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List App Attach packages in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List App Attach packages in subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java new file mode 100644 index 000000000000..42bd35b4e26e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/AppAttachPackagesImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackages; + +public final class AppAttachPackagesImpl implements AppAttachPackages { + private static final ClientLogger LOGGER = new ClientLogger(AppAttachPackagesImpl.class); + + private final AppAttachPackagesClient innerClient; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + public AppAttachPackagesImpl(AppAttachPackagesClient innerClient, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String appAttachPackageName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppAttachPackageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AppAttachPackage getByResourceGroup(String resourceGroupName, String appAttachPackageName) { + AppAttachPackageInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, appAttachPackageName); + if (inner != null) { + return new AppAttachPackageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, appAttachPackageName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName) { + this.serviceClient().delete(resourceGroupName, appAttachPackageName); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppAttachPackageImpl(inner1, this.manager())); + } + + public AppAttachPackage getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appAttachPackageName = ResourceManagerUtils.getValueFromIdByName(id, "appAttachPackages"); + if (appAttachPackageName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appAttachPackages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appAttachPackageName = ResourceManagerUtils.getValueFromIdByName(id, "appAttachPackages"); + if (appAttachPackageName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appAttachPackages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appAttachPackageName = ResourceManagerUtils.getValueFromIdByName(id, "appAttachPackages"); + if (appAttachPackageName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appAttachPackages'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String appAttachPackageName = ResourceManagerUtils.getValueFromIdByName(id, "appAttachPackages"); + if (appAttachPackageName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appAttachPackages'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, appAttachPackageName, context); + } + + private AppAttachPackagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } + + public AppAttachPackageImpl define(String name) { + return new AppAttachPackageImpl(name, this.manager()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java index b65a7681c141..cc8e13059c96 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupImpl.java @@ -140,27 +140,23 @@ public ApplicationGroupImpl withExistingResourceGroup(String resourceGroupName) } public ApplicationGroup create() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationGroups() - .createOrUpdateWithResponse(resourceGroupName, applicationGroupName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplicationGroups() + .createOrUpdateWithResponse(resourceGroupName, applicationGroupName, this.innerModel(), Context.NONE) + .getValue(); return this; } public ApplicationGroup create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationGroups() - .createOrUpdateWithResponse(resourceGroupName, applicationGroupName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplicationGroups() + .createOrUpdateWithResponse(resourceGroupName, applicationGroupName, this.innerModel(), context) + .getValue(); return this; } - ApplicationGroupImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + ApplicationGroupImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new ApplicationGroupInner(); this.serviceManager = serviceManager; this.applicationGroupName = name; @@ -172,51 +168,42 @@ public ApplicationGroupImpl update() { } public ApplicationGroup apply() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationGroups() - .updateWithResponse(resourceGroupName, applicationGroupName, updateApplicationGroup, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplicationGroups() + .updateWithResponse(resourceGroupName, applicationGroupName, updateApplicationGroup, Context.NONE) + .getValue(); return this; } public ApplicationGroup apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationGroups() - .updateWithResponse(resourceGroupName, applicationGroupName, updateApplicationGroup, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplicationGroups() + .updateWithResponse(resourceGroupName, applicationGroupName, updateApplicationGroup, context) + .getValue(); return this; } - ApplicationGroupImpl( - ApplicationGroupInner innerObject, + ApplicationGroupImpl(ApplicationGroupInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.applicationGroupName = Utils.getValueFromIdByName(innerObject.id(), "applicationGroups"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applicationGroups"); } public ApplicationGroup refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationGroups() - .getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplicationGroups() + .getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, Context.NONE) + .getValue(); return this; } public ApplicationGroup refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationGroups() - .getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplicationGroups() + .getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context) + .getValue(); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java index 3235d74bac9c..9f972e889f6a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsClientImpl.java @@ -35,22 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationGroupPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationGroupsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationGroupsClient. + */ public final class ApplicationGroupsClientImpl implements ApplicationGroupsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ApplicationGroupsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of ApplicationGroupsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ApplicationGroupsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(ApplicationGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ApplicationGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,117 +67,86 @@ public final class ApplicationGroupsClientImpl implements ApplicationGroupsClien @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ApplicationGroupsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @HeaderParam("Accept") String accept, + @PathParam("applicationGroupName") String applicationGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @BodyParam("application/json") ApplicationGroupInner applicationGroup, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationGroupInner applicationGroup, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @HeaderParam("Accept") String accept, + @PathParam("applicationGroupName") String applicationGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @BodyParam("application/json") ApplicationGroupPatch applicationGroup, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationGroupPatch applicationGroup, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -180,19 +155,15 @@ Mono> listBySubscriptionNext( * @return an application group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationGroupName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String applicationGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -204,23 +175,14 @@ public Mono> getByResourceGroupWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 context The context to associate with this operation. @@ -230,19 +192,15 @@ public Mono> getByResourceGroupWithResponseAsync * @return an application group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String applicationGroupName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String applicationGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -254,20 +212,13 @@ private Mono> getByResourceGroupWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context); } /** * 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. @@ -283,7 +234,7 @@ public Mono getByResourceGroupAsync(String resourceGroupN /** * 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 context The context to associate with this operation. @@ -293,14 +244,14 @@ public Mono getByResourceGroupAsync(String resourceGroupN * @return an application group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationGroupName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationGroupName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGroupName, context).block(); } /** * 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. @@ -315,30 +266,26 @@ public ApplicationGroupInner getByResourceGroup(String resourceGroupName, String /** * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -356,24 +303,15 @@ public Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationGroup, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -381,26 +319,19 @@ public Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String applicationGroupName, - ApplicationGroupInner applicationGroup, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -418,21 +349,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationGroup, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, + context); } /** * 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. @@ -442,15 +366,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return represents a ApplicationGroup definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup) { + public Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup) { return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. @@ -461,18 +385,15 @@ public Mono createOrUpdateAsync( * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String applicationGroupName, - ApplicationGroupInner applicationGroup, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, + String applicationGroupName, ApplicationGroupInner applicationGroup, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context) .block(); } /** * 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. @@ -482,15 +403,15 @@ public Response createOrUpdateWithResponse( * @return represents a ApplicationGroup definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationGroupInner createOrUpdate( - String resourceGroupName, String applicationGroupName, ApplicationGroupInner applicationGroup) { + public ApplicationGroupInner createOrUpdate(String resourceGroupName, String applicationGroupName, + ApplicationGroupInner applicationGroup) { return createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationGroup, Context.NONE) .getValue(); } /** * 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. @@ -501,16 +422,12 @@ public ApplicationGroupInner createOrUpdate( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -522,23 +439,14 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 context The context to associate with this operation. @@ -548,19 +456,15 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String applicationGroupName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -572,20 +476,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, accept, context); } /** * 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. @@ -600,7 +497,7 @@ public Mono deleteAsync(String resourceGroupName, String applicationGroupN /** * 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 context The context to associate with this operation. @@ -616,7 +513,7 @@ public Response deleteWithResponse(String resourceGroupName, String applic /** * 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. @@ -630,30 +527,26 @@ public void delete(String resourceGroupName, String applicationGroupName) { /** * 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String applicationGroupName, ApplicationGroupPatch applicationGroup) { + public Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupPatch applicationGroup) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -668,24 +561,15 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationGroup, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationGroup, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -693,26 +577,19 @@ public Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a ApplicationGroup definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String applicationGroupName, - ApplicationGroupPatch applicationGroup, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, ApplicationGroupPatch applicationGroup, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -727,21 +604,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationGroup, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationGroup, accept, context); } /** * 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. @@ -758,7 +627,7 @@ public Mono updateAsync(String resourceGroupName, String /** * 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. @@ -769,17 +638,14 @@ public Mono updateAsync(String resourceGroupName, String * @return represents a ApplicationGroup definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - ApplicationGroupPatch applicationGroup, - Context context) { + public Response updateWithResponse(String resourceGroupName, String applicationGroupName, + ApplicationGroupPatch applicationGroup, Context context) { return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationGroup, context).block(); } /** * 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. @@ -795,7 +661,7 @@ public ApplicationGroupInner update(String resourceGroupName, String application /** * 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 pageSize Number of items per page. @@ -807,19 +673,15 @@ public ApplicationGroupInner update(String resourceGroupName, String application * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -827,35 +689,17 @@ private Mono> listByResourceGroupSinglePage } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - filter, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, isDescending, initialSkip, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List 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 pageSize Number of items per page. @@ -868,24 +712,15 @@ private Mono> listByResourceGroupSinglePage * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -894,31 +729,16 @@ private Mono> listByResourceGroupSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - filter, - pageSize, - isDescending, - initialSkip, - accept, + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, isDescending, initialSkip, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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 pageSize Number of items per page. @@ -930,8 +750,8 @@ private Mono> listByResourceGroupSinglePage * @return applicationGroupList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); @@ -939,7 +759,7 @@ public PagedFlux listByResourceGroupAsync( /** * List applicationGroups. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -959,7 +779,7 @@ public PagedFlux listByResourceGroupAsync(String resource /** * 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 pageSize Number of items per page. @@ -972,23 +792,15 @@ public PagedFlux listByResourceGroupAsync(String resource * @return applicationGroupList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listByResourceGroupSinglePageAsync( - resourceGroupName, filter, pageSize, isDescending, initialSkip, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, pageSize, + isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * List applicationGroups. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1007,7 +819,7 @@ public PagedIterable listByResourceGroup(String resourceG /** * 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 pageSize Number of items per page. @@ -1020,20 +832,15 @@ public PagedIterable listByResourceGroup(String resourceG * @return applicationGroupList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByResourceGroupAsync(resourceGroupName, filter, pageSize, isDescending, initialSkip, context)); } /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1043,44 +850,25 @@ public PagedIterable listByResourceGroup( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1091,41 +879,25 @@ private Mono> listSinglePageAsync(String fi @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1134,13 +906,13 @@ private Mono> listSinglePageAsync(String fi */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List applicationGroups in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationGroupList as paginated response with {@link PagedFlux}. @@ -1148,13 +920,13 @@ public PagedFlux listAsync(String filter) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1164,14 +936,13 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), + return new PagedFlux<>(() -> listSinglePageAsync(filter, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List applicationGroups in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationGroupList as paginated response with {@link PagedIterable}. @@ -1184,7 +955,7 @@ public PagedIterable list() { /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1199,9 +970,8 @@ public PagedIterable list(String filter, Context context) /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1213,32 +983,22 @@ private Mono> listByResourceGroupNextSingle return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1246,37 +1006,26 @@ private Mono> listByResourceGroupNextSingle * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1288,32 +1037,22 @@ private Mono> listBySubscriptionNextSingleP return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1321,29 +1060,19 @@ private Mono> listBySubscriptionNextSingleP * @return applicationGroupList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java index b9289db001ba..d232201e4827 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationGroupsImpl.java @@ -21,22 +21,18 @@ public final class ApplicationGroupsImpl implements ApplicationGroups { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public ApplicationGroupsImpl( - ApplicationGroupsClient innerClient, + public ApplicationGroupsImpl(ApplicationGroupsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationGroupName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationGroupName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ApplicationGroupImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,8 +48,8 @@ public ApplicationGroup getByResourceGroup(String resourceGroupName, String appl } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String applicationGroupName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, applicationGroupName, context); } @@ -63,113 +59,78 @@ public void deleteByResourceGroup(String resourceGroupName, String applicationGr public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup( - String resourceGroupName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByResourceGroup(resourceGroupName, filter, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByResourceGroup(resourceGroupName, filter, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); } public PagedIterable list(String filter, Context context) { PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGroupImpl(inner1, this.manager())); } public ApplicationGroup getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } this.deleteByResourceGroupWithResponse(resourceGroupName, applicationGroupName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } return this.deleteByResourceGroupWithResponse(resourceGroupName, applicationGroupName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java index e6928ad4fe64..32a5b21a85ad 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationImpl.java @@ -117,29 +117,25 @@ public ApplicationImpl withExistingApplicationGroup(String resourceGroupName, St } public Application create() { - this.innerObject = - serviceManager - .serviceClient() - .getApplications() - .createOrUpdateWithResponse( - resourceGroupName, applicationGroupName, applicationName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplications() + .createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public Application create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplications() - .createOrUpdateWithResponse( - resourceGroupName, applicationGroupName, applicationName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplications() + .createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationName, this.innerModel(), + context) + .getValue(); return this; } - ApplicationImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + ApplicationImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new ApplicationInner(); this.serviceManager = serviceManager; this.applicationName = name; @@ -151,54 +147,44 @@ public ApplicationImpl update() { } public Application apply() { - this.innerObject = - serviceManager - .serviceClient() - .getApplications() - .updateWithResponse( - resourceGroupName, applicationGroupName, applicationName, updateApplication, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplications() + .updateWithResponse(resourceGroupName, applicationGroupName, applicationName, updateApplication, + Context.NONE) + .getValue(); return this; } public Application apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplications() - .updateWithResponse( - resourceGroupName, applicationGroupName, applicationName, updateApplication, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplications() + .updateWithResponse(resourceGroupName, applicationGroupName, applicationName, updateApplication, context) + .getValue(); return this; } - ApplicationImpl( - ApplicationInner innerObject, + ApplicationImpl(ApplicationInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.applicationGroupName = Utils.getValueFromIdByName(innerObject.id(), "applicationGroups"); - this.applicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applicationGroups"); + this.applicationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); } public Application refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getApplications() - .getWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplications() + .getWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE) + .getValue(); return this; } public Application refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplications() - .getWithResponse(resourceGroupName, applicationGroupName, applicationName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getApplications() + .getWithResponse(resourceGroupName, applicationGroupName, applicationName, context) + .getValue(); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java index dab884f6e54e..05564c5a80fc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsClientImpl.java @@ -35,22 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.ApplicationPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationsClient. + */ public final class ApplicationsClientImpl implements ApplicationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ApplicationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of ApplicationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ApplicationsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,99 +67,74 @@ public final class ApplicationsClientImpl implements ApplicationsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ApplicationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("applicationName") String applicationName, - @HeaderParam("Accept") String accept, + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @PathParam("applicationName") String applicationName, - @BodyParam("application/json") ApplicationInner application, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("applicationName") String applicationName, - @HeaderParam("Accept") String accept, + @PathParam("applicationName") String applicationName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, @PathParam("applicationName") String applicationName, - @BodyParam("application/json") ApplicationPatch application, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationPatch application, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -163,19 +144,15 @@ Mono> listNext( * @return an application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName) { + public Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -190,25 +167,14 @@ public Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - accept, - context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -219,19 +185,15 @@ public Mono> getWithResponseAsync( * @return an application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -247,21 +209,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationName, accept, context); } /** * 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. @@ -271,15 +225,15 @@ private Mono> getWithResponseAsync( * @return an application on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String applicationGroupName, String applicationName) { + public Mono getAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. @@ -290,14 +244,14 @@ public Mono getAsync( * @return an application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context) { + public Response getWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { return getWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); } /** * 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. @@ -313,7 +267,7 @@ public ApplicationInner get(String resourceGroupName, String applicationGroupNam /** * 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. @@ -324,19 +278,15 @@ public ApplicationInner get(String resourceGroupName, String applicationGroupNam * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationInner application) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -357,25 +307,15 @@ public Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - application, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -387,23 +327,15 @@ public Mono> createOrUpdateWithResponseAsync( * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String applicationGroupName, - String applicationName, - ApplicationInner application, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationInner application, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -424,22 +356,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - application, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, + accept, context); } /** * 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. @@ -450,15 +374,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return schema for Application properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application) { + public Mono createOrUpdateAsync(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application) { return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. @@ -470,20 +394,15 @@ public Mono createOrUpdateAsync( * @return schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String applicationGroupName, - String applicationName, - ApplicationInner application, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, applicationGroupName, applicationName, application, context) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application, + context).block(); } /** * 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. @@ -494,16 +413,15 @@ public Response createOrUpdateWithResponse( * @return schema for Application properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationInner application) { - return createOrUpdateWithResponse( - resourceGroupName, applicationGroupName, applicationName, application, Context.NONE) - .getValue(); + public ApplicationInner createOrUpdate(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationInner application) { + return createOrUpdateWithResponse(resourceGroupName, applicationGroupName, applicationName, application, + Context.NONE).getValue(); } /** * 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. @@ -513,19 +431,15 @@ public ApplicationInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -540,25 +454,14 @@ public Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - accept, - context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -569,19 +472,15 @@ public Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -597,21 +496,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationName, accept, context); } /** * 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. @@ -628,7 +519,7 @@ public Mono deleteAsync(String resourceGroupName, String applicationGroupN /** * 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. @@ -639,14 +530,14 @@ public Mono deleteAsync(String resourceGroupName, String applicationGroupN * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { return deleteWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, context).block(); } /** * 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. @@ -661,7 +552,7 @@ public void delete(String resourceGroupName, String applicationGroupName, String /** * 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. @@ -672,19 +563,15 @@ public void delete(String resourceGroupName, String applicationGroupName, String * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String applicationGroupName, String applicationName, ApplicationPatch application) { + public Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationPatch application) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -703,25 +590,15 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - application, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, applicationName, application, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -733,23 +610,15 @@ public Mono> updateWithResponseAsync( * @return schema for Application properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String applicationGroupName, - String applicationName, - ApplicationPatch application, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + String applicationGroupName, String applicationName, ApplicationPatch application, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -768,22 +637,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - applicationName, - application, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, applicationName, application, accept, context); } /** * 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. @@ -793,8 +653,8 @@ private Mono> updateWithResponseAsync( * @return schema for Application properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String applicationGroupName, String applicationName) { + public Mono updateAsync(String resourceGroupName, String applicationGroupName, + String applicationName) { final ApplicationPatch application = null; return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -802,7 +662,7 @@ public Mono updateAsync( /** * 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. @@ -814,19 +674,15 @@ public Mono updateAsync( * @return schema for Application properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - String applicationName, - ApplicationPatch application, - Context context) { + public Response updateWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, ApplicationPatch application, Context context) { return updateWithResponseAsync(resourceGroupName, applicationGroupName, applicationName, application, context) .block(); } /** * 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. @@ -844,7 +700,7 @@ public ApplicationInner update(String resourceGroupName, String applicationGroup /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -856,23 +712,15 @@ public ApplicationInner update(String resourceGroupName, String applicationGroup * @return applicationList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -884,35 +732,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, + initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -925,24 +755,15 @@ private Mono> listSinglePageAsync( * @return applicationList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -955,31 +776,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -991,12 +796,8 @@ private Mono> listSinglePageAsync( * @return applicationList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -1004,7 +805,7 @@ public PagedFlux listAsync( /** * 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. @@ -1024,7 +825,7 @@ public PagedFlux listAsync(String resourceGroupName, String ap /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -1037,23 +838,15 @@ public PagedFlux listAsync(String resourceGroupName, String ap * @return applicationList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * 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. @@ -1072,7 +865,7 @@ public PagedIterable list(String resourceGroupName, String app /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -1085,22 +878,16 @@ public PagedIterable list(String resourceGroupName, String app * @return applicationList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1112,31 +899,20 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1149,23 +925,13 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java index acbdfe53b165..d45004c16ea5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ApplicationsImpl.java @@ -21,22 +21,18 @@ public final class ApplicationsImpl implements Applications { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public ApplicationsImpl( - ApplicationsClient innerClient, + public ApplicationsImpl(ApplicationsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, applicationGroupName, applicationName, context); + public Response getWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, applicationGroupName, applicationName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ApplicationImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,10 +48,9 @@ public Application get(String resourceGroupName, String applicationGroupName, St } } - public Response deleteWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context) { - return this - .serviceClient() + public Response deleteWithResponse(String resourceGroupName, String applicationGroupName, + String applicationName, Context context) { + return this.serviceClient() .deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, context); } @@ -65,131 +60,88 @@ public void delete(String resourceGroupName, String applicationGroupName, String public PagedIterable list(String resourceGroupName, String applicationGroupName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } public Application getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } return this.getWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } return this.getWithResponse(resourceGroupName, applicationGroupName, applicationName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } this.deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String applicationGroupName = Utils.getValueFromIdByName(id, "applicationGroups"); + String applicationGroupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationGroups"); if (applicationGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applicationGroups'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } return this.deleteWithResponse(resourceGroupName, applicationGroupName, applicationName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java index 66148437c948..43d2c0d3a5ab 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopImpl.java @@ -13,8 +13,7 @@ public final class DesktopImpl implements Desktop { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - DesktopImpl( - DesktopInner innerObject, + DesktopImpl(DesktopInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java index e626cc117f2b..72ab11caf13d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientBuilder.java @@ -14,17 +14,19 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the DesktopVirtualizationApiClientImpl type. */ -@ServiceClientBuilder(serviceClients = {DesktopVirtualizationApiClientImpl.class}) +/** + * A builder for creating a new instance of the DesktopVirtualizationApiClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { DesktopVirtualizationApiClientImpl.class }) public final class DesktopVirtualizationApiClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. - * + * Sets The ID of the target subscription. The value must be an UUID. + * * @param subscriptionId the subscriptionId value. * @return the DesktopVirtualizationApiClientBuilder. */ @@ -40,7 +42,7 @@ public DesktopVirtualizationApiClientBuilder subscriptionId(String subscriptionI /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the DesktopVirtualizationApiClientBuilder. */ @@ -56,7 +58,7 @@ public DesktopVirtualizationApiClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the DesktopVirtualizationApiClientBuilder. */ @@ -72,7 +74,7 @@ public DesktopVirtualizationApiClientBuilder environment(AzureEnvironment enviro /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the DesktopVirtualizationApiClientBuilder. */ @@ -88,7 +90,7 @@ public DesktopVirtualizationApiClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the DesktopVirtualizationApiClientBuilder. */ @@ -104,7 +106,7 @@ public DesktopVirtualizationApiClientBuilder defaultPollInterval(Duration defaul /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the DesktopVirtualizationApiClientBuilder. */ @@ -115,30 +117,22 @@ public DesktopVirtualizationApiClientBuilder serializerAdapter(SerializerAdapter /** * Builds an instance of DesktopVirtualizationApiClientImpl with the provided parameters. - * + * * @return an instance of DesktopVirtualizationApiClientImpl. */ public DesktopVirtualizationApiClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - DesktopVirtualizationApiClientImpl client = - new DesktopVirtualizationApiClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - this.subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + DesktopVirtualizationApiClientImpl client = new DesktopVirtualizationApiClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java index d56062c1038a..fe0d2bd66533 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopVirtualizationApiClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.desktopvirtualization.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -22,10 +23,12 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackageInfoesClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.AppAttachPackagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationGroupsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.ApplicationsClient; -import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationApiClient; import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopsClient; +import com.azure.resourcemanager.desktopvirtualization.fluent.DesktopVirtualizationApiClient; import com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.MsixPackagesClient; @@ -48,296 +51,365 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the DesktopVirtualizationApiClientImpl type. */ +/** + * Initializes a new instance of the DesktopVirtualizationApiClientImpl type. + */ @ServiceClient(builder = DesktopVirtualizationApiClientBuilder.class) public final class DesktopVirtualizationApiClientImpl implements DesktopVirtualizationApiClient { - /** The ID of the target subscription. */ + /** + * The ID of the target subscription. The value must be an UUID. + */ private final String subscriptionId; /** - * Gets The ID of the target subscription. - * + * Gets The ID of the target subscription. The value must be an UUID. + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The WorkspacesClient object to access its operations. */ + /** + * The WorkspacesClient object to access its operations. + */ private final WorkspacesClient workspaces; /** * Gets the WorkspacesClient object to access its operations. - * + * * @return the WorkspacesClient object. */ public WorkspacesClient getWorkspaces() { return this.workspaces; } - /** The PrivateEndpointConnectionsClient object to access its operations. */ + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ private final PrivateEndpointConnectionsClient privateEndpointConnections; /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } - /** The PrivateLinkResourcesClient object to access its operations. */ + /** + * The PrivateLinkResourcesClient object to access its operations. + */ private final PrivateLinkResourcesClient privateLinkResources; /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } - /** The ScalingPlansClient object to access its operations. */ + /** + * The ScalingPlansClient object to access its operations. + */ private final ScalingPlansClient scalingPlans; /** * Gets the ScalingPlansClient object to access its operations. - * + * * @return the ScalingPlansClient object. */ public ScalingPlansClient getScalingPlans() { return this.scalingPlans; } - /** The ScalingPlanPooledSchedulesClient object to access its operations. */ + /** + * The ScalingPlanPooledSchedulesClient object to access its operations. + */ private final ScalingPlanPooledSchedulesClient scalingPlanPooledSchedules; /** * Gets the ScalingPlanPooledSchedulesClient object to access its operations. - * + * * @return the ScalingPlanPooledSchedulesClient object. */ public ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules() { return this.scalingPlanPooledSchedules; } - /** The ScalingPlanPersonalSchedulesClient object to access its operations. */ + /** + * The ScalingPlanPersonalSchedulesClient object to access its operations. + */ private final ScalingPlanPersonalSchedulesClient scalingPlanPersonalSchedules; /** * Gets the ScalingPlanPersonalSchedulesClient object to access its operations. - * + * * @return the ScalingPlanPersonalSchedulesClient object. */ public ScalingPlanPersonalSchedulesClient getScalingPlanPersonalSchedules() { return this.scalingPlanPersonalSchedules; } - /** The ApplicationGroupsClient object to access its operations. */ + /** + * The ApplicationGroupsClient object to access its operations. + */ private final ApplicationGroupsClient applicationGroups; /** * Gets the ApplicationGroupsClient object to access its operations. - * + * * @return the ApplicationGroupsClient object. */ public ApplicationGroupsClient getApplicationGroups() { return this.applicationGroups; } - /** The StartMenuItemsClient object to access its operations. */ + /** + * The StartMenuItemsClient object to access its operations. + */ private final StartMenuItemsClient startMenuItems; /** * Gets the StartMenuItemsClient object to access its operations. - * + * * @return the StartMenuItemsClient object. */ public StartMenuItemsClient getStartMenuItems() { return this.startMenuItems; } - /** The ApplicationsClient object to access its operations. */ + /** + * The ApplicationsClient object to access its operations. + */ private final ApplicationsClient applications; /** * Gets the ApplicationsClient object to access its operations. - * + * * @return the ApplicationsClient object. */ public ApplicationsClient getApplications() { return this.applications; } - /** The DesktopsClient object to access its operations. */ + /** + * The DesktopsClient object to access its operations. + */ private final DesktopsClient desktops; /** * Gets the DesktopsClient object to access its operations. - * + * * @return the DesktopsClient object. */ public DesktopsClient getDesktops() { return this.desktops; } - /** The HostPoolsClient object to access its operations. */ + /** + * The HostPoolsClient object to access its operations. + */ private final HostPoolsClient hostPools; /** * Gets the HostPoolsClient object to access its operations. - * + * * @return the HostPoolsClient object. */ public HostPoolsClient getHostPools() { return this.hostPools; } - /** The UserSessionsClient object to access its operations. */ + /** + * The UserSessionsClient object to access its operations. + */ private final UserSessionsClient userSessions; /** * Gets the UserSessionsClient object to access its operations. - * + * * @return the UserSessionsClient object. */ public UserSessionsClient getUserSessions() { return this.userSessions; } - /** The SessionHostsClient object to access its operations. */ + /** + * The SessionHostsClient object to access its operations. + */ private final SessionHostsClient sessionHosts; /** * Gets the SessionHostsClient object to access its operations. - * + * * @return the SessionHostsClient object. */ public SessionHostsClient getSessionHosts() { return this.sessionHosts; } - /** The MsixPackagesClient object to access its operations. */ + /** + * The MsixPackagesClient object to access its operations. + */ private final MsixPackagesClient msixPackages; /** * Gets the MsixPackagesClient object to access its operations. - * + * * @return the MsixPackagesClient object. */ public MsixPackagesClient getMsixPackages() { return this.msixPackages; } - /** The MsixImagesClient object to access its operations. */ + /** + * The AppAttachPackageInfoesClient object to access its operations. + */ + private final AppAttachPackageInfoesClient appAttachPackageInfoes; + + /** + * Gets the AppAttachPackageInfoesClient object to access its operations. + * + * @return the AppAttachPackageInfoesClient object. + */ + public AppAttachPackageInfoesClient getAppAttachPackageInfoes() { + return this.appAttachPackageInfoes; + } + + /** + * The MsixImagesClient object to access its operations. + */ private final MsixImagesClient msixImages; /** * Gets the MsixImagesClient object to access its operations. - * + * * @return the MsixImagesClient object. */ public MsixImagesClient getMsixImages() { return this.msixImages; } + /** + * The AppAttachPackagesClient object to access its operations. + */ + private final AppAttachPackagesClient appAttachPackages; + + /** + * Gets the AppAttachPackagesClient object to access its operations. + * + * @return the AppAttachPackagesClient object. + */ + public AppAttachPackagesClient getAppAttachPackages() { + return this.appAttachPackages; + } + /** * Initializes an instance of DesktopVirtualizationApiClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ - DesktopVirtualizationApiClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + DesktopVirtualizationApiClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-09-05"; + this.apiVersion = "2024-04-03"; this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); @@ -353,12 +425,14 @@ public MsixImagesClient getMsixImages() { this.userSessions = new UserSessionsClientImpl(this); this.sessionHosts = new SessionHostsClientImpl(this); this.msixPackages = new MsixPackagesClientImpl(this); + this.appAttachPackageInfoes = new AppAttachPackageInfoesClientImpl(this); this.msixImages = new MsixImagesClientImpl(this); + this.appAttachPackages = new AppAttachPackagesClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -367,7 +441,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -377,7 +451,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -387,26 +461,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -419,19 +482,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -472,7 +532,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java index cf1f79593d59..238ccde29813 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsClientImpl.java @@ -33,17 +33,23 @@ import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DesktopsClient. */ +/** + * An instance of this class provides access to all the operations defined in DesktopsClient. + */ public final class DesktopsClientImpl implements DesktopsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DesktopsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of DesktopsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ DesktopsClientImpl(DesktopVirtualizationApiClientImpl client) { @@ -58,68 +64,49 @@ public final class DesktopsClientImpl implements DesktopsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface DesktopsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("desktopName") String desktopName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("desktopName") String desktopName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("applicationGroupName") String applicationGroupName, - @PathParam("desktopName") String desktopName, - @BodyParam("application/json") DesktopPatch desktop, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("desktopName") String desktopName, @BodyParam("application/json") DesktopPatch desktop, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -129,19 +116,15 @@ Mono> listNext( * @return a desktop along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String applicationGroupName, String desktopName) { + public Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -156,24 +139,14 @@ public Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - desktopName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -184,19 +157,15 @@ public Mono> getWithResponseAsync( * @return a desktop along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String applicationGroupName, String desktopName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -211,21 +180,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - desktopName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, desktopName, accept, context); } /** * 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. @@ -242,7 +203,7 @@ public Mono getAsync(String resourceGroupName, String applicationG /** * 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. @@ -253,14 +214,14 @@ public Mono getAsync(String resourceGroupName, String applicationG * @return a desktop along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String applicationGroupName, String desktopName, Context context) { + public Response getWithResponse(String resourceGroupName, String applicationGroupName, + String desktopName, Context context) { return getWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, context).block(); } /** * 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. @@ -276,7 +237,7 @@ public DesktopInner get(String resourceGroupName, String applicationGroupName, S /** * 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. @@ -287,19 +248,15 @@ public DesktopInner get(String resourceGroupName, String applicationGroupName, S * @return schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String applicationGroupName, String desktopName, DesktopPatch desktop) { + public Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -317,25 +274,15 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - desktopName, - desktop, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, desktopName, desktop, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -347,23 +294,15 @@ public Mono> updateWithResponseAsync( * @return schema for Desktop properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String applicationGroupName, - String desktopName, - DesktopPatch desktop, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -381,22 +320,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - desktopName, - desktop, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, desktopName, desktop, accept, context); } /** * 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. @@ -414,7 +344,7 @@ public Mono updateAsync(String resourceGroupName, String applicati /** * 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. @@ -426,18 +356,14 @@ public Mono updateAsync(String resourceGroupName, String applicati * @return schema for Desktop properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - String desktopName, - DesktopPatch desktop, - Context context) { + public Response updateWithResponse(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop, Context context) { return updateWithResponseAsync(resourceGroupName, applicationGroupName, desktopName, desktop, context).block(); } /** * 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. @@ -455,7 +381,7 @@ public DesktopInner update(String resourceGroupName, String applicationGroupName /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -467,23 +393,15 @@ public DesktopInner update(String resourceGroupName, String applicationGroupName * @return desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -495,35 +413,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, + initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -536,24 +436,15 @@ private Mono> listSinglePageAsync( * @return desktopList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -566,31 +457,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -602,12 +477,8 @@ private Mono> listSinglePageAsync( * @return desktopList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -615,7 +486,7 @@ public PagedFlux listAsync( /** * 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. @@ -635,7 +506,7 @@ public PagedFlux listAsync(String resourceGroupName, String applic /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -648,23 +519,15 @@ public PagedFlux listAsync(String resourceGroupName, String applic * @return desktopList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * 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. @@ -683,7 +546,7 @@ public PagedIterable list(String resourceGroupName, String applica /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -696,22 +559,16 @@ public PagedIterable list(String resourceGroupName, String applica * @return desktopList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -723,31 +580,20 @@ private Mono> listNextSinglePageAsync(String nextLin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -760,23 +606,13 @@ private Mono> listNextSinglePageAsync(String nextLin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java index d0c88cc6d185..018ae1a083ea 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/DesktopsImpl.java @@ -22,22 +22,18 @@ public final class DesktopsImpl implements Desktops { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public DesktopsImpl( - DesktopsClient innerClient, + public DesktopsImpl(DesktopsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String applicationGroupName, String desktopName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, applicationGroupName, desktopName, context); + public Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, applicationGroupName, desktopName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DesktopImpl(inner.getValue(), this.manager())); } else { return null; @@ -53,21 +49,12 @@ public Desktop get(String resourceGroupName, String applicationGroupName, String } } - public Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - String desktopName, - DesktopPatch desktop, - Context context) { - Response inner = - this - .serviceClient() - .updateWithResponse(resourceGroupName, applicationGroupName, desktopName, desktop, context); + public Response updateWithResponse(String resourceGroupName, String applicationGroupName, + String desktopName, DesktopPatch desktop, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, applicationGroupName, desktopName, desktop, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DesktopImpl(inner.getValue(), this.manager())); } else { return null; @@ -85,21 +72,14 @@ public Desktop update(String resourceGroupName, String applicationGroupName, Str public PagedIterable list(String resourceGroupName, String applicationGroupName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); - return Utils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DesktopImpl(inner1, this.manager())); } private DesktopsClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java index 5a674c57bce1..a20b790faf34 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ExpandMsixImageImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.desktopvirtualization.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; @@ -17,8 +18,7 @@ public final class ExpandMsixImageImpl implements ExpandMsixImage { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - ExpandMsixImageImpl( - ExpandMsixImageInner innerObject, + ExpandMsixImageImpl(ExpandMsixImageInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -36,6 +36,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String packageAlias() { return this.innerModel().packageAlias(); } @@ -98,6 +102,14 @@ public List packageApplications() { } } + public String certificateName() { + return this.innerModel().certificateName(); + } + + public OffsetDateTime certificateExpiry() { + return this.innerModel().certificateExpiry(); + } + public ExpandMsixImageInner innerModel() { return this.innerObject; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java index c1f35897f130..798fc1f0ba1e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolImpl.java @@ -14,14 +14,15 @@ import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfo; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfoPatch; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenList; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan; import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku; @@ -150,6 +151,15 @@ public List applicationGroupReferences() { } } + public List appAttachPackageReferences() { + List inner = this.innerModel().appAttachPackageReferences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String ssoadfsAuthority() { return this.innerModel().ssoadfsAuthority(); } @@ -227,27 +237,23 @@ public HostPoolImpl withExistingResourceGroup(String resourceGroupName) { } public HostPool create() { - this.innerObject = - serviceManager - .serviceClient() - .getHostPools() - .createOrUpdateWithResponse(resourceGroupName, hostPoolName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getHostPools() + .createOrUpdateWithResponse(resourceGroupName, hostPoolName, this.innerModel(), Context.NONE) + .getValue(); return this; } public HostPool create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHostPools() - .createOrUpdateWithResponse(resourceGroupName, hostPoolName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getHostPools() + .createOrUpdateWithResponse(resourceGroupName, hostPoolName, this.innerModel(), context) + .getValue(); return this; } - HostPoolImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + HostPoolImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new HostPoolInner(); this.serviceManager = serviceManager; this.hostPoolName = name; @@ -259,57 +265,47 @@ public HostPoolImpl update() { } public HostPool apply() { - this.innerObject = - serviceManager - .serviceClient() - .getHostPools() - .updateWithResponse(resourceGroupName, hostPoolName, updateHostPool, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getHostPools() + .updateWithResponse(resourceGroupName, hostPoolName, updateHostPool, Context.NONE) + .getValue(); return this; } public HostPool apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHostPools() - .updateWithResponse(resourceGroupName, hostPoolName, updateHostPool, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getHostPools() + .updateWithResponse(resourceGroupName, hostPoolName, updateHostPool, context) + .getValue(); return this; } - HostPoolImpl( - HostPoolInner innerObject, + HostPoolImpl(HostPoolInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.hostPoolName = Utils.getValueFromIdByName(innerObject.id(), "hostPools"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hostPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hostPools"); } public HostPool refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getHostPools() - .getByResourceGroupWithResponse(resourceGroupName, hostPoolName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getHostPools() + .getByResourceGroupWithResponse(resourceGroupName, hostPoolName, Context.NONE) + .getValue(); return this; } public HostPool refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getHostPools() - .getByResourceGroupWithResponse(resourceGroupName, hostPoolName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getHostPools() + .getByResourceGroupWithResponse(resourceGroupName, hostPoolName, context) + .getValue(); return this; } public Response retrieveRegistrationTokenWithResponse(Context context) { - return serviceManager - .hostPools() + return serviceManager.hostPools() .retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); } @@ -317,6 +313,14 @@ public RegistrationInfo retrieveRegistrationToken() { return serviceManager.hostPools().retrieveRegistrationToken(resourceGroupName, hostPoolName); } + public Response listRegistrationTokensWithResponse(Context context) { + return serviceManager.hostPools().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); + } + + public RegistrationTokenList listRegistrationTokens() { + return serviceManager.hostPools().listRegistrationTokens(resourceGroupName, hostPoolName); + } + public HostPoolImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java index fe4dac4abd98..8a313ac02d06 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolPropertiesImpl.java @@ -8,8 +8,8 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; import com.azure.resourcemanager.desktopvirtualization.models.AgentUpdateProperties; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolProperties; -import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.HostpoolPublicNetworkAccess; +import com.azure.resourcemanager.desktopvirtualization.models.HostPoolType; import com.azure.resourcemanager.desktopvirtualization.models.LoadBalancerType; import com.azure.resourcemanager.desktopvirtualization.models.PersonalDesktopAssignmentType; import com.azure.resourcemanager.desktopvirtualization.models.PreferredAppGroupType; @@ -24,8 +24,7 @@ public final class HostPoolPropertiesImpl implements HostPoolProperties { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - HostPoolPropertiesImpl( - HostPoolPropertiesInner innerObject, + HostPoolPropertiesImpl(HostPoolPropertiesInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -93,6 +92,15 @@ public List applicationGroupReferences() { } } + public List appAttachPackageReferences() { + List inner = this.innerModel().appAttachPackageReferences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String ssoadfsAuthority() { return this.innerModel().ssoadfsAuthority(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java index 6a4a43fd2ab3..61144cdaf015 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsClientImpl.java @@ -33,26 +33,33 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolList; import com.azure.resourcemanager.desktopvirtualization.models.HostPoolPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in HostPoolsClient. */ +/** + * An instance of this class provides access to all the operations defined in HostPoolsClient. + */ public final class HostPoolsClientImpl implements HostPoolsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final HostPoolsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of HostPoolsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ HostPoolsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(HostPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(HostPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -63,133 +70,100 @@ public final class HostPoolsClientImpl implements HostPoolsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface HostPoolsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @HeaderParam("Accept") String accept, - Context context); + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") HostPoolInner hostPool, - @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") HostPoolInner hostPool, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") HostPoolPatch hostPool, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") HostPoolPatch hostPool, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> retrieveRegistrationToken( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @HeaderParam("Accept") String accept, - Context context); + Mono> retrieveRegistrationToken(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRegistrationTokens(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -198,19 +172,15 @@ Mono> listNext( * @return a host pool along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hostPoolName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String hostPoolName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -221,23 +191,14 @@ public Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 context The context to associate with this operation. @@ -247,19 +208,15 @@ public Mono> getByResourceGroupWithResponseAsync( * @return a host pool along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String hostPoolName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -270,20 +227,13 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); } /** * 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. @@ -299,7 +249,7 @@ public Mono getByResourceGroupAsync(String resourceGroupName, Str /** * 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 context The context to associate with this operation. @@ -309,14 +259,14 @@ public Mono getByResourceGroupAsync(String resourceGroupName, Str * @return a host pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String hostPoolName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, hostPoolName, context).block(); } /** * 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. @@ -331,7 +281,7 @@ public HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoo /** * 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. @@ -341,19 +291,15 @@ public HostPoolInner getByResourceGroup(String resourceGroupName, String hostPoo * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -369,24 +315,14 @@ public Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - hostPool, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -397,19 +333,15 @@ public Mono> createOrUpdateWithResponseAsync( * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostPoolName, HostPoolInner hostPool, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -425,21 +357,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - hostPool, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context); } /** * 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. @@ -449,15 +373,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return represents a HostPool definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String hostPoolName, HostPoolInner hostPool) { + public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool) { return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. @@ -468,14 +392,14 @@ public Mono createOrUpdateAsync( * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String hostPoolName, HostPoolInner hostPool, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolInner hostPool, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); } /** * 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. @@ -491,7 +415,7 @@ public HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolNam /** * 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. @@ -503,16 +427,12 @@ public HostPoolInner createOrUpdate(String resourceGroupName, String hostPoolNam @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -523,24 +443,14 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - force, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -551,19 +461,15 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, Boolean force, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, Boolean force, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -574,21 +480,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - force, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, force, accept, context); } /** * 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. @@ -604,7 +502,7 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName) { /** * 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. @@ -615,14 +513,14 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName) { * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String hostPoolName, Boolean force, Context context) { + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, + Context context) { return deleteWithResponseAsync(resourceGroupName, hostPoolName, force, context).block(); } /** * 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. @@ -637,7 +535,7 @@ public void delete(String resourceGroupName, String hostPoolName) { /** * 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. @@ -647,19 +545,15 @@ public void delete(String resourceGroupName, String hostPoolName) { * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String hostPoolName, HostPoolPatch hostPool) { + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -673,24 +567,14 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - hostPool, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, hostPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -701,19 +585,15 @@ public Mono> updateWithResponseAsync( * @return represents a HostPool definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -727,21 +607,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - hostPool, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, hostPool, accept, context); } /** * 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. @@ -758,7 +630,7 @@ public Mono updateAsync(String resourceGroupName, String hostPool /** * 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. @@ -769,14 +641,14 @@ public Mono updateAsync(String resourceGroupName, String hostPool * @return represents a HostPool definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String hostPoolName, HostPoolPatch hostPool, Context context) { + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + HostPoolPatch hostPool, Context context) { return updateWithResponseAsync(resourceGroupName, hostPoolName, hostPool, context).block(); } /** * 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. @@ -792,7 +664,7 @@ public HostPoolInner update(String resourceGroupName, String hostPoolName) { /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -803,19 +675,15 @@ public HostPoolInner update(String resourceGroupName, String hostPoolName) { * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -823,34 +691,17 @@ private Mono> listByResourceGroupSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -862,19 +713,15 @@ private Mono> listByResourceGroupSinglePageAsync( * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -882,31 +729,15 @@ private Mono> listByResourceGroupSinglePageAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -917,8 +748,8 @@ private Mono> listByResourceGroupSinglePageAsync( * @return hostPoolList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); @@ -926,7 +757,7 @@ public PagedFlux listByResourceGroupAsync( /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -945,7 +776,7 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupNam /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -957,8 +788,8 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupNam * @return hostPoolList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); @@ -966,7 +797,7 @@ private PagedFlux listByResourceGroupAsync( /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -983,7 +814,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -995,15 +826,15 @@ public PagedIterable listByResourceGroup(String resourceGroupName * @return hostPoolList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); } /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1013,49 +844,28 @@ public PagedIterable listByResourceGroup( * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1066,46 +876,28 @@ private Mono> listSinglePageAsync( * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), pageSize, + isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1116,14 +908,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(pageSize, isDescending, initialSkip), + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List hostPools in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return hostPoolList as paginated response with {@link PagedFlux}. @@ -1133,14 +924,13 @@ public PagedFlux listAsync() { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(pageSize, isDescending, initialSkip), + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1151,16 +941,15 @@ public PagedFlux listAsync() { * @return hostPoolList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), + private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List hostPools in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return hostPoolList as paginated response with {@link PagedIterable}. @@ -1175,7 +964,7 @@ public PagedIterable list() { /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1186,36 +975,32 @@ public PagedIterable list() { * @return hostPoolList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); } /** * Registration token of the 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retrieveRegistrationTokenWithResponseAsync( - String resourceGroupName, String hostPoolName) { + public Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + String hostPoolName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1227,45 +1012,33 @@ public Mono> retrieveRegistrationTokenWithRespon final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .retrieveRegistrationToken( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - accept, - context)) + context -> service.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Registration token of the 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return represents a RegistrationInfo definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveRegistrationTokenWithResponseAsync( - String resourceGroupName, String hostPoolName, Context context) { + private Mono> retrieveRegistrationTokenWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1276,20 +1049,13 @@ private Mono> retrieveRegistrationTokenWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .retrieveRegistrationToken( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - accept, - context); + return service.retrieveRegistrationToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); } /** * Registration token of the 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. @@ -1305,7 +1071,7 @@ public Mono retrieveRegistrationTokenAsync(String resourc /** * Registration token of the 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 context The context to associate with this operation. @@ -1315,14 +1081,14 @@ public Mono retrieveRegistrationTokenAsync(String resourc * @return represents a RegistrationInfo definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveRegistrationTokenWithResponse( - String resourceGroupName, String hostPoolName, Context context) { + public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, + String hostPoolName, Context context) { return retrieveRegistrationTokenWithResponseAsync(resourceGroupName, hostPoolName, context).block(); } /** * Registration token of the 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. @@ -1335,11 +1101,129 @@ public RegistrationInfoInner retrieveRegistrationToken(String resourceGroupName, return retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); } + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, + String hostPoolName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRegistrationTokensWithResponseAsync(String resourceGroupName, + String hostPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (hostPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listRegistrationTokens(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, accept, context); + } + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listRegistrationTokensAsync(String resourceGroupName, String hostPoolName) { + return listRegistrationTokensWithResponseAsync(resourceGroupName, hostPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listRegistrationTokensWithResponse(String resourceGroupName, + String hostPoolName, Context context) { + return listRegistrationTokensWithResponseAsync(resourceGroupName, hostPoolName, context).block(); + } + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistrationTokenListInner listRegistrationTokens(String resourceGroupName, String hostPoolName) { + return listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); + } + /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1351,32 +1235,22 @@ private Mono> listByResourceGroupNextSinglePageAsyn return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1384,37 +1258,26 @@ private Mono> listByResourceGroupNextSinglePageAsyn * @return hostPoolList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1426,31 +1289,20 @@ private Mono> listNextSinglePageAsync(String nextLi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1463,23 +1315,13 @@ private Mono> listNextSinglePageAsync(String nextLi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java index 7ae460fcf6fa..f4dbfba46252 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/HostPoolsImpl.java @@ -12,9 +12,11 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.HostPoolsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; import com.azure.resourcemanager.desktopvirtualization.models.HostPool; import com.azure.resourcemanager.desktopvirtualization.models.HostPools; import com.azure.resourcemanager.desktopvirtualization.models.RegistrationInfo; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenList; public final class HostPoolsImpl implements HostPools { private static final ClientLogger LOGGER = new ClientLogger(HostPoolsImpl.class); @@ -23,22 +25,18 @@ public final class HostPoolsImpl implements HostPools { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public HostPoolsImpl( - HostPoolsClient innerClient, + public HostPoolsImpl(HostPoolsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String hostPoolName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hostPoolName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String hostPoolName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hostPoolName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new HostPoolImpl(inner.getValue(), this.manager())); } else { return null; @@ -54,8 +52,8 @@ public HostPool getByResourceGroup(String resourceGroupName, String hostPoolName } } - public Response deleteWithResponse( - String resourceGroupName, String hostPoolName, Boolean force, Context context) { + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, Boolean force, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, hostPoolName, force, context); } @@ -65,35 +63,32 @@ public void delete(String resourceGroupName, String hostPoolName) { public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); } public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { PagedIterable inner = this.serviceClient().list(pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HostPoolImpl(inner1, this.manager())); } - public Response retrieveRegistrationTokenWithResponse( - String resourceGroupName, String hostPoolName, Context context) { - Response inner = - this.serviceClient().retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); + public Response retrieveRegistrationTokenWithResponse(String resourceGroupName, + String hostPoolName, Context context) { + Response inner + = this.serviceClient().retrieveRegistrationTokenWithResponse(resourceGroupName, hostPoolName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RegistrationInfoImpl(inner.getValue(), this.manager())); } else { return null; @@ -109,79 +104,80 @@ public RegistrationInfo retrieveRegistrationToken(String resourceGroupName, Stri } } + public Response listRegistrationTokensWithResponse(String resourceGroupName, + String hostPoolName, Context context) { + Response inner + = this.serviceClient().listRegistrationTokensWithResponse(resourceGroupName, hostPoolName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RegistrationTokenListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName) { + RegistrationTokenListInner inner = this.serviceClient().listRegistrationTokens(resourceGroupName, hostPoolName); + if (inner != null) { + return new RegistrationTokenListImpl(inner, this.manager()); + } else { + return null; + } + } + public HostPool getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, hostPoolName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, hostPoolName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } Boolean localForce = null; this.deleteWithResponse(resourceGroupName, hostPoolName, localForce, Context.NONE); } public Response deleteByIdWithResponse(String id, Boolean force, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } return this.deleteWithResponse(resourceGroupName, hostPoolName, force, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java index 31da5db4dea2..312a8394206d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesClientImpl.java @@ -33,22 +33,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MsixImagesClient. */ +/** + * An instance of this class provides access to all the operations defined in MsixImagesClient. + */ public final class MsixImagesClientImpl implements MsixImagesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MsixImagesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of MsixImagesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MsixImagesClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(MsixImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(MsixImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,35 +65,27 @@ public final class MsixImagesClientImpl implements MsixImagesClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface MsixImagesService { - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> expand( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @BodyParam("application/json") MsixImageUri msixImageUri, - @HeaderParam("Accept") String accept, + Mono> expand(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @BodyParam("application/json") MsixImageUri msixImageUri, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> expandNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> expandNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -97,19 +95,15 @@ Mono> expandNext( * @return expandMsixImageList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandSinglePageAsync( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri) { + private Mono> expandSinglePageAsync(String resourceGroupName, + String hostPoolName, MsixImageUri msixImageUri) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -125,33 +119,16 @@ private Mono> expandSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .expand( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixImageUri, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.expand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixImageUri, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -162,19 +139,15 @@ private Mono> expandSinglePageAsync( * @return expandMsixImageList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> expandSinglePageAsync( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context) { + private Mono> expandSinglePageAsync(String resourceGroupName, + String hostPoolName, MsixImageUri msixImageUri, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -191,29 +164,15 @@ private Mono> expandSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .expand( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixImageUri, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .expand(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixImageUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -223,16 +182,15 @@ private Mono> expandSinglePageAsync( * @return expandMsixImageList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux expandAsync( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri) { - return new PagedFlux<>( - () -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageUri), + public PagedFlux expandAsync(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri) { + return new PagedFlux<>(() -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageUri), nextLink -> expandNextSinglePageAsync(nextLink)); } /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -243,16 +201,15 @@ public PagedFlux expandAsync( * @return expandMsixImageList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux expandAsync( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context) { - return new PagedFlux<>( - () -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageUri, context), + private PagedFlux expandAsync(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri, Context context) { + return new PagedFlux<>(() -> expandSinglePageAsync(resourceGroupName, hostPoolName, msixImageUri, context), nextLink -> expandNextSinglePageAsync(nextLink, context)); } /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -262,14 +219,14 @@ private PagedFlux expandAsync( * @return expandMsixImageList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri) { + public PagedIterable expand(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri) { return new PagedIterable<>(expandAsync(resourceGroupName, hostPoolName, msixImageUri)); } /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -280,16 +237,15 @@ public PagedIterable expand( * @return expandMsixImageList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context) { + public PagedIterable expand(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri, Context context) { return new PagedIterable<>(expandAsync(resourceGroupName, hostPoolName, msixImageUri, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -301,31 +257,20 @@ private Mono> expandNextSinglePageAsync(Stri return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.expandNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.expandNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -338,23 +283,13 @@ private Mono> expandNextSinglePageAsync(Stri return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .expandNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.expandNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java index 859b1c66bc4b..3b19eb67bb19 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixImagesImpl.java @@ -10,8 +10,8 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.MsixImagesClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; -import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; import com.azure.resourcemanager.desktopvirtualization.models.MsixImages; +import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; public final class MsixImagesImpl implements MsixImages { private static final ClientLogger LOGGER = new ClientLogger(MsixImagesImpl.class); @@ -20,25 +20,24 @@ public final class MsixImagesImpl implements MsixImages { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public MsixImagesImpl( - MsixImagesClient innerClient, + public MsixImagesImpl(MsixImagesClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri) { - PagedIterable inner = - this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageUri); - return Utils.mapPage(inner, inner1 -> new ExpandMsixImageImpl(inner1, this.manager())); + public PagedIterable expand(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri) { + PagedIterable inner + = this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpandMsixImageImpl(inner1, this.manager())); } - public PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context) { - PagedIterable inner = - this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageUri, context); - return Utils.mapPage(inner, inner1 -> new ExpandMsixImageImpl(inner1, this.manager())); + public PagedIterable expand(String resourceGroupName, String hostPoolName, + MsixImageUri msixImageUri, Context context) { + PagedIterable inner + = this.serviceClient().expand(resourceGroupName, hostPoolName, msixImageUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpandMsixImageImpl(inner1, this.manager())); } private MsixImagesClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java index ec574fed9577..12b4482726bd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackageImpl.java @@ -117,29 +117,25 @@ public MsixPackageImpl withExistingHostPool(String resourceGroupName, String hos } public MsixPackage create() { - this.innerObject = - serviceManager - .serviceClient() - .getMsixPackages() - .createOrUpdateWithResponse( - resourceGroupName, hostPoolName, msixPackageFullName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMsixPackages() + .createOrUpdateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public MsixPackage create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMsixPackages() - .createOrUpdateWithResponse( - resourceGroupName, hostPoolName, msixPackageFullName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMsixPackages() + .createOrUpdateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, this.innerModel(), + context) + .getValue(); return this; } - MsixPackageImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + MsixPackageImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new MsixPackageInner(); this.serviceManager = serviceManager; this.msixPackageFullName = name; @@ -151,53 +147,43 @@ public MsixPackageImpl update() { } public MsixPackage apply() { - this.innerObject = - serviceManager - .serviceClient() - .getMsixPackages() - .updateWithResponse( - resourceGroupName, hostPoolName, msixPackageFullName, updateMsixPackage, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMsixPackages() + .updateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, updateMsixPackage, Context.NONE) + .getValue(); return this; } public MsixPackage apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMsixPackages() - .updateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, updateMsixPackage, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMsixPackages() + .updateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, updateMsixPackage, context) + .getValue(); return this; } - MsixPackageImpl( - MsixPackageInner innerObject, + MsixPackageImpl(MsixPackageInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); - this.hostPoolName = Utils.getValueFromIdByName(innerObject.id(), "hostPools"); - this.msixPackageFullName = Utils.getValueFromIdByName(innerObject.id(), "msixPackages"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.hostPoolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hostPools"); + this.msixPackageFullName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "msixPackages"); } public MsixPackage refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getMsixPackages() - .getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMsixPackages() + .getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE) + .getValue(); return this; } public MsixPackage refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getMsixPackages() - .getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getMsixPackages() + .getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context) + .getValue(); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java index 8ff9932a8c52..6cd7c1455566 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesClientImpl.java @@ -35,22 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixPackagePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MsixPackagesClient. */ +/** + * An instance of this class provides access to all the operations defined in MsixPackagesClient. + */ public final class MsixPackagesClientImpl implements MsixPackagesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MsixPackagesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of MsixPackagesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MsixPackagesClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(MsixPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(MsixPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,99 +67,69 @@ public final class MsixPackagesClientImpl implements MsixPackagesClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface MsixPackagesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("msixPackageFullName") String msixPackageFullName, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("msixPackageFullName") String msixPackageFullName, - @BodyParam("application/json") MsixPackageInner msixPackage, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") MsixPackageInner msixPackage, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("msixPackageFullName") String msixPackageFullName, - @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("msixPackageFullName") String msixPackageFullName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("msixPackageFullName") String msixPackageFullName, - @BodyParam("application/json") MsixPackagePatch msixPackage, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") MsixPackagePatch msixPackage, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -163,19 +139,15 @@ Mono> listNext( * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName) { + public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -190,24 +162,14 @@ public Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -218,19 +180,15 @@ public Mono> getWithResponseAsync( * @return a msixpackage along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -245,21 +203,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixPackageFullName, accept, context); } /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -276,7 +226,7 @@ public Mono getAsync(String resourceGroupName, String hostPool /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -287,14 +237,14 @@ public Mono getAsync(String resourceGroupName, String hostPool * @return a msixpackage along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { return getWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); } /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -310,7 +260,7 @@ public MsixPackageInner get(String resourceGroupName, String hostPoolName, Strin /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -321,19 +271,15 @@ public MsixPackageInner get(String resourceGroupName, String hostPoolName, Strin * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -353,25 +299,15 @@ public Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - msixPackage, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -383,23 +319,15 @@ public Mono> createOrUpdateWithResponseAsync( * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String msixPackageFullName, - MsixPackageInner msixPackage, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -419,22 +347,14 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - msixPackage, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, accept, + context); } /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -445,15 +365,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage) { + public Mono createOrUpdateAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage) { return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -465,20 +385,15 @@ public Mono createOrUpdateAsync( * @return schema for MSIX Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String hostPoolName, - String msixPackageFullName, - MsixPackageInner msixPackage, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, context) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackageInner msixPackage, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + context).block(); } /** * Create or update a MSIX package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -489,16 +404,15 @@ public Response createOrUpdateWithResponse( * @return schema for MSIX Package properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MsixPackageInner createOrUpdate( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackageInner msixPackage) { - return createOrUpdateWithResponse( - resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, Context.NONE) - .getValue(); + public MsixPackageInner createOrUpdate(String resourceGroupName, String hostPoolName, String msixPackageFullName, + MsixPackageInner msixPackage) { + return createOrUpdateWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + Context.NONE).getValue(); } /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -508,19 +422,15 @@ public MsixPackageInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -535,24 +445,14 @@ public Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -563,19 +463,15 @@ public Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -590,21 +486,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixPackageFullName, accept, context); } /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -621,7 +509,7 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName, Str /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -632,14 +520,14 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName, Str * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context) { return deleteWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, context).block(); } /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -654,7 +542,7 @@ public void delete(String resourceGroupName, String hostPoolName, String msixPac /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -665,19 +553,15 @@ public void delete(String resourceGroupName, String hostPoolName, String msixPac * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName, MsixPackagePatch msixPackage) { + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -695,25 +579,15 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - msixPackage, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -725,23 +599,15 @@ public Mono> updateWithResponseAsync( * @return schema for MSIX Package properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String msixPackageFullName, - MsixPackagePatch msixPackage, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -759,22 +625,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - msixPackageFullName, - msixPackage, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, accept, context); } /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -784,8 +641,8 @@ private Mono> updateWithResponseAsync( * @return schema for MSIX Package properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String hostPoolName, String msixPackageFullName) { + public Mono updateAsync(String resourceGroupName, String hostPoolName, + String msixPackageFullName) { final MsixPackagePatch msixPackage = null; return updateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -793,7 +650,7 @@ public Mono updateAsync( /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -805,19 +662,15 @@ public Mono updateAsync( * @return schema for MSIX Package properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String hostPoolName, - String msixPackageFullName, - MsixPackagePatch msixPackage, - Context context) { + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, MsixPackagePatch msixPackage, Context context) { return updateWithResponseAsync(resourceGroupName, hostPoolName, msixPackageFullName, msixPackage, context) .block(); } /** * Update an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -835,7 +688,7 @@ public MsixPackageInner update(String resourceGroupName, String hostPoolName, St /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -847,19 +700,15 @@ public MsixPackageInner update(String resourceGroupName, String hostPoolName, St * @return msixPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -870,35 +719,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -911,24 +742,15 @@ private Mono> listSinglePageAsync( * @return msixPackageList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -940,31 +762,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -976,8 +782,8 @@ private Mono> listSinglePageAsync( * @return msixPackageList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -985,7 +791,7 @@ public PagedFlux listAsync( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1005,7 +811,7 @@ public PagedFlux listAsync(String resourceGroupName, String ho /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1018,13 +824,8 @@ public PagedFlux listAsync(String resourceGroupName, String ho * @return msixPackageList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -1032,7 +833,7 @@ private PagedFlux listAsync( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1050,7 +851,7 @@ public PagedIterable list(String resourceGroupName, String hos /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1063,22 +864,16 @@ public PagedIterable list(String resourceGroupName, String hos * @return msixPackageList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1090,31 +885,20 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1127,23 +911,13 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java index ab3fad5320b7..53c623e98339 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/MsixPackagesImpl.java @@ -21,22 +21,18 @@ public final class MsixPackagesImpl implements MsixPackages { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public MsixPackagesImpl( - MsixPackagesClient innerClient, + public MsixPackagesImpl(MsixPackagesClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context); + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String msixPackageFullName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MsixPackageImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,8 +48,8 @@ public MsixPackage get(String resourceGroupName, String hostPoolName, String msi } } - public Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context); } @@ -63,121 +59,88 @@ public void delete(String resourceGroupName, String hostPoolName, String msixPac public PagedIterable list(String resourceGroupName, String hostPoolName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, hostPoolName); - return Utils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MsixPackageImpl(inner1, this.manager())); } public MsixPackage getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } - String msixPackageFullName = Utils.getValueFromIdByName(id, "msixPackages"); + String msixPackageFullName = ResourceManagerUtils.getValueFromIdByName(id, "msixPackages"); if (msixPackageFullName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); } return this.getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } - String msixPackageFullName = Utils.getValueFromIdByName(id, "msixPackages"); + String msixPackageFullName = ResourceManagerUtils.getValueFromIdByName(id, "msixPackages"); if (msixPackageFullName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); } return this.getWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } - String msixPackageFullName = Utils.getValueFromIdByName(id, "msixPackages"); + String msixPackageFullName = ResourceManagerUtils.getValueFromIdByName(id, "msixPackages"); if (msixPackageFullName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); } this.deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String hostPoolName = Utils.getValueFromIdByName(id, "hostPools"); + String hostPoolName = ResourceManagerUtils.getValueFromIdByName(id, "hostPools"); if (hostPoolName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hostPools'.", id))); } - String msixPackageFullName = Utils.getValueFromIdByName(id, "msixPackages"); + String msixPackageFullName = ResourceManagerUtils.getValueFromIdByName(id, "msixPackages"); if (msixPackageFullName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'msixPackages'.", id))); } return this.deleteWithResponse(resourceGroupName, hostPoolName, msixPackageFullName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java index b67605b22e27..9c0ae7519cd3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,95 +62,71 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DesktopVirtualization/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations as paginated response with {@link PagedFlux}. @@ -156,7 +138,7 @@ public PagedFlux listAsync() { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -165,13 +147,13 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations as paginated response with {@link PagedIterable}. @@ -183,7 +165,7 @@ public PagedIterable list() { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -197,14 +179,13 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -212,62 +193,41 @@ private Mono> listNextSinglePageAs return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java index 3f70c8f7a57c..0fa3ba55ab1a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/OperationsImpl.java @@ -19,8 +19,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public OperationsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java index 56039e66e293..3b04ddc4c882 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionWithSystemDataImpl.java @@ -10,14 +10,15 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; public final class PrivateEndpointConnectionWithSystemDataImpl implements PrivateEndpointConnectionWithSystemData { private PrivateEndpointConnectionWithSystemDataInner innerObject; private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - PrivateEndpointConnectionWithSystemDataImpl( - PrivateEndpointConnectionWithSystemDataInner innerObject, + PrivateEndpointConnectionWithSystemDataImpl(PrivateEndpointConnectionWithSystemDataInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -35,6 +36,19 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public PrivateEndpoint privateEndpoint() { return this.innerModel().privateEndpoint(); } @@ -47,10 +61,6 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { return this.innerModel().provisioningState(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - public PrivateEndpointConnectionWithSystemDataInner innerModel() { return this.innerObject; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java index af7c055d0ac6..1c14072313de 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsClientImpl.java @@ -34,24 +34,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionListResultWithSystemData; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateEndpointConnectionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateEndpointConnectionsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -62,175 +66,129 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByWorkspace( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByWorkspace( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> getByWorkspace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByWorkspace( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + Mono> deleteByWorkspace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateByWorkspace( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnection connection, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnection connection, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, + Mono> getByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, + Mono> deleteByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnection connection, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnection connection, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByWorkspaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List private endpoint connections. - * + * * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync( - String resourceGroupName, String workspaceName) { + private Mono> + listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -241,55 +199,36 @@ private Mono> listBy } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List private endpoint connections. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> + listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -301,47 +240,33 @@ private Mono> listBy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List private endpoint connections. - * + * * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByWorkspaceAsync( - String resourceGroupName, String workspaceName) { - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + public PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** * List private endpoint connections. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -349,36 +274,35 @@ public PagedFlux listByWorkspaceAs * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync( - String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + private PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName, Context context) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); } /** * List private endpoint connections. - * + * * @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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName) { + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName) { return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); } /** * List private endpoint connections. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -386,21 +310,21 @@ public PagedIterable listByWorkspa * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName, Context context) { + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context) { return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); } /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -410,16 +334,12 @@ public PagedIterable listByWorkspa public Mono> getByWorkspaceWithResponseAsync( String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -429,35 +349,24 @@ public Mono> getByWorkspa return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - accept, - context)) + .withContext(context -> service.getByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -468,16 +377,12 @@ public Mono> getByWorkspa private Mono> getByWorkspaceWithResponseAsync( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -487,51 +392,42 @@ private Mono> getByWorksp return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - accept, - context); + return service.getByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, accept, + context); } /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByWorkspaceAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public Mono getByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName) { return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -539,57 +435,53 @@ public Mono getByWorkspaceAsync( * @return a private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + public Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context) { return getByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) .block(); } /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner getByWorkspace( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public PrivateEndpointConnectionWithSystemDataInner getByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { return getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) .getValue(); } /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -599,35 +491,24 @@ public Mono> deleteByWorkspaceWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .deleteByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - accept, - context)) + .withContext(context -> service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -635,19 +516,15 @@ public Mono> deleteByWorkspaceWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByWorkspaceWithResponseAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + private Mono> deleteByWorkspaceWithResponseAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -657,51 +534,42 @@ private Mono> deleteByWorkspaceWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .deleteByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - accept, - context); + return service.deleteByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, accept, + context); } /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByWorkspaceAsync( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public Mono deleteByWorkspaceAsync(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) .flatMap(ignored -> Mono.empty()); } /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -709,61 +577,54 @@ public Mono deleteByWorkspaceAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return deleteByWorkspaceWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, context) - .block(); + public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { + return deleteByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + context).block(); } /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteByWorkspace( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public void deleteByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); } /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -773,10 +634,8 @@ public Mono> updateByWork return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (connection == null) { return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); @@ -785,55 +644,38 @@ public Mono> updateByWork } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - connection, - accept, - context)) + .withContext(context -> service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateByWorkspaceWithResponseAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, - Context context) { + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnection connection, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -843,10 +685,8 @@ private Mono> updateByWor return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (connection == null) { return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); @@ -855,26 +695,18 @@ private Mono> updateByWor } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - privateEndpointConnectionName, - connection, - accept, - context); + return service.updateByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, accept, context); } /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -882,23 +714,19 @@ private Mono> updateByWor * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByWorkspaceAsync( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - return updateByWorkspaceWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono updateByWorkspaceAsync(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { + return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -908,23 +736,19 @@ public Mono updateByWorkspaceAsync */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateByWorkspaceWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, - Context context) { - return updateByWorkspaceWithResponseAsync( - resourceGroupName, workspaceName, privateEndpointConnectionName, connection, context) - .block(); + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, + PrivateEndpointConnection connection, Context context) { + return updateByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, context).block(); } /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -932,19 +756,15 @@ public Response updateByWorkspaceW * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner updateByWorkspace( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - return updateByWorkspaceWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, connection, Context.NONE) - .getValue(); + public PrivateEndpointConnectionWithSystemDataInner updateByWorkspace(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { + return updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, + connection, Context.NONE).getValue(); } /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -953,23 +773,19 @@ public PrivateEndpointConnectionWithSystemDataInner updateByWorkspace( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByHostPoolSinglePageAsync( String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -980,35 +796,18 @@ private Mono> listBy } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1018,28 +817,20 @@ private Mono> listBy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, + String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1051,31 +842,15 @@ private Mono> listBy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1085,11 +860,11 @@ private Mono> listBy * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); @@ -1097,18 +872,18 @@ public PagedFlux listByHostPoolAsy /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName) { + public PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; @@ -1119,7 +894,7 @@ public PagedFlux listByHostPoolAsy /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1130,37 +905,29 @@ public PagedFlux listByHostPoolAsy * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listByHostPoolSinglePageAsync( - resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + private PagedFlux listByHostPoolAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool( - String resourceGroupName, String hostPoolName) { + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; @@ -1170,7 +937,7 @@ public PagedIterable listByHostPoo /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1181,27 +948,22 @@ public PagedIterable listByHostPoo * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1211,16 +973,12 @@ public PagedIterable listByHostPoo public Mono> getByHostPoolWithResponseAsync( String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1230,35 +988,24 @@ public Mono> getByHostPoo return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - privateEndpointConnectionName, - accept, - context)) + .withContext(context -> service.getByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1269,16 +1016,12 @@ public Mono> getByHostPoo private Mono> getByHostPoolWithResponseAsync( String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1288,51 +1031,42 @@ private Mono> getByHostPo return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - privateEndpointConnectionName, - accept, - context); + return service.getByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context); } /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByHostPoolAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + public Mono getByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName) { return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1340,57 +1074,53 @@ public Mono getByHostPoolAsync( * @return a private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { + public Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context) { return getByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, context) .block(); } /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner getByHostPool( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + public PrivateEndpointConnectionWithSystemDataInner getByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { return getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, Context.NONE) .getValue(); } /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + public Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1400,35 +1130,24 @@ public Mono> deleteByHostPoolWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .deleteByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - privateEndpointConnectionName, - accept, - context)) + .withContext(context -> service.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1436,19 +1155,15 @@ public Mono> deleteByHostPoolWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByHostPoolWithResponseAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { + private Mono> deleteByHostPoolWithResponseAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1458,51 +1173,42 @@ private Mono> deleteByHostPoolWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .deleteByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - privateEndpointConnectionName, - accept, - context); + return service.deleteByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, accept, + context); } /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByHostPoolAsync( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { + public Mono deleteByHostPoolAsync(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName) .flatMap(ignored -> Mono.empty()); } /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1510,20 +1216,19 @@ public Mono deleteByHostPoolAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { - return deleteByHostPoolWithResponseAsync( - resourceGroupName, hostPoolName, privateEndpointConnectionName, context) - .block(); + public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context) { + return deleteByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + context).block(); } /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1535,35 +1240,29 @@ public void deleteByHostPool(String resourceGroupName, String hostPoolName, Stri /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1573,10 +1272,8 @@ public Mono> updateByHost return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (connection == null) { return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); @@ -1585,55 +1282,38 @@ public Mono> updateByHost } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - privateEndpointConnectionName, - connection, - accept, - context)) + .withContext(context -> service.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateByHostPoolWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, - Context context) { + String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, + PrivateEndpointConnection connection, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1643,10 +1323,8 @@ private Mono> updateByHos return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (connection == null) { return Mono.error(new IllegalArgumentException("Parameter connection is required and cannot be null.")); @@ -1655,26 +1333,18 @@ private Mono> updateByHos } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - privateEndpointConnectionName, - connection, - accept, - context); + return service.updateByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + accept, context); } /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1682,23 +1352,19 @@ private Mono> updateByHos * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - return updateByHostPoolWithResponseAsync( - resourceGroupName, hostPoolName, privateEndpointConnectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono updateByHostPoolAsync(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection) { + return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1707,24 +1373,20 @@ public Mono updateByHostPoolAsync( * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateByHostPoolWithResponse( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + public Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context) { - return updateByHostPoolWithResponseAsync( - resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, context) - .block(); + return updateByHostPoolWithResponseAsync(resourceGroupName, hostPoolName, privateEndpointConnectionName, + connection, context).block(); } /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1732,167 +1394,123 @@ public Response updateByHostPoolWi * @return the Private Endpoint Connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionWithSystemDataInner updateByHostPool( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - return updateByHostPoolWithResponse( - resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, Context.NONE) - .getValue(); + public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnection connection) { + return updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + Context.NONE).getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync( - String nextLink) { + private Mono> + listByWorkspaceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> + listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync( - String nextLink) { + private Mono> + listByHostPoolNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync( - String nextLink, Context context) { + private Mono> + listByHostPoolNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java index 9c1e1c9a0ca7..1b13deb5f8e9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java @@ -12,8 +12,8 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; -import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnections; +import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); @@ -22,48 +22,44 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName) { + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName, Context context) { - PagedIterable inner = - this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); + public PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context) { + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public Response getByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - Response inner = - this - .serviceClient() - .getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + public Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } else { return null; } } - public PrivateEndpointConnectionWithSystemData getByWorkspace( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - PrivateEndpointConnectionWithSystemDataInner inner = - this.serviceClient().getByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); + public PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionWithSystemDataInner inner + = this.serviceClient().getByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -71,49 +67,35 @@ public PrivateEndpointConnectionWithSystemData getByWorkspace( } } - public Response deleteByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return this - .serviceClient() + public Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() .deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); } - public void deleteByWorkspace( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public void deleteByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName) { this.serviceClient().deleteByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName); } - public Response updateByWorkspaceWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + public Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context) { - Response inner = - this - .serviceClient() - .updateByWorkspaceWithResponse( - resourceGroupName, workspaceName, privateEndpointConnectionName, connection, context); + Response inner = this.serviceClient() + .updateByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, connection, + context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } else { return null; } } - public PrivateEndpointConnectionWithSystemData updateByWorkspace( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - PrivateEndpointConnectionWithSystemDataInner inner = - this - .serviceClient() - .updateByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName, connection); + public PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnection connection) { + PrivateEndpointConnectionWithSystemDataInner inner = this.serviceClient() + .updateByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName, connection); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -121,48 +103,38 @@ public PrivateEndpointConnectionWithSystemData updateByWorkspace( } } - public PagedIterable listByHostPool( - String resourceGroupName, String hostPoolName) { - PagedIterable inner = - this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName) { + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); } - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); - } - - public Response getByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { - Response inner = - this - .serviceClient() - .getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); + public PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager())); + } + + public Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } else { return null; } } - public PrivateEndpointConnectionWithSystemData getByHostPool( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) { - PrivateEndpointConnectionWithSystemDataInner inner = - this.serviceClient().getByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); + public PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionWithSystemDataInner inner + = this.serviceClient().getByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { @@ -170,10 +142,9 @@ public PrivateEndpointConnectionWithSystemData getByHostPool( } } - public Response deleteByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) { - return this - .serviceClient() + public Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() .deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context); } @@ -181,37 +152,24 @@ public void deleteByHostPool(String resourceGroupName, String hostPoolName, Stri this.serviceClient().deleteByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName); } - public Response updateByHostPoolWithResponse( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + public Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context) { - Response inner = - this - .serviceClient() - .updateByHostPoolWithResponse( - resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, context); + Response inner = this.serviceClient() + .updateByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, + context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager())); } else { return null; } } - public PrivateEndpointConnectionWithSystemData updateByHostPool( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection) { - PrivateEndpointConnectionWithSystemDataInner inner = - this - .serviceClient() - .updateByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection); + public PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnection connection) { + PrivateEndpointConnectionWithSystemDataInner inner = this.serviceClient() + .updateByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection); if (inner != null) { return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager()); } else { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java index 5719a5128e9e..24cd87756cfb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.desktopvirtualization.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; import java.util.Collections; @@ -14,8 +15,7 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - PrivateLinkResourceImpl( - PrivateLinkResourceInner innerObject, + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -33,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String groupId() { return this.innerModel().groupId(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java index 7900ce2c695b..84d2869bd887 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java @@ -30,23 +30,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateLinkResourcesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateLinkResourcesClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,64 +62,46 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByWorkspace( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByWorkspace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByWorkspaceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -123,23 +110,19 @@ Mono> listByHostPoolNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync( - String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -150,35 +133,17 @@ private Mono> listByWorkspaceSinglePageA } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -188,28 +153,19 @@ private Mono> listByWorkspaceSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync( - String resourceGroupName, - String workspaceName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -221,31 +177,15 @@ private Mono> listByWorkspaceSinglePageA final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByWorkspace( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByWorkspace(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -257,8 +197,8 @@ private Mono> listByWorkspaceSinglePageA * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByWorkspaceAsync( - String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); @@ -266,7 +206,7 @@ public PagedFlux listByWorkspaceAsync( /** * List the private link resources available for this 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. @@ -286,7 +226,7 @@ public PagedFlux listByWorkspaceAsync(String resourceG /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -299,23 +239,15 @@ public PagedFlux listByWorkspaceAsync(String resourceG * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync( - String resourceGroupName, - String workspaceName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listByWorkspaceSinglePageAsync( - resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, + isDescending, initialSkip, context), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); } /** * List the private link resources available for this 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. @@ -334,7 +266,7 @@ public PagedIterable listByWorkspace(String resourceGr /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -347,20 +279,15 @@ public PagedIterable listByWorkspace(String resourceGr * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByWorkspace( - String resourceGroupName, - String workspaceName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context)); } /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -369,23 +296,19 @@ public PagedIterable listByWorkspace( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -396,35 +319,17 @@ private Mono> listByHostPoolSinglePageAs } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -434,28 +339,19 @@ private Mono> listByHostPoolSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -467,31 +363,15 @@ private Mono> listByHostPoolSinglePageAs final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -503,8 +383,8 @@ private Mono> listByHostPoolSinglePageAs * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); @@ -512,7 +392,7 @@ public PagedFlux listByHostPoolAsync( /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -532,7 +412,7 @@ public PagedFlux listByHostPoolAsync(String resourceGr /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -545,23 +425,15 @@ public PagedFlux listByHostPoolAsync(String resourceGr * @return a list of private link resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listByHostPoolSinglePageAsync( - resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -580,7 +452,7 @@ public PagedIterable listByHostPool(String resourceGro /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -593,27 +465,21 @@ public PagedIterable listByHostPool(String resourceGro * @return a list of private link resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { @@ -621,75 +487,54 @@ private Mono> listByWorkspaceNextSingleP return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByHostPoolNextSinglePageAsync(String nextLink) { @@ -697,62 +542,42 @@ private Mono> listByHostPoolNextSinglePa return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByHostPoolNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java index bf1f3ace3c3a..864da3ae147d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java @@ -19,51 +19,36 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public PrivateLinkResourcesImpl( - PrivateLinkResourcesClient innerClient, + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - PagedIterable inner = - this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByWorkspace( - String resourceGroupName, - String workspaceName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByWorkspace(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByWorkspace(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { - PagedIterable inner = - this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } private PrivateLinkResourcesClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java index 407cb38ea853..0e857f9949b9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationInfoImpl.java @@ -14,8 +14,7 @@ public final class RegistrationInfoImpl implements RegistrationInfo { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - RegistrationInfoImpl( - RegistrationInfoInner innerObject, + RegistrationInfoImpl(RegistrationInfoInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java new file mode 100644 index 000000000000..7e210f4a2a38 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/RegistrationTokenListImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.implementation; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenList; +import com.azure.resourcemanager.desktopvirtualization.models.RegistrationTokenMinimal; +import java.util.Collections; +import java.util.List; + +public final class RegistrationTokenListImpl implements RegistrationTokenList { + private RegistrationTokenListInner innerObject; + + private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; + + RegistrationTokenListImpl(RegistrationTokenListInner innerObject, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public RegistrationTokenListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/Utils.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/Utils.java rename to sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java index d7ad6e805e92..4edabe20acd3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/Utils.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java index 25e1b3dad405..6c118650e835 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ResourceProviderOperationImpl.java @@ -14,8 +14,7 @@ public final class ResourceProviderOperationImpl implements ResourceProviderOper private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - ResourceProviderOperationImpl( - ResourceProviderOperationInner innerObject, + ResourceProviderOperationImpl(ResourceProviderOperationInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java index 0a9b66424d62..4419c5172090 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanImpl.java @@ -152,27 +152,23 @@ public ScalingPlanImpl withExistingResourceGroup(String resourceGroupName) { } public ScalingPlan create() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlans() - .createWithResponse(resourceGroupName, scalingPlanName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlans() + .createWithResponse(resourceGroupName, scalingPlanName, this.innerModel(), Context.NONE) + .getValue(); return this; } public ScalingPlan create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlans() - .createWithResponse(resourceGroupName, scalingPlanName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlans() + .createWithResponse(resourceGroupName, scalingPlanName, this.innerModel(), context) + .getValue(); return this; } - ScalingPlanImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + ScalingPlanImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new ScalingPlanInner(); this.serviceManager = serviceManager; this.scalingPlanName = name; @@ -184,51 +180,42 @@ public ScalingPlanImpl update() { } public ScalingPlan apply() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlans() - .updateWithResponse(resourceGroupName, scalingPlanName, updateScalingPlan, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlans() + .updateWithResponse(resourceGroupName, scalingPlanName, updateScalingPlan, Context.NONE) + .getValue(); return this; } public ScalingPlan apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlans() - .updateWithResponse(resourceGroupName, scalingPlanName, updateScalingPlan, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlans() + .updateWithResponse(resourceGroupName, scalingPlanName, updateScalingPlan, context) + .getValue(); return this; } - ScalingPlanImpl( - ScalingPlanInner innerObject, + ScalingPlanImpl(ScalingPlanInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.scalingPlanName = Utils.getValueFromIdByName(innerObject.id(), "scalingPlans"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scalingPlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "scalingPlans"); } public ScalingPlan refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlans() - .getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlans() + .getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, Context.NONE) + .getValue(); return this; } public ScalingPlan refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlans() - .getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlans() + .getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context) + .getValue(); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java index 61281fff0eeb..8ce69bb08598 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java @@ -175,29 +175,24 @@ public ScalingPlanPersonalScheduleImpl withExistingScalingPlan(String resourceGr } public ScalingPlanPersonalSchedule create() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPersonalSchedules() - .createWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPersonalSchedules() + .createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public ScalingPlanPersonalSchedule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPersonalSchedules() - .createWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPersonalSchedules() + .createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), context) + .getValue(); return this; } - ScalingPlanPersonalScheduleImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + ScalingPlanPersonalScheduleImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new ScalingPlanPersonalScheduleInner(); this.serviceManager = serviceManager; this.scalingPlanScheduleName = name; @@ -209,58 +204,45 @@ public ScalingPlanPersonalScheduleImpl update() { } public ScalingPlanPersonalSchedule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPersonalSchedules() - .updateWithResponse( - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - updateScalingPlanSchedule, - Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPersonalSchedules() + .updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, + Context.NONE) + .getValue(); return this; } public ScalingPlanPersonalSchedule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPersonalSchedules() - .updateWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPersonalSchedules() + .updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, + context) + .getValue(); return this; } - ScalingPlanPersonalScheduleImpl( - ScalingPlanPersonalScheduleInner innerObject, + ScalingPlanPersonalScheduleImpl(ScalingPlanPersonalScheduleInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.scalingPlanName = Utils.getValueFromIdByName(innerObject.id(), "scalingPlans"); - this.scalingPlanScheduleName = Utils.getValueFromIdByName(innerObject.id(), "personalSchedules"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scalingPlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "scalingPlans"); + this.scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "personalSchedules"); } public ScalingPlanPersonalSchedule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPersonalSchedules() - .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPersonalSchedules() + .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) + .getValue(); return this; } public ScalingPlanPersonalSchedule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPersonalSchedules() - .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPersonalSchedules() + .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context) + .getValue(); return this; } @@ -304,8 +286,8 @@ public ScalingPlanPersonalScheduleImpl withRampUpStartVMOnConnect(SetStartVMOnCo } } - public ScalingPlanPersonalScheduleImpl withRampUpActionOnDisconnect( - SessionHandlingOperation rampUpActionOnDisconnect) { + public ScalingPlanPersonalScheduleImpl + withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { if (isInCreateMode()) { this.innerModel().withRampUpActionOnDisconnect(rampUpActionOnDisconnect); return this; @@ -315,8 +297,8 @@ public ScalingPlanPersonalScheduleImpl withRampUpActionOnDisconnect( } } - public ScalingPlanPersonalScheduleImpl withRampUpMinutesToWaitOnDisconnect( - Integer rampUpMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleImpl + withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { if (isInCreateMode()) { this.innerModel().withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect); return this; @@ -426,8 +408,8 @@ public ScalingPlanPersonalScheduleImpl withRampDownStartVMOnConnect(SetStartVMOn } } - public ScalingPlanPersonalScheduleImpl withRampDownActionOnDisconnect( - SessionHandlingOperation rampDownActionOnDisconnect) { + public ScalingPlanPersonalScheduleImpl + withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { if (isInCreateMode()) { this.innerModel().withRampDownActionOnDisconnect(rampDownActionOnDisconnect); return this; @@ -437,8 +419,8 @@ public ScalingPlanPersonalScheduleImpl withRampDownActionOnDisconnect( } } - public ScalingPlanPersonalScheduleImpl withRampDownMinutesToWaitOnDisconnect( - Integer rampDownMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleImpl + withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { if (isInCreateMode()) { this.innerModel().withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect); return this; @@ -488,8 +470,8 @@ public ScalingPlanPersonalScheduleImpl withOffPeakStartVMOnConnect(SetStartVMOnC } } - public ScalingPlanPersonalScheduleImpl withOffPeakActionOnDisconnect( - SessionHandlingOperation offPeakActionOnDisconnect) { + public ScalingPlanPersonalScheduleImpl + withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { if (isInCreateMode()) { this.innerModel().withOffPeakActionOnDisconnect(offPeakActionOnDisconnect); return this; @@ -499,8 +481,8 @@ public ScalingPlanPersonalScheduleImpl withOffPeakActionOnDisconnect( } } - public ScalingPlanPersonalScheduleImpl withOffPeakMinutesToWaitOnDisconnect( - Integer offPeakMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalScheduleImpl + withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { if (isInCreateMode()) { this.innerModel().withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect); return this; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java index 9003c60dcb0e..4d7508d80dc5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java @@ -35,24 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ScalingPlanPersonalSchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in ScalingPlanPersonalSchedulesClient. + */ public final class ScalingPlanPersonalSchedulesClientImpl implements ScalingPlanPersonalSchedulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ScalingPlanPersonalSchedulesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of ScalingPlanPersonalSchedulesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ScalingPlanPersonalSchedulesClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy - .create( - ScalingPlanPersonalSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ScalingPlanPersonalSchedulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -63,99 +67,75 @@ public final class ScalingPlanPersonalSchedulesClientImpl implements ScalingPlan @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ScalingPlanPersonalSchedulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @HeaderParam("Accept") String accept, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @BodyParam("application/json") ScalingPlanPersonalScheduleInner scalingPlanSchedule, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @HeaderParam("Accept") String accept, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @BodyParam("application/json") ScalingPlanPersonalSchedulePatch scalingPlanSchedule, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -165,19 +145,15 @@ Mono> listNext( * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -188,30 +164,20 @@ public Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -222,19 +188,15 @@ public Mono> getWithResponseAsync( * @return a ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -245,27 +207,18 @@ private Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -275,15 +228,15 @@ private Mono> getWithResponseAsync( * @return a ScalingPlanPersonalSchedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono getAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -294,14 +247,14 @@ public Mono getAsync( * @return a ScalingPlanPersonalSchedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + public Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -311,14 +264,14 @@ public Response getWithResponse( * @return a ScalingPlanPersonalSchedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPersonalScheduleInner get( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public ScalingPlanPersonalScheduleInner get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue(); } /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -327,25 +280,18 @@ public ScalingPlanPersonalScheduleInner get( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule) { + public Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -356,9 +302,8 @@ public Mono> createWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule == null) { return Mono @@ -368,25 +313,15 @@ public Mono> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, + scalingPlanSchedule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -396,26 +331,19 @@ public Mono> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule, + private Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -426,9 +354,8 @@ private Mono> createWithResponseAsync .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule == null) { return Mono @@ -438,22 +365,13 @@ private Mono> createWithResponseAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); } /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -464,18 +382,15 @@ private Mono> createWithResponseAsync * @return represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule) { + public Mono createAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -487,20 +402,16 @@ public Mono createAsync( * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule, + public Response createWithResponse(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule, Context context) { - return createWithResponseAsync( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, context) - .block(); + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + context).block(); } /** * Create or update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -511,19 +422,15 @@ public Response createWithResponse( * @return represents a ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPersonalScheduleInner create( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalScheduleInner scalingPlanSchedule) { - return createWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, Context.NONE) - .getValue(); + public ScalingPlanPersonalScheduleInner create(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPersonalScheduleInner scalingPlanSchedule) { + return createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -533,19 +440,15 @@ public ScalingPlanPersonalScheduleInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -556,30 +459,20 @@ public Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -590,19 +483,15 @@ public Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -613,27 +502,18 @@ private Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -650,7 +530,7 @@ public Mono deleteAsync(String resourceGroupName, String scalingPlanName, /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -661,14 +541,14 @@ public Mono deleteAsync(String resourceGroupName, String scalingPlanName, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -683,7 +563,7 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -692,25 +572,18 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalSchedulePatch scalingPlanSchedule) { + public Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -721,34 +594,23 @@ public Mono> updateWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule != null) { scalingPlanSchedule.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, + scalingPlanSchedule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -758,26 +620,19 @@ public Mono> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalSchedulePatch scalingPlanSchedule, + private Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -788,31 +643,21 @@ private Mono> updateWithResponseAsync .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule != null) { scalingPlanSchedule.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); } /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -822,8 +667,8 @@ private Mono> updateWithResponseAsync * @return represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null; return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -831,7 +676,7 @@ public Mono updateAsync( /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -843,20 +688,16 @@ public Mono updateAsync( * @return represents a ScalingPlanPersonalSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPersonalSchedulePatch scalingPlanSchedule, + public Response updateWithResponse(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch scalingPlanSchedule, Context context) { - return updateWithResponseAsync( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, context) - .block(); + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + context).block(); } /** * Update a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -866,17 +707,16 @@ public Response updateWithResponse( * @return represents a ScalingPlanPersonalSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPersonalScheduleInner update( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public ScalingPlanPersonalScheduleInner update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null; - return updateWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, Context.NONE) - .getValue(); + return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -885,23 +725,19 @@ public ScalingPlanPersonalScheduleInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -913,35 +749,17 @@ private Mono> listSinglePageAsyn } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, pageSize, isDescending, + initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -951,28 +769,19 @@ private Mono> listSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -985,31 +794,15 @@ private Mono> listSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -1021,8 +814,8 @@ private Mono> listSinglePageAsyn * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -1030,7 +823,7 @@ public PagedFlux listAsync( /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1050,7 +843,7 @@ public PagedFlux listAsync(String resourceGrou /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -1063,13 +856,8 @@ public PagedFlux listAsync(String resourceGrou * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -1077,7 +865,7 @@ private PagedFlux listAsync( /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1095,7 +883,7 @@ public PagedIterable list(String resourceGroup /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -1108,27 +896,21 @@ public PagedIterable list(String resourceGroup * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1136,62 +918,41 @@ private Mono> listNextSinglePage return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java index 2624a4702113..533f86fb5eda 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesImpl.java @@ -21,32 +21,28 @@ public final class ScalingPlanPersonalSchedulesImpl implements ScalingPlanPerson private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public ScalingPlanPersonalSchedulesImpl( - ScalingPlanPersonalSchedulesClient innerClient, + public ScalingPlanPersonalSchedulesImpl(ScalingPlanPersonalSchedulesClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); + public Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScalingPlanPersonalScheduleImpl(inner.getValue(), this.manager())); } else { return null; } } - public ScalingPlanPersonalSchedule get( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { - ScalingPlanPersonalScheduleInner inner = - this.serviceClient().get(resourceGroupName, scalingPlanName, scalingPlanScheduleName); + public ScalingPlanPersonalSchedule get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + ScalingPlanPersonalScheduleInner inner + = this.serviceClient().get(resourceGroupName, scalingPlanName, scalingPlanScheduleName); if (inner != null) { return new ScalingPlanPersonalScheduleImpl(inner, this.manager()); } else { @@ -54,10 +50,9 @@ public ScalingPlanPersonalSchedule get( } } - public Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { - return this - .serviceClient() + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return this.serviceClient() .deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } @@ -66,133 +61,93 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal } public PagedIterable list(String resourceGroupName, String scalingPlanName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, scalingPlanName); - return Utils.mapPage(inner, inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, scalingPlanName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ScalingPlanPersonalScheduleImpl(inner1, this.manager())); } public ScalingPlanPersonalSchedule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "personalSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "personalSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); } - return this - .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) + return this.getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "personalSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "personalSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); } return this.getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "personalSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "personalSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); } this.deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "personalSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "personalSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'personalSchedules'.", id))); } return this.deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java index 7de704344ce7..ab84fb562dde 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledScheduleImpl.java @@ -138,29 +138,24 @@ public ScalingPlanPooledScheduleImpl withExistingScalingPlan(String resourceGrou } public ScalingPlanPooledSchedule create() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPooledSchedules() - .createWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPooledSchedules() + .createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public ScalingPlanPooledSchedule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPooledSchedules() - .createWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPooledSchedules() + .createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), context) + .getValue(); return this; } - ScalingPlanPooledScheduleImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + ScalingPlanPooledScheduleImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new ScalingPlanPooledScheduleInner(); this.serviceManager = serviceManager; this.scalingPlanScheduleName = name; @@ -172,58 +167,45 @@ public ScalingPlanPooledScheduleImpl update() { } public ScalingPlanPooledSchedule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPooledSchedules() - .updateWithResponse( - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - updateScalingPlanSchedule, - Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPooledSchedules() + .updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, + Context.NONE) + .getValue(); return this; } public ScalingPlanPooledSchedule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPooledSchedules() - .updateWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPooledSchedules() + .updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, + context) + .getValue(); return this; } - ScalingPlanPooledScheduleImpl( - ScalingPlanPooledScheduleInner innerObject, + ScalingPlanPooledScheduleImpl(ScalingPlanPooledScheduleInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.scalingPlanName = Utils.getValueFromIdByName(innerObject.id(), "scalingPlans"); - this.scalingPlanScheduleName = Utils.getValueFromIdByName(innerObject.id(), "pooledSchedules"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.scalingPlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "scalingPlans"); + this.scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pooledSchedules"); } public ScalingPlanPooledSchedule refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPooledSchedules() - .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPooledSchedules() + .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) + .getValue(); return this; } public ScalingPlanPooledSchedule refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getScalingPlanPooledSchedules() - .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getScalingPlanPooledSchedules() + .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context) + .getValue(); return this; } @@ -247,8 +229,8 @@ public ScalingPlanPooledScheduleImpl withRampUpStartTime(Time rampUpStartTime) { } } - public ScalingPlanPooledScheduleImpl withRampUpLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleImpl + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { if (isInCreateMode()) { this.innerModel().withRampUpLoadBalancingAlgorithm(rampUpLoadBalancingAlgorithm); return this; @@ -288,8 +270,8 @@ public ScalingPlanPooledScheduleImpl withPeakStartTime(Time peakStartTime) { } } - public ScalingPlanPooledScheduleImpl withPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleImpl + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { if (isInCreateMode()) { this.innerModel().withPeakLoadBalancingAlgorithm(peakLoadBalancingAlgorithm); return this; @@ -309,8 +291,8 @@ public ScalingPlanPooledScheduleImpl withRampDownStartTime(Time rampDownStartTim } } - public ScalingPlanPooledScheduleImpl withRampDownLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleImpl + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { if (isInCreateMode()) { this.innerModel().withRampDownLoadBalancingAlgorithm(rampDownLoadBalancingAlgorithm); return this; @@ -390,8 +372,8 @@ public ScalingPlanPooledScheduleImpl withOffPeakStartTime(Time offPeakStartTime) } } - public ScalingPlanPooledScheduleImpl withOffPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + public ScalingPlanPooledScheduleImpl + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { if (isInCreateMode()) { this.innerModel().withOffPeakLoadBalancingAlgorithm(offPeakLoadBalancingAlgorithm); return this; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java index 7f8850191754..29d9ad8088e8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesClientImpl.java @@ -35,24 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedulePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ScalingPlanPooledSchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in ScalingPlanPooledSchedulesClient. + */ public final class ScalingPlanPooledSchedulesClientImpl implements ScalingPlanPooledSchedulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ScalingPlanPooledSchedulesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of ScalingPlanPooledSchedulesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ScalingPlanPooledSchedulesClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy - .create( - ScalingPlanPooledSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ScalingPlanPooledSchedulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -63,99 +67,75 @@ public final class ScalingPlanPooledSchedulesClientImpl implements ScalingPlanPo @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ScalingPlanPooledSchedulesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @HeaderParam("Accept") String accept, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @BodyParam("application/json") ScalingPlanPooledScheduleInner scalingPlanSchedule, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, - @HeaderParam("Accept") String accept, + @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules/{scalingPlanScheduleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName, @BodyParam("application/json") ScalingPlanPooledSchedulePatch scalingPlanSchedule, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/pooledSchedules") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("scalingPlanName") String scalingPlanName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -165,19 +145,15 @@ Mono> listNext( * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -188,30 +164,20 @@ public Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -222,19 +188,15 @@ public Mono> getWithResponseAsync( * @return a ScalingPlanPooledSchedule along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -245,27 +207,18 @@ private Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -275,15 +228,15 @@ private Mono> getWithResponseAsync( * @return a ScalingPlanPooledSchedule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono getAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -294,14 +247,14 @@ public Mono getAsync( * @return a ScalingPlanPooledSchedule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + public Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -311,14 +264,14 @@ public Response getWithResponse( * @return a ScalingPlanPooledSchedule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPooledScheduleInner get( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public ScalingPlanPooledScheduleInner get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue(); } /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -327,25 +280,18 @@ public ScalingPlanPooledScheduleInner get( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule) { + public Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -356,9 +302,8 @@ public Mono> createWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule == null) { return Mono @@ -368,25 +313,15 @@ public Mono> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, + scalingPlanSchedule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -396,26 +331,19 @@ public Mono> createWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule, + private Mono> createWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -426,9 +354,8 @@ private Mono> createWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule == null) { return Mono @@ -438,22 +365,13 @@ private Mono> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); } /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -464,18 +382,15 @@ private Mono> createWithResponseAsync( * @return represents a ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule) { + public Mono createAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -487,20 +402,15 @@ public Mono createAsync( * @return represents a ScalingPlanPooledSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule, - Context context) { - return createWithResponseAsync( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, context) - .block(); + public Response createWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule, Context context) { + return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + context).block(); } /** * Create or update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -511,19 +421,15 @@ public Response createWithResponse( * @return represents a ScalingPlanPooledSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPooledScheduleInner create( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledScheduleInner scalingPlanSchedule) { - return createWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, Context.NONE) - .getValue(); + public ScalingPlanPooledScheduleInner create(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledScheduleInner scalingPlanSchedule) { + return createWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -533,19 +439,15 @@ public ScalingPlanPooledScheduleInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -556,30 +458,20 @@ public Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -590,19 +482,15 @@ public Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -613,27 +501,18 @@ private Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, accept, context); } /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -650,7 +529,7 @@ public Mono deleteAsync(String resourceGroupName, String scalingPlanName, /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -661,14 +540,14 @@ public Mono deleteAsync(String resourceGroupName, String scalingPlanName, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block(); } /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -683,7 +562,7 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -692,25 +571,18 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledSchedulePatch scalingPlanSchedule) { + public Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -721,34 +593,23 @@ public Mono> updateWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule != null) { scalingPlanSchedule.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlanScheduleName, + scalingPlanSchedule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -758,26 +619,19 @@ public Mono> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a ScalingPlanPooledSchedule definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledSchedulePatch scalingPlanSchedule, + private Mono> updateWithResponseAsync(String resourceGroupName, + String scalingPlanName, String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -788,31 +642,21 @@ private Mono> updateWithResponseAsync( .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null.")); } if (scalingPlanScheduleName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null.")); } if (scalingPlanSchedule != null) { scalingPlanSchedule.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlanScheduleName, - scalingPlanSchedule, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, accept, context); } /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -822,8 +666,8 @@ private Mono> updateWithResponseAsync( * @return represents a ScalingPlanPooledSchedule definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public Mono updateAsync(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { final ScalingPlanPooledSchedulePatch scalingPlanSchedule = null; return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -831,7 +675,7 @@ public Mono updateAsync( /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -843,20 +687,15 @@ public Mono updateAsync( * @return represents a ScalingPlanPooledSchedule definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String scalingPlanName, - String scalingPlanScheduleName, - ScalingPlanPooledSchedulePatch scalingPlanSchedule, - Context context) { - return updateWithResponseAsync( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, context) - .block(); + public Response updateWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, ScalingPlanPooledSchedulePatch scalingPlanSchedule, Context context) { + return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + context).block(); } /** * Update a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -866,17 +705,16 @@ public Response updateWithResponse( * @return represents a ScalingPlanPooledSchedule definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ScalingPlanPooledScheduleInner update( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { + public ScalingPlanPooledScheduleInner update(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { final ScalingPlanPooledSchedulePatch scalingPlanSchedule = null; - return updateWithResponse( - resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, Context.NONE) - .getValue(); + return updateWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, + Context.NONE).getValue(); } /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -888,19 +726,15 @@ public ScalingPlanPooledScheduleInner update( * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -912,35 +746,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, pageSize, isDescending, + initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -953,24 +769,15 @@ private Mono> listSinglePageAsync( * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -983,31 +790,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -1019,8 +810,8 @@ private Mono> listSinglePageAsync( * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -1028,7 +819,7 @@ public PagedFlux listAsync( /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1048,7 +839,7 @@ public PagedFlux listAsync(String resourceGroupN /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -1061,13 +852,8 @@ public PagedFlux listAsync(String resourceGroupN * @return scalingPlanPooledScheduleList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -1075,7 +861,7 @@ private PagedFlux listAsync( /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1093,7 +879,7 @@ public PagedIterable list(String resourceGroupNa /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -1106,22 +892,16 @@ public PagedIterable list(String resourceGroupNa * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1133,31 +913,20 @@ private Mono> listNextSinglePageAs return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1165,29 +934,19 @@ private Mono> listNextSinglePageAs * @return scalingPlanPooledScheduleList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java index f9fa0d343303..041841991061 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPooledSchedulesImpl.java @@ -21,32 +21,28 @@ public final class ScalingPlanPooledSchedulesImpl implements ScalingPlanPooledSc private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public ScalingPlanPooledSchedulesImpl( - ScalingPlanPooledSchedulesClient innerClient, + public ScalingPlanPooledSchedulesImpl(ScalingPlanPooledSchedulesClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); + public Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScalingPlanPooledScheduleImpl(inner.getValue(), this.manager())); } else { return null; } } - public ScalingPlanPooledSchedule get( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) { - ScalingPlanPooledScheduleInner inner = - this.serviceClient().get(resourceGroupName, scalingPlanName, scalingPlanScheduleName); + public ScalingPlanPooledSchedule get(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName) { + ScalingPlanPooledScheduleInner inner + = this.serviceClient().get(resourceGroupName, scalingPlanName, scalingPlanScheduleName); if (inner != null) { return new ScalingPlanPooledScheduleImpl(inner, this.manager()); } else { @@ -54,10 +50,9 @@ public ScalingPlanPooledSchedule get( } } - public Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) { - return this - .serviceClient() + public Response deleteWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context) { + return this.serviceClient() .deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } @@ -66,129 +61,91 @@ public void delete(String resourceGroupName, String scalingPlanName, String scal } public PagedIterable list(String resourceGroupName, String scalingPlanName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, scalingPlanName); - return Utils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, scalingPlanName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String scalingPlanName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanPooledScheduleImpl(inner1, this.manager())); } public ScalingPlanPooledSchedule getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "pooledSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "pooledSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); } - return this - .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) + return this.getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "pooledSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "pooledSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); } return this.getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "pooledSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "pooledSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); } this.deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } - String scalingPlanScheduleName = Utils.getValueFromIdByName(id, "pooledSchedules"); + String scalingPlanScheduleName = ResourceManagerUtils.getValueFromIdByName(id, "pooledSchedules"); if (scalingPlanScheduleName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pooledSchedules'.", id))); } return this.deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java index 76774cd21245..9868b5f8e58a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansClientImpl.java @@ -35,22 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ScalingPlansClient. */ +/** + * An instance of this class provides access to all the operations defined in ScalingPlansClient. + */ public final class ScalingPlansClientImpl implements ScalingPlansClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ScalingPlansService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of ScalingPlansClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ScalingPlansClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(ScalingPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ScalingPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,145 +67,105 @@ public final class ScalingPlansClientImpl implements ScalingPlansClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface ScalingPlansService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @HeaderParam("Accept") String accept, + @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @BodyParam("application/json") ScalingPlanInner scalingPlan, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanInner scalingPlan, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("scalingPlanName") String scalingPlanName, - @HeaderParam("Accept") String accept, + @PathParam("scalingPlanName") String scalingPlanName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("scalingPlanName") String scalingPlanName, - @BodyParam("application/json") ScalingPlanPatch scalingPlan, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScalingPlanPatch scalingPlan, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -208,19 +174,15 @@ Mono> listByHostPoolNext( * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String scalingPlanName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String scalingPlanName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -232,23 +194,14 @@ public Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -258,19 +211,15 @@ public Mono> getByResourceGroupWithResponseAsync( * @return a scaling plan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String scalingPlanName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String scalingPlanName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -282,20 +231,13 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context); } /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -311,7 +253,7 @@ public Mono getByResourceGroupAsync(String resourceGroupName, /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -321,14 +263,14 @@ public Mono getByResourceGroupAsync(String resourceGroupName, * @return a scaling plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String scalingPlanName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, scalingPlanName, context).block(); } /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -343,7 +285,7 @@ public ScalingPlanInner getByResourceGroup(String resourceGroupName, String scal /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -353,19 +295,15 @@ public ScalingPlanInner getByResourceGroup(String resourceGroupName, String scal * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan) { + public Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -382,24 +320,14 @@ public Mono> createWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlan, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -410,19 +338,15 @@ public Mono> createWithResponseAsync( * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan, Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -439,21 +363,13 @@ private Mono> createWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlan, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlan, accept, context); } /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -463,15 +379,15 @@ private Mono> createWithResponseAsync( * @return scalingPlan on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan) { + public Mono createAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan) { return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -482,14 +398,14 @@ public Mono createAsync( * @return scalingPlan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String scalingPlanName, ScalingPlanInner scalingPlan, Context context) { + public Response createWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanInner scalingPlan, Context context) { return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); } /** * Create or update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -505,7 +421,7 @@ public ScalingPlanInner create(String resourceGroupName, String scalingPlanName, /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -516,16 +432,12 @@ public ScalingPlanInner create(String resourceGroupName, String scalingPlanName, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -537,23 +449,14 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -563,19 +466,15 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String scalingPlanName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String scalingPlanName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -587,20 +486,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, accept, context); } /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -615,7 +507,7 @@ public Mono deleteAsync(String resourceGroupName, String scalingPlanName) /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -631,7 +523,7 @@ public Response deleteWithResponse(String resourceGroupName, String scalin /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -645,7 +537,7 @@ public void delete(String resourceGroupName, String scalingPlanName) { /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -655,19 +547,15 @@ public void delete(String resourceGroupName, String scalingPlanName) { * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanPatch scalingPlan) { + public Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -682,24 +570,14 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlan, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, scalingPlanName, scalingPlan, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -710,19 +588,15 @@ public Mono> updateWithResponseAsync( * @return scalingPlan along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String scalingPlanName, ScalingPlanPatch scalingPlan, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -737,21 +611,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - scalingPlanName, - scalingPlan, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, scalingPlanName, scalingPlan, accept, context); } /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -768,7 +634,7 @@ public Mono updateAsync(String resourceGroupName, String scali /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlan Object containing scaling plan definitions. @@ -779,14 +645,14 @@ public Mono updateAsync(String resourceGroupName, String scali * @return scalingPlan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String scalingPlanName, ScalingPlanPatch scalingPlan, Context context) { + public Response updateWithResponse(String resourceGroupName, String scalingPlanName, + ScalingPlanPatch scalingPlan, Context context) { return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlan, context).block(); } /** * Update a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -802,7 +668,7 @@ public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -813,19 +679,15 @@ public ScalingPlanInner update(String resourceGroupName, String scalingPlanName) * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -833,34 +695,17 @@ private Mono> listByResourceGroupSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -872,19 +717,15 @@ private Mono> listByResourceGroupSinglePageAsync * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -892,31 +733,15 @@ private Mono> listByResourceGroupSinglePageAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -927,8 +752,8 @@ private Mono> listByResourceGroupSinglePageAsync * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); @@ -936,7 +761,7 @@ public PagedFlux listByResourceGroupAsync( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -955,7 +780,7 @@ public PagedFlux listByResourceGroupAsync(String resourceGroup /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -967,8 +792,8 @@ public PagedFlux listByResourceGroupAsync(String resourceGroup * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); @@ -976,7 +801,7 @@ private PagedFlux listByResourceGroupAsync( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -993,7 +818,7 @@ public PagedIterable listByResourceGroup(String resourceGroupN /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -1005,15 +830,15 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @return scalingPlanList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); } /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1023,49 +848,28 @@ public PagedIterable listByResourceGroup( * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), pageSize, isDescending, initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1076,46 +880,28 @@ private Mono> listSinglePageAsync( * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listSinglePageAsync(Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), pageSize, + isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1126,14 +912,13 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip) { - return new PagedFlux<>( - () -> listSinglePageAsync(pageSize, isDescending, initialSkip), + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List scaling plans in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedFlux}. @@ -1143,14 +928,13 @@ public PagedFlux listAsync() { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; - return new PagedFlux<>( - () -> listSinglePageAsync(pageSize, isDescending, initialSkip), + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1161,16 +945,15 @@ public PagedFlux listAsync() { * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), + private PagedFlux listAsync(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(pageSize, isDescending, initialSkip, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List scaling plans in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedIterable}. @@ -1185,7 +968,7 @@ public PagedIterable list() { /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -1196,14 +979,14 @@ public PagedIterable list() { * @return scalingPlanList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { return new PagedIterable<>(listAsync(pageSize, isDescending, initialSkip, context)); } /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1215,19 +998,15 @@ public PagedIterable list( * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1238,35 +1017,17 @@ private Mono> listByHostPoolSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1279,24 +1040,15 @@ private Mono> listByHostPoolSinglePageAsync( * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1308,31 +1060,15 @@ private Mono> listByHostPoolSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1344,8 +1080,8 @@ private Mono> listByHostPoolSinglePageAsync( * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); @@ -1353,7 +1089,7 @@ public PagedFlux listByHostPoolAsync( /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1373,7 +1109,7 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1386,23 +1122,15 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, * @return scalingPlanList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listByHostPoolSinglePageAsync( - resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1421,7 +1149,7 @@ public PagedIterable listByHostPool(String resourceGroupName, /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -1434,22 +1162,16 @@ public PagedIterable listByHostPool(String resourceGroupName, * @return scalingPlanList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1461,32 +1183,22 @@ private Mono> listByResourceGroupNextSinglePageA return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1494,37 +1206,26 @@ private Mono> listByResourceGroupNextSinglePageA * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1536,32 +1237,22 @@ private Mono> listBySubscriptionNextSinglePageAs return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1569,37 +1260,26 @@ private Mono> listBySubscriptionNextSinglePageAs * @return scalingPlanList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1611,31 +1291,21 @@ private Mono> listByHostPoolNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1648,23 +1318,13 @@ private Mono> listByHostPoolNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java index 4efb9b748a24..634b0ea66f7f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlansImpl.java @@ -21,22 +21,18 @@ public final class ScalingPlansImpl implements ScalingPlans { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public ScalingPlansImpl( - ScalingPlansClient innerClient, + public ScalingPlansImpl(ScalingPlansClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String scalingPlanName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScalingPlanImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,8 +48,8 @@ public ScalingPlan getByResourceGroup(String resourceGroupName, String scalingPl } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String scalingPlanName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, scalingPlanName, context); } @@ -63,118 +59,91 @@ public void deleteByResourceGroup(String resourceGroupName, String scalingPlanNa public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); } - public PagedIterable list( - Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + public PagedIterable list(Integer pageSize, Boolean isDescending, Integer initialSkip, + Context context) { PagedIterable inner = this.serviceClient().list(pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); } public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { PagedIterable inner = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); - return Utils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); } - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScalingPlanImpl(inner1, this.manager())); } public ScalingPlan getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } this.deleteByResourceGroupWithResponse(resourceGroupName, scalingPlanName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String scalingPlanName = Utils.getValueFromIdByName(id, "scalingPlans"); + String scalingPlanName = ResourceManagerUtils.getValueFromIdByName(id, "scalingPlans"); if (scalingPlanName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scalingPlans'.", id))); } return this.deleteByResourceGroupWithResponse(resourceGroupName, scalingPlanName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java index ec92cef6f5dc..70d75a4b9d9f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostImpl.java @@ -19,8 +19,7 @@ public final class SessionHostImpl implements SessionHost { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - SessionHostImpl( - SessionHostInner innerObject, + SessionHostImpl(SessionHostInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java index 06e5118701be..b9a03129f802 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsClientImpl.java @@ -34,22 +34,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SessionHostsClient. */ +/** + * An instance of this class provides access to all the operations defined in SessionHostsClient. + */ public final class SessionHostsClientImpl implements SessionHostsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SessionHostsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of SessionHostsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SessionHostsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(SessionHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(SessionHostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,85 +66,58 @@ public final class SessionHostsClientImpl implements SessionHostsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface SessionHostsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @QueryParam("force") Boolean force, - @BodyParam("application/json") SessionHostPatch sessionHost, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @QueryParam("force") Boolean force, + @BodyParam("application/json") SessionHostPatch sessionHost, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("pageSize") Integer pageSize, @QueryParam("isDescending") Boolean isDescending, + @QueryParam("initialSkip") Integer initialSkip, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -148,19 +127,15 @@ Mono> listNext( * @return a session host along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname) { + public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -175,24 +150,14 @@ public Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -203,19 +168,15 @@ public Mono> getWithResponseAsync( * @return a session host along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -230,21 +191,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, accept, context); } /** * 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. @@ -261,7 +214,7 @@ public Mono getAsync(String resourceGroupName, String hostPool /** * 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. @@ -272,14 +225,14 @@ public Mono getAsync(String resourceGroupName, String hostPool * @return a session host along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Context context) { + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Context context) { return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, context).block(); } /** * 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. @@ -295,7 +248,7 @@ public SessionHostInner get(String resourceGroupName, String hostPoolName, Strin /** * 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. @@ -306,19 +259,15 @@ public SessionHostInner get(String resourceGroupName, String hostPoolName, Strin * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -332,26 +281,14 @@ public Mono> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter sessionHostname is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - force, - accept, - context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, force, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -363,19 +300,15 @@ public Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -390,22 +323,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - force, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, force, accept, context); } /** * 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. @@ -423,7 +347,7 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName, Str /** * 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. @@ -435,14 +359,14 @@ public Mono deleteAsync(String resourceGroupName, String hostPoolName, Str * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force, Context context) { + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context) { return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, context).block(); } /** * 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. @@ -458,7 +382,7 @@ public void delete(String resourceGroupName, String hostPoolName, String session /** * 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. @@ -470,23 +394,15 @@ public void delete(String resourceGroupName, String hostPoolName, String session * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost) { + public Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, SessionHostPatch sessionHost) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -504,26 +420,15 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - force, - sessionHost, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -536,24 +441,15 @@ public Mono> updateWithResponseAsync( * @return represents a SessionHost definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost, - Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, SessionHostPatch sessionHost, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -571,23 +467,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - force, - sessionHost, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, accept, context); } /** * 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. @@ -606,7 +492,7 @@ public Mono updateAsync(String resourceGroupName, String hostP /** * 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. @@ -619,20 +505,15 @@ public Mono updateAsync(String resourceGroupName, String hostP * @return represents a SessionHost definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost, - Context context) { + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, SessionHostPatch sessionHost, Context context) { return updateWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, context) .block(); } /** * 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. @@ -651,7 +532,7 @@ public SessionHostInner update(String resourceGroupName, String hostPoolName, St /** * 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 pageSize Number of items per page. @@ -663,19 +544,15 @@ public SessionHostInner update(String resourceGroupName, String hostPoolName, St * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -686,35 +563,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List 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 pageSize Number of items per page. @@ -727,24 +586,15 @@ private Mono> listSinglePageAsync( * @return sessionHostList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -756,31 +606,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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 pageSize Number of items per page. @@ -792,8 +626,8 @@ private Mono> listSinglePageAsync( * @return sessionHostList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -801,7 +635,7 @@ public PagedFlux listAsync( /** * 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. @@ -821,7 +655,7 @@ public PagedFlux listAsync(String resourceGroupName, String ho /** * 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 pageSize Number of items per page. @@ -834,13 +668,8 @@ public PagedFlux listAsync(String resourceGroupName, String ho * @return sessionHostList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private PagedFlux listAsync(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); @@ -848,7 +677,7 @@ private PagedFlux listAsync( /** * 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. @@ -866,7 +695,7 @@ public PagedIterable list(String resourceGroupName, String hos /** * 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 pageSize Number of items per page. @@ -879,22 +708,16 @@ public PagedIterable list(String resourceGroupName, String hos * @return sessionHostList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -906,31 +729,20 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -943,23 +755,13 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java index 14fa001189c6..221be96abcf5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/SessionHostsImpl.java @@ -22,22 +22,18 @@ public final class SessionHostsImpl implements SessionHosts { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public SessionHostsImpl( - SessionHostsClient innerClient, + public SessionHostsImpl(SessionHostsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, sessionHostname, context); + public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, hostPoolName, sessionHostname, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SessionHostImpl(inner.getValue(), this.manager())); } else { return null; @@ -53,10 +49,9 @@ public SessionHost get(String resourceGroupName, String hostPoolName, String ses } } - public Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force, Context context) { - return this - .serviceClient() + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context) { + return this.serviceClient() .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, context); } @@ -64,22 +59,12 @@ public void delete(String resourceGroupName, String hostPoolName, String session this.serviceClient().delete(resourceGroupName, hostPoolName, sessionHostname); } - public Response updateWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost, - Context context) { - Response inner = - this - .serviceClient() - .updateWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, context); + public Response updateWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, Boolean force, SessionHostPatch sessionHost, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, hostPoolName, sessionHostname, force, sessionHost, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SessionHostImpl(inner.getValue(), this.manager())); } else { return null; @@ -97,19 +82,14 @@ public SessionHost update(String resourceGroupName, String hostPoolName, String public PagedIterable list(String resourceGroupName, String hostPoolName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, hostPoolName); - return Utils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SessionHostImpl(inner1, this.manager())); } private SessionHostsClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java index 121172f0cf2c..f1feef9d67f6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.desktopvirtualization.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItem; @@ -12,8 +13,7 @@ public final class StartMenuItemImpl implements StartMenuItem { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - StartMenuItemImpl( - StartMenuItemInner innerObject, + StartMenuItemImpl(StartMenuItemInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -31,6 +31,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String appAlias() { return this.innerModel().appAlias(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java index b86a574af682..181331b5e6ac 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItemList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in StartMenuItemsClient. */ +/** + * An instance of this class provides access to all the operations defined in StartMenuItemsClient. + */ public final class StartMenuItemsClientImpl implements StartMenuItemsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final StartMenuItemsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of StartMenuItemsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ StartMenuItemsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(StartMenuItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(StartMenuItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,37 +62,28 @@ public final class StartMenuItemsClientImpl implements StartMenuItemsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface StartMenuItemsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("applicationGroupName") String applicationGroupName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("applicationGroupName") String applicationGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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 pageSize Number of items per page. @@ -98,23 +95,15 @@ Mono> listNext( * @return startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, + String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -126,35 +115,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, applicationGroupName, pageSize, isDescending, + initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List 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 pageSize Number of items per page. @@ -167,24 +138,15 @@ private Mono> listSinglePageAsync( * @return startMenuItemList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, + String applicationGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -197,31 +159,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - applicationGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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 pageSize Number of items per page. @@ -233,12 +179,8 @@ private Mono> listSinglePageAsync( * @return startMenuItemList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + public PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); @@ -246,7 +188,7 @@ public PagedFlux listAsync( /** * 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. @@ -266,7 +208,7 @@ public PagedFlux listAsync(String resourceGroupName, String /** * 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 pageSize Number of items per page. @@ -279,23 +221,15 @@ public PagedFlux listAsync(String resourceGroupName, String * @return startMenuItemList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, applicationGroupName, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * 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. @@ -314,7 +248,7 @@ public PagedIterable list(String resourceGroupName, String a /** * 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 pageSize Number of items per page. @@ -327,22 +261,16 @@ public PagedIterable list(String resourceGroupName, String a * @return startMenuItemList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String applicationGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -354,31 +282,20 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -391,23 +308,13 @@ private Mono> listNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java index efd30a677bca..e2482fd67aa8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/StartMenuItemsImpl.java @@ -19,8 +19,7 @@ public final class StartMenuItemsImpl implements StartMenuItems { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public StartMenuItemsImpl( - StartMenuItemsClient innerClient, + public StartMenuItemsImpl(StartMenuItemsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,21 +27,14 @@ public StartMenuItemsImpl( public PagedIterable list(String resourceGroupName, String applicationGroupName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, applicationGroupName); - return Utils.mapPage(inner, inner1 -> new StartMenuItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StartMenuItemImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new StartMenuItemImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StartMenuItemImpl(inner1, this.manager())); } private StartMenuItemsClient serviceClient() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java index 822017bf2edd..0afac654868f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionImpl.java @@ -16,8 +16,7 @@ public final class UserSessionImpl implements UserSession { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - UserSessionImpl( - UserSessionInner innerObject, + UserSessionImpl(UserSessionInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java index b0a00a835d0e..683fdb4df164 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsClientImpl.java @@ -34,22 +34,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.UserSessionList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in UserSessionsClient. */ +/** + * An instance of this class provides access to all the operations defined in UserSessionsClient. + */ public final class UserSessionsClientImpl implements UserSessionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final UserSessionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of UserSessionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ UserSessionsClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(UserSessionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(UserSessionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,132 +66,88 @@ public final class UserSessionsClientImpl implements UserSessionsClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface UserSessionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHostPool( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @QueryParam("$filter") String filter, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHostPool(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @QueryParam("$filter") String filter, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @PathParam("userSessionId") String userSessionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @PathParam("userSessionId") String userSessionId, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disconnect( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @PathParam("userSessionId") String userSessionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> disconnect(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> sendMessage( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostPoolName") String hostPoolName, - @PathParam("sessionHostName") String sessionHostname, - @PathParam("userSessionId") String userSessionId, - @BodyParam("application/json") SendMessage sendMessage, - @HeaderParam("Accept") String accept, + Mono> sendMessage(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("hostPoolName") String hostPoolName, + @PathParam("sessionHostName") String sessionHostname, @PathParam("userSessionId") String userSessionId, + @BodyParam("application/json") SendMessage sendMessage, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHostPoolNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -198,24 +160,15 @@ Mono> listNext( * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -226,36 +179,17 @@ private Mono> listByHostPoolSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - filter, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, filter, pageSize, isDescending, + initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List 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. @@ -269,25 +203,16 @@ private Mono> listByHostPoolSinglePageAsync( * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHostPoolSinglePageAsync( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, + private Mono> listByHostPoolSinglePageAsync(String resourceGroupName, + String hostPoolName, String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -299,32 +224,15 @@ private Mono> listByHostPoolSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHostPool( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - filter, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHostPool(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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. @@ -337,23 +245,15 @@ private Mono> listByHostPoolSinglePageAsync( * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { - return new PagedFlux<>( - () -> - listByHostPoolSinglePageAsync( - resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** * 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. @@ -367,16 +267,13 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; - return new PagedFlux<>( - () -> - listByHostPoolSinglePageAsync( - resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip), nextLink -> listByHostPoolNextSinglePageAsync(nextLink)); } /** * 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. @@ -390,24 +287,15 @@ public PagedFlux listByHostPoolAsync(String resourceGroupName, * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHostPoolAsync( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listByHostPoolSinglePageAsync( - resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context), - nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); + private PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName, + String filter, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, filter, pageSize, + isDescending, initialSkip, context), nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context)); } /** * 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. @@ -427,7 +315,7 @@ public PagedIterable listByHostPool(String resourceGroupName, /** * 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. @@ -441,21 +329,15 @@ public PagedIterable listByHostPool(String resourceGroupName, * @return userSessionList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByHostPoolAsync(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context)); } /** * 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. @@ -466,19 +348,15 @@ public PagedIterable listByHostPool( * @return a userSession along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -496,25 +374,15 @@ public Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -526,19 +394,15 @@ public Mono> getWithResponseAsync( * @return a userSession along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -556,22 +420,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, userSessionId, accept, context); } /** * 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. @@ -582,15 +437,15 @@ private Mono> getWithResponseAsync( * @return a userSession on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public Mono getAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. @@ -602,14 +457,14 @@ public Mono getAsync( * @return a userSession along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { + public Response getWithResponse(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, Context context) { return getWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context).block(); } /** * 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. @@ -620,15 +475,15 @@ public Response getWithResponse( * @return a userSession. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserSessionInner get( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public UserSessionInner get(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { return getWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, Context.NONE) .getValue(); } /** * 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. @@ -640,19 +495,15 @@ public UserSessionInner get( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Boolean force) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -670,26 +521,15 @@ public Mono> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - force, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -702,24 +542,15 @@ public Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - Boolean force, - Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -737,23 +568,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - force, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, accept, context); } /** * 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. @@ -764,8 +585,8 @@ private Mono> deleteWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public Mono deleteAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { final Boolean force = null; return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force) .flatMap(ignored -> Mono.empty()); @@ -773,7 +594,7 @@ public Mono deleteAsync( /** * 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. @@ -786,20 +607,15 @@ public Mono deleteAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - Boolean force, - Context context) { + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Boolean force, Context context) { return deleteWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, context) .block(); } /** * 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. @@ -816,7 +632,7 @@ public void delete(String resourceGroupName, String hostPoolName, String session /** * 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. @@ -829,24 +645,15 @@ public void delete(String resourceGroupName, String hostPoolName, String session * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -861,36 +668,17 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List 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. @@ -904,25 +692,15 @@ private Mono> listSinglePageAsync( * @return userSessionList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + private Mono> listSinglePageAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -938,32 +716,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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. @@ -976,23 +737,15 @@ private Mono> listSinglePageAsync( * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * 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. @@ -1002,21 +755,18 @@ public PagedFlux listAsync( * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync( - String resourceGroupName, String hostPoolName, String sessionHostname) { + public PagedFlux listAsync(String resourceGroupName, String hostPoolName, + String sessionHostname) { final Integer pageSize = null; final Boolean isDescending = null; final Integer initialSkip = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip), nextLink -> listNextSinglePageAsync(nextLink)); } /** * 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. @@ -1030,24 +780,15 @@ public PagedFlux listAsync( * @return userSessionList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, + isDescending, initialSkip, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * 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. @@ -1067,7 +808,7 @@ public PagedIterable list(String resourceGroupName, String hos /** * 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. @@ -1081,21 +822,15 @@ public PagedIterable list(String resourceGroupName, String hos * @return userSessionList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listAsync(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context)); } /** * 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. @@ -1106,19 +841,15 @@ public PagedIterable list( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> disconnectWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1136,25 +867,15 @@ public Mono> disconnectWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .disconnect( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - accept, - context)) + .withContext(context -> service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -1166,19 +887,15 @@ public Mono> disconnectWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disconnectWithResponseAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { + private Mono> disconnectWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1196,22 +913,14 @@ private Mono> disconnectWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .disconnect( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - accept, - context); + return service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, accept, + context); } /** * 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. @@ -1222,15 +931,15 @@ private Mono> disconnectWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono disconnectAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public Mono disconnectAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId) .flatMap(ignored -> Mono.empty()); } /** * 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. @@ -1242,15 +951,15 @@ public Mono disconnectAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response disconnectWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { + public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context) { return disconnectWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context) .block(); } /** * 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. @@ -1260,14 +969,14 @@ public Response disconnectWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void disconnect( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, Context.NONE); } /** * 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. @@ -1279,23 +988,15 @@ public void disconnect( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sendMessageWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage) { + public Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, SendMessage sendMessage) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1316,26 +1017,15 @@ public Mono> sendMessageWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .sendMessage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - sendMessage, - accept, - context)) + .withContext(context -> service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -1348,24 +1038,15 @@ public Mono> sendMessageWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> sendMessageWithResponseAsync( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage, - Context context) { + private Mono> sendMessageWithResponseAsync(String resourceGroupName, String hostPoolName, + String sessionHostname, String userSessionId, SendMessage sendMessage, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1386,23 +1067,14 @@ private Mono> sendMessageWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .sendMessage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - hostPoolName, - sessionHostname, - userSessionId, - sendMessage, - accept, - context); + return service.sendMessage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage, accept, context); } /** * 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. @@ -1413,17 +1085,16 @@ private Mono> sendMessageWithResponseAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono sendMessageAsync( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public Mono sendMessageAsync(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { final SendMessage sendMessage = null; - return sendMessageWithResponseAsync( - resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage) - .flatMap(ignored -> Mono.empty()); + return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage).flatMap(ignored -> Mono.empty()); } /** * 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. @@ -1436,21 +1107,15 @@ public Mono sendMessageAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response sendMessageWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage, - Context context) { - return sendMessageWithResponseAsync( - resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, context) - .block(); + public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context) { + return sendMessageWithResponseAsync(resourceGroupName, hostPoolName, sessionHostname, userSessionId, + sendMessage, context).block(); } /** * 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. @@ -1460,18 +1125,17 @@ public Response sendMessageWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void sendMessage( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { final SendMessage sendMessage = null; - sendMessageWithResponse( - resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, Context.NONE); + sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, + Context.NONE); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1483,31 +1147,21 @@ private Mono> listByHostPoolNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1520,31 +1174,20 @@ private Mono> listByHostPoolNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByHostPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1556,31 +1199,20 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1593,23 +1225,13 @@ private Mono> listNextSinglePageAsync(String nex return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java index 5630acfc5647..a7e19734e9df 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/UserSessionsImpl.java @@ -22,8 +22,7 @@ public final class UserSessionsImpl implements UserSessions { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public UserSessionsImpl( - UserSessionsClient innerClient, + public UserSessionsImpl(UserSessionsClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,45 +30,32 @@ public UserSessionsImpl( public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) { PagedIterable inner = this.serviceClient().listByHostPool(resourceGroupName, hostPoolName); - return Utils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } - public PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByHostPool(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); + public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .listByHostPool(resourceGroupName, hostPoolName, filter, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context); + public Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new UserSessionImpl(inner.getValue(), this.manager())); } else { return null; } } - public UserSession get( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { - UserSessionInner inner = - this.serviceClient().get(resourceGroupName, hostPoolName, sessionHostname, userSessionId); + public UserSession get(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { + UserSessionInner inner + = this.serviceClient().get(resourceGroupName, hostPoolName, sessionHostname, userSessionId); if (inner != null) { return new UserSessionImpl(inner, this.manager()); } else { @@ -77,15 +63,9 @@ public UserSession get( } } - public Response deleteWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - Boolean force, - Context context) { - return this - .serviceClient() + public Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Boolean force, Context context) { + return this.serviceClient() .deleteWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, force, context); } @@ -94,53 +74,38 @@ public void delete(String resourceGroupName, String hostPoolName, String session } public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, hostPoolName, sessionHostname); - return Utils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, hostPoolName, sessionHostname); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } - public PagedIterable list( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); + public PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, hostPoolName, sessionHostname, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UserSessionImpl(inner1, this.manager())); } - public Response disconnectWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context) { - return this - .serviceClient() + public Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context) { + return this.serviceClient() .disconnectWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, context); } - public void disconnect( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public void disconnect(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { this.serviceClient().disconnect(resourceGroupName, hostPoolName, sessionHostname, userSessionId); } - public Response sendMessageWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage, - Context context) { - return this - .serviceClient() - .sendMessageWithResponse( - resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, context); + public Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context) { + return this.serviceClient() + .sendMessageWithResponse(resourceGroupName, hostPoolName, sessionHostname, userSessionId, sendMessage, + context); } - public void sendMessage( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId) { + public void sendMessage(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId) { this.serviceClient().sendMessage(resourceGroupName, hostPoolName, sessionHostname, userSessionId); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java index a8176e9298ae..dc51afb0b309 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspaceImpl.java @@ -147,27 +147,23 @@ public WorkspaceImpl withExistingResourceGroup(String resourceGroupName) { } public Workspace create() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, this.innerModel(), Context.NONE) + .getValue(); return this; } public Workspace create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, this.innerModel(), context) + .getValue(); return this; } - WorkspaceImpl( - String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { + WorkspaceImpl(String name, + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = new WorkspaceInner(); this.serviceManager = serviceManager; this.workspaceName = name; @@ -179,51 +175,42 @@ public WorkspaceImpl update() { } public Workspace apply() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .updateWithResponse(resourceGroupName, workspaceName, updateWorkspace, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .updateWithResponse(resourceGroupName, workspaceName, updateWorkspace, Context.NONE) + .getValue(); return this; } public Workspace apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .updateWithResponse(resourceGroupName, workspaceName, updateWorkspace, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .updateWithResponse(resourceGroupName, workspaceName, updateWorkspace, context) + .getValue(); return this; } - WorkspaceImpl( - WorkspaceInner innerObject, + WorkspaceImpl(WorkspaceInner innerObject, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); } public Workspace refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE) + .getValue(); return this; } public Workspace refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaces() - .getByResourceGroupWithResponse(resourceGroupName, workspaceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, context) + .getValue(); return this; } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java index 6b2b1ae48b9a..f123b87de993 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesClientImpl.java @@ -35,22 +35,28 @@ import com.azure.resourcemanager.desktopvirtualization.models.WorkspacePatch; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +/** + * An instance of this class provides access to all the operations defined in WorkspacesClient. + */ public final class WorkspacesClientImpl implements WorkspacesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final WorkspacesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DesktopVirtualizationApiClientImpl client; /** * Initializes an instance of WorkspacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ WorkspacesClientImpl(DesktopVirtualizationApiClientImpl client) { - this.service = - RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,115 +67,82 @@ public final class WorkspacesClientImpl implements WorkspacesClient { @Host("{$host}") @ServiceInterface(name = "DesktopVirtualizatio") public interface WorkspacesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") - @ExpectedResponses({200, 201}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspaceInner workspace, - @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceInner workspace, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") WorkspacePatch workspace, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspacePatch workspace, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("pageSize") Integer pageSize, - @QueryParam("isDescending") Boolean isDescending, - @QueryParam("initialSkip") Integer initialSkip, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("pageSize") Integer pageSize, + @QueryParam("isDescending") Boolean isDescending, @QueryParam("initialSkip") Integer initialSkip, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * 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. @@ -178,19 +151,15 @@ Mono> listBySubscriptionNext( * @return a workspace along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String workspaceName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -201,23 +170,14 @@ public Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -227,19 +187,15 @@ public Mono> getByResourceGroupWithResponseAsync( * @return a workspace along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String workspaceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -250,20 +206,13 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); } /** * 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. @@ -279,7 +228,7 @@ public Mono getByResourceGroupAsync(String resourceGroupName, St /** * Get a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -289,14 +238,14 @@ public Mono getByResourceGroupAsync(String resourceGroupName, St * @return a workspace along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** * 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. @@ -311,7 +260,7 @@ public WorkspaceInner getByResourceGroup(String resourceGroupName, String worksp /** * 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. @@ -321,19 +270,15 @@ public WorkspaceInner getByResourceGroup(String resourceGroupName, String worksp * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, WorkspaceInner workspace) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -349,24 +294,14 @@ public Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - workspace, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -377,19 +312,15 @@ public Mono> createOrUpdateWithResponseAsync( * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, WorkspaceInner workspace, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -405,21 +336,13 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - workspace, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context); } /** * 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. @@ -429,15 +352,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return represents a Workspace definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String workspaceName, WorkspaceInner workspace) { + public Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + WorkspaceInner workspace) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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. @@ -448,14 +371,14 @@ public Mono createOrUpdateAsync( * @return represents a Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String workspaceName, WorkspaceInner workspace, Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner workspace, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspace, context).block(); } /** * 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. @@ -471,7 +394,7 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN /** * 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. @@ -482,16 +405,12 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -502,23 +421,14 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Remove a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -528,19 +438,15 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String workspaceName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -551,20 +457,13 @@ private Mono> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** * 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. @@ -579,7 +478,7 @@ public Mono deleteAsync(String resourceGroupName, String workspaceName) { /** * Remove a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -595,7 +494,7 @@ public Response deleteWithResponse(String resourceGroupName, String worksp /** * 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. @@ -609,7 +508,7 @@ public void delete(String resourceGroupName, String workspaceName) { /** * 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. @@ -619,19 +518,15 @@ public void delete(String resourceGroupName, String workspaceName) { * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspacePatch workspace) { + public Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspacePatch workspace) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -645,24 +540,14 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - workspace, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -673,19 +558,15 @@ public Mono> updateWithResponseAsync( * @return represents a Workspace definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String workspaceName, WorkspacePatch workspace, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + WorkspacePatch workspace, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -699,21 +580,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - workspaceName, - workspace, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, workspace, accept, context); } /** * 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. @@ -730,7 +603,7 @@ public Mono updateAsync(String resourceGroupName, String workspa /** * 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. @@ -741,14 +614,14 @@ public Mono updateAsync(String resourceGroupName, String workspa * @return represents a Workspace definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String workspaceName, WorkspacePatch workspace, Context context) { + public Response updateWithResponse(String resourceGroupName, String workspaceName, + WorkspacePatch workspace, Context context) { return updateWithResponseAsync(resourceGroupName, workspaceName, workspace, context).block(); } /** * 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. @@ -764,7 +637,7 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName) { /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -775,19 +648,15 @@ public WorkspaceInner update(String resourceGroupName, String workspaceName) { * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -795,34 +664,17 @@ private Mono> listByResourceGroupSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -834,19 +686,15 @@ private Mono> listByResourceGroupSinglePageAsync( * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -854,31 +702,15 @@ private Mono> listByResourceGroupSinglePageAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - pageSize, - isDescending, - initialSkip, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pageSize, isDescending, initialSkip, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -889,8 +721,8 @@ private Mono> listByResourceGroupSinglePageAsync( * @return workspaceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip) { + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); @@ -898,7 +730,7 @@ public PagedFlux listByResourceGroupAsync( /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -917,7 +749,7 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupNa /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -929,8 +761,8 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupNa * @return workspaceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, pageSize, isDescending, initialSkip, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); @@ -938,7 +770,7 @@ private PagedFlux listByResourceGroupAsync( /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -955,7 +787,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -967,15 +799,15 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * @return workspaceList as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { return new PagedIterable<>( listByResourceGroupAsync(resourceGroupName, pageSize, isDescending, initialSkip, context)); } /** * List workspaces in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. @@ -983,43 +815,25 @@ public PagedIterable listByResourceGroup( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List workspaces in subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1029,53 +843,38 @@ private Mono> listSinglePageAsync() { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List workspaces in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List workspaces in subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1084,13 +883,13 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List workspaces in subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList as paginated response with {@link PagedIterable}. @@ -1102,7 +901,7 @@ public PagedIterable list() { /** * List workspaces in subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1116,9 +915,8 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1130,32 +928,22 @@ private Mono> listByResourceGroupNextSinglePageAsy return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1163,37 +951,26 @@ private Mono> listByResourceGroupNextSinglePageAsy * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1205,32 +982,22 @@ private Mono> listBySubscriptionNextSinglePageAsyn return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1238,29 +1005,19 @@ private Mono> listBySubscriptionNextSinglePageAsyn * @return workspaceList along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java index d7ef068f04b0..526ce4c893cd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/WorkspacesImpl.java @@ -21,22 +21,18 @@ public final class WorkspacesImpl implements Workspaces { private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager; - public WorkspacesImpl( - WorkspacesClient innerClient, + public WorkspacesImpl(WorkspacesClient innerClient, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkspaceImpl(inner.getValue(), this.manager())); } else { return null; @@ -52,8 +48,8 @@ public Workspace getByResourceGroup(String resourceGroupName, String workspaceNa } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String workspaceName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, context); } @@ -63,98 +59,78 @@ public void deleteByResourceGroup(String resourceGroupName, String workspaceName public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + public PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, pageSize, isDescending, initialSkip, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); } public Workspace getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } this.deleteByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + String workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); if (workspaceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); } return this.deleteByResourceGroupWithResponse(resourceGroupName, workspaceName, context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java index de33399c24a1..fcc669a8bf54 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for DesktopVirtualizationApiClient. null. */ +/** + * Package containing the implementations for DesktopVirtualizationApiClient. + * null. + */ package com.azure.resourcemanager.desktopvirtualization.implementation; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java index 3f23da610e87..0d320df65485 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdatePatchProperties.java @@ -5,22 +5,26 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The session host configuration for updating agent, monitoring agent, and stack component. */ +/** + * The session host configuration for updating agent, monitoring agent, and stack component. + */ @Fluent -public final class AgentUpdatePatchProperties { +public final class AgentUpdatePatchProperties implements JsonSerializable { /* * The type of maintenance for session host components. */ - @JsonProperty(value = "type") private SessionHostComponentUpdateType type; /* * Whether to use localTime of the virtual machine. */ - @JsonProperty(value = "useSessionHostLocalTime") private Boolean useSessionHostLocalTime; /* @@ -28,22 +32,22 @@ public final class AgentUpdatePatchProperties { * https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. Must be set * if useLocalTime is true. */ - @JsonProperty(value = "maintenanceWindowTimeZone") private String maintenanceWindowTimeZone; /* * List of maintenance windows. Maintenance windows are 2 hours long. */ - @JsonProperty(value = "maintenanceWindows") private List maintenanceWindows; - /** Creates an instance of AgentUpdatePatchProperties class. */ + /** + * Creates an instance of AgentUpdatePatchProperties class. + */ public AgentUpdatePatchProperties() { } /** * Get the type property: The type of maintenance for session host components. - * + * * @return the type value. */ public SessionHostComponentUpdateType type() { @@ -52,7 +56,7 @@ public SessionHostComponentUpdateType type() { /** * Set the type property: The type of maintenance for session host components. - * + * * @param type the type value to set. * @return the AgentUpdatePatchProperties object itself. */ @@ -63,7 +67,7 @@ public AgentUpdatePatchProperties withType(SessionHostComponentUpdateType type) /** * Get the useSessionHostLocalTime property: Whether to use localTime of the virtual machine. - * + * * @return the useSessionHostLocalTime value. */ public Boolean useSessionHostLocalTime() { @@ -72,7 +76,7 @@ public Boolean useSessionHostLocalTime() { /** * Set the useSessionHostLocalTime property: Whether to use localTime of the virtual machine. - * + * * @param useSessionHostLocalTime the useSessionHostLocalTime value to set. * @return the AgentUpdatePatchProperties object itself. */ @@ -85,7 +89,7 @@ public AgentUpdatePatchProperties withUseSessionHostLocalTime(Boolean useSession * Get the maintenanceWindowTimeZone property: Time zone for maintenance as defined in * https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. Must be set * if useLocalTime is true. - * + * * @return the maintenanceWindowTimeZone value. */ public String maintenanceWindowTimeZone() { @@ -96,7 +100,7 @@ public String maintenanceWindowTimeZone() { * Set the maintenanceWindowTimeZone property: Time zone for maintenance as defined in * https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. Must be set * if useLocalTime is true. - * + * * @param maintenanceWindowTimeZone the maintenanceWindowTimeZone value to set. * @return the AgentUpdatePatchProperties object itself. */ @@ -107,7 +111,7 @@ public AgentUpdatePatchProperties withMaintenanceWindowTimeZone(String maintenan /** * Get the maintenanceWindows property: List of maintenance windows. Maintenance windows are 2 hours long. - * + * * @return the maintenanceWindows value. */ public List maintenanceWindows() { @@ -116,19 +120,19 @@ public List maintenanceWindows() { /** * Set the maintenanceWindows property: List of maintenance windows. Maintenance windows are 2 hours long. - * + * * @param maintenanceWindows the maintenanceWindows value to set. * @return the AgentUpdatePatchProperties object itself. */ - public AgentUpdatePatchProperties withMaintenanceWindows( - List maintenanceWindows) { + public AgentUpdatePatchProperties + withMaintenanceWindows(List maintenanceWindows) { this.maintenanceWindows = maintenanceWindows; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -136,4 +140,54 @@ public void validate() { maintenanceWindows().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("useSessionHostLocalTime", this.useSessionHostLocalTime); + jsonWriter.writeStringField("maintenanceWindowTimeZone", this.maintenanceWindowTimeZone); + jsonWriter.writeArrayField("maintenanceWindows", this.maintenanceWindows, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentUpdatePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentUpdatePatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentUpdatePatchProperties. + */ + public static AgentUpdatePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentUpdatePatchProperties deserializedAgentUpdatePatchProperties = new AgentUpdatePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAgentUpdatePatchProperties.type + = SessionHostComponentUpdateType.fromString(reader.getString()); + } else if ("useSessionHostLocalTime".equals(fieldName)) { + deserializedAgentUpdatePatchProperties.useSessionHostLocalTime + = reader.getNullable(JsonReader::getBoolean); + } else if ("maintenanceWindowTimeZone".equals(fieldName)) { + deserializedAgentUpdatePatchProperties.maintenanceWindowTimeZone = reader.getString(); + } else if ("maintenanceWindows".equals(fieldName)) { + List maintenanceWindows + = reader.readArray(reader1 -> MaintenanceWindowPatchProperties.fromJson(reader1)); + deserializedAgentUpdatePatchProperties.maintenanceWindows = maintenanceWindows; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentUpdatePatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java index b82f435aa0e1..40f25415b7cb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AgentUpdateProperties.java @@ -5,22 +5,26 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** The session host configuration for updating agent, monitoring agent, and stack component. */ +/** + * The session host configuration for updating agent, monitoring agent, and stack component. + */ @Fluent -public final class AgentUpdateProperties { +public final class AgentUpdateProperties implements JsonSerializable { /* * The type of maintenance for session host components. */ - @JsonProperty(value = "type") private SessionHostComponentUpdateType type; /* * Whether to use localTime of the virtual machine. */ - @JsonProperty(value = "useSessionHostLocalTime") private Boolean useSessionHostLocalTime; /* @@ -28,22 +32,22 @@ public final class AgentUpdateProperties { * https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. Must be set * if useLocalTime is true. */ - @JsonProperty(value = "maintenanceWindowTimeZone") private String maintenanceWindowTimeZone; /* * List of maintenance windows. Maintenance windows are 2 hours long. */ - @JsonProperty(value = "maintenanceWindows") private List maintenanceWindows; - /** Creates an instance of AgentUpdateProperties class. */ + /** + * Creates an instance of AgentUpdateProperties class. + */ public AgentUpdateProperties() { } /** * Get the type property: The type of maintenance for session host components. - * + * * @return the type value. */ public SessionHostComponentUpdateType type() { @@ -52,7 +56,7 @@ public SessionHostComponentUpdateType type() { /** * Set the type property: The type of maintenance for session host components. - * + * * @param type the type value to set. * @return the AgentUpdateProperties object itself. */ @@ -63,7 +67,7 @@ public AgentUpdateProperties withType(SessionHostComponentUpdateType type) { /** * Get the useSessionHostLocalTime property: Whether to use localTime of the virtual machine. - * + * * @return the useSessionHostLocalTime value. */ public Boolean useSessionHostLocalTime() { @@ -72,7 +76,7 @@ public Boolean useSessionHostLocalTime() { /** * Set the useSessionHostLocalTime property: Whether to use localTime of the virtual machine. - * + * * @param useSessionHostLocalTime the useSessionHostLocalTime value to set. * @return the AgentUpdateProperties object itself. */ @@ -85,7 +89,7 @@ public AgentUpdateProperties withUseSessionHostLocalTime(Boolean useSessionHostL * Get the maintenanceWindowTimeZone property: Time zone for maintenance as defined in * https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. Must be set * if useLocalTime is true. - * + * * @return the maintenanceWindowTimeZone value. */ public String maintenanceWindowTimeZone() { @@ -96,7 +100,7 @@ public String maintenanceWindowTimeZone() { * Set the maintenanceWindowTimeZone property: Time zone for maintenance as defined in * https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. Must be set * if useLocalTime is true. - * + * * @param maintenanceWindowTimeZone the maintenanceWindowTimeZone value to set. * @return the AgentUpdateProperties object itself. */ @@ -107,7 +111,7 @@ public AgentUpdateProperties withMaintenanceWindowTimeZone(String maintenanceWin /** * Get the maintenanceWindows property: List of maintenance windows. Maintenance windows are 2 hours long. - * + * * @return the maintenanceWindows value. */ public List maintenanceWindows() { @@ -116,7 +120,7 @@ public List maintenanceWindows() { /** * Set the maintenanceWindows property: List of maintenance windows. Maintenance windows are 2 hours long. - * + * * @param maintenanceWindows the maintenanceWindows value to set. * @return the AgentUpdateProperties object itself. */ @@ -127,7 +131,7 @@ public AgentUpdateProperties withMaintenanceWindows(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("useSessionHostLocalTime", this.useSessionHostLocalTime); + jsonWriter.writeStringField("maintenanceWindowTimeZone", this.maintenanceWindowTimeZone); + jsonWriter.writeArrayField("maintenanceWindows", this.maintenanceWindows, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentUpdateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentUpdateProperties. + */ + public static AgentUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentUpdateProperties deserializedAgentUpdateProperties = new AgentUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAgentUpdateProperties.type + = SessionHostComponentUpdateType.fromString(reader.getString()); + } else if ("useSessionHostLocalTime".equals(fieldName)) { + deserializedAgentUpdateProperties.useSessionHostLocalTime + = reader.getNullable(JsonReader::getBoolean); + } else if ("maintenanceWindowTimeZone".equals(fieldName)) { + deserializedAgentUpdateProperties.maintenanceWindowTimeZone = reader.getString(); + } else if ("maintenanceWindows".equals(fieldName)) { + List maintenanceWindows + = reader.readArray(reader1 -> MaintenanceWindowProperties.fromJson(reader1)); + deserializedAgentUpdateProperties.maintenanceWindows = maintenanceWindows; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentUpdateProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java new file mode 100644 index 000000000000..5c13080c7a84 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackage.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import java.util.Map; + +/** + * An immutable client-side representation of AppAttachPackage. + */ +public interface AppAttachPackage { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Detailed properties for App Attach Package. + * + * @return the properties value. + */ + AppAttachPackageProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner object. + * + * @return the inner object. + */ + AppAttachPackageInner innerModel(); + + /** + * The entirety of the AppAttachPackage definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The AppAttachPackage definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AppAttachPackage definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AppAttachPackage definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for App Attach Package. + * + * @param properties Detailed properties for App Attach Package. + * @return the next definition stage. + */ + WithCreate withProperties(AppAttachPackageProperties properties); + } + + /** + * The stage of the AppAttachPackage definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + AppAttachPackage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AppAttachPackage create(Context context); + } + + /** + * The stage of the AppAttachPackage definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + + /** + * Begins update for the AppAttachPackage resource. + * + * @return the stage of resource update. + */ + AppAttachPackage.Update update(); + + /** + * The template for AppAttachPackage update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AppAttachPackage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AppAttachPackage apply(Context context); + } + + /** + * The AppAttachPackage update stages. + */ + interface UpdateStages { + /** + * The stage of the AppAttachPackage update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Detailed properties for App Attach Package. + * + * @param properties Detailed properties for App Attach Package. + * @return the next definition stage. + */ + Update withProperties(AppAttachPackagePatchProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AppAttachPackage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AppAttachPackage refresh(Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java new file mode 100644 index 000000000000..44354602f315 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageArchitectures.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible device architectures that an app attach package can be configured for. + */ +public final class AppAttachPackageArchitectures extends ExpandableStringEnum { + /** + * Static value ARM for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures ARM = fromString("ARM"); + + /** + * Static value ARM64 for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures ARM64 = fromString("ARM64"); + + /** + * Static value x86 for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures X86 = fromString("x86"); + + /** + * Static value x64 for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures X64 = fromString("x64"); + + /** + * Static value Neutral for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures NEUTRAL = fromString("Neutral"); + + /** + * Static value x86a64 for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures X86A64 = fromString("x86a64"); + + /** + * Static value ALL for AppAttachPackageArchitectures. + */ + public static final AppAttachPackageArchitectures ALL = fromString("ALL"); + + /** + * Creates a new instance of AppAttachPackageArchitectures value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AppAttachPackageArchitectures() { + } + + /** + * Creates or finds a AppAttachPackageArchitectures from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppAttachPackageArchitectures. + */ + public static AppAttachPackageArchitectures fromString(String name) { + return fromString(name, AppAttachPackageArchitectures.class); + } + + /** + * Gets known AppAttachPackageArchitectures values. + * + * @return known AppAttachPackageArchitectures values. + */ + public static Collection values() { + return values(AppAttachPackageArchitectures.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java new file mode 100644 index 000000000000..2e6acbe77ee2 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoProperties.java @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Schema for Import Package Information properties. + */ +@Fluent +public final class AppAttachPackageInfoProperties implements JsonSerializable { + /* + * Alias of App Attach Package. Assigned at import time + */ + private String packageAlias; + + /* + * VHD/CIM image path on Network Share. + */ + private String imagePath; + + /* + * Package Name from appxmanifest.xml. + */ + private String packageName; + + /* + * Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + */ + private String packageFamilyName; + + /* + * Package Full Name from appxmanifest.xml. + */ + private String packageFullName; + + /* + * User friendly Name to be displayed in the portal. + */ + private String displayName; + + /* + * Relative Path to the package inside the image. + */ + private String packageRelativePath; + + /* + * Specifies how to register Package in feed. + */ + private Boolean isRegularRegistration; + + /* + * Make this version of the package the active one across the hostpool. + */ + private Boolean isActive; + + /* + * List of package dependencies. + */ + private List packageDependencies; + + /* + * Package version found in the appxmanifest.xml. + */ + private String version; + + /* + * Date Package was last updated, found in the appxmanifest.xml. + */ + private OffsetDateTime lastUpdated; + + /* + * List of package applications. + */ + private List packageApplications; + + /* + * Certificate name found in the appxmanifest.xml. + */ + private String certificateName; + + /* + * Date certificate expires, found in the appxmanifest.xml. + */ + private OffsetDateTime certificateExpiry; + + /* + * Is package timestamped so it can ignore the certificate expiry date + */ + private PackageTimestamped isPackageTimestamped; + + /** + * Creates an instance of AppAttachPackageInfoProperties class. + */ + public AppAttachPackageInfoProperties() { + } + + /** + * Get the packageAlias property: Alias of App Attach Package. Assigned at import time. + * + * @return the packageAlias value. + */ + public String packageAlias() { + return this.packageAlias; + } + + /** + * Set the packageAlias property: Alias of App Attach Package. Assigned at import time. + * + * @param packageAlias the packageAlias value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageAlias(String packageAlias) { + this.packageAlias = packageAlias; + return this; + } + + /** + * Get the imagePath property: VHD/CIM image path on Network Share. + * + * @return the imagePath value. + */ + public String imagePath() { + return this.imagePath; + } + + /** + * Set the imagePath property: VHD/CIM image path on Network Share. + * + * @param imagePath the imagePath value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withImagePath(String imagePath) { + this.imagePath = imagePath; + return this; + } + + /** + * Get the packageName property: Package Name from appxmanifest.xml. + * + * @return the packageName value. + */ + public String packageName() { + return this.packageName; + } + + /** + * Set the packageName property: Package Name from appxmanifest.xml. + * + * @param packageName the packageName value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and + * Publisher name. + * + * @return the packageFamilyName value. + */ + public String packageFamilyName() { + return this.packageFamilyName; + } + + /** + * Set the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and + * Publisher name. + * + * @param packageFamilyName the packageFamilyName value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageFamilyName(String packageFamilyName) { + this.packageFamilyName = packageFamilyName; + return this; + } + + /** + * Get the packageFullName property: Package Full Name from appxmanifest.xml. + * + * @return the packageFullName value. + */ + public String packageFullName() { + return this.packageFullName; + } + + /** + * Set the packageFullName property: Package Full Name from appxmanifest.xml. + * + * @param packageFullName the packageFullName value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageFullName(String packageFullName) { + this.packageFullName = packageFullName; + return this; + } + + /** + * Get the displayName property: User friendly Name to be displayed in the portal. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: User friendly Name to be displayed in the portal. + * + * @param displayName the displayName value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the packageRelativePath property: Relative Path to the package inside the image. + * + * @return the packageRelativePath value. + */ + public String packageRelativePath() { + return this.packageRelativePath; + } + + /** + * Set the packageRelativePath property: Relative Path to the package inside the image. + * + * @param packageRelativePath the packageRelativePath value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageRelativePath(String packageRelativePath) { + this.packageRelativePath = packageRelativePath; + return this; + } + + /** + * Get the isRegularRegistration property: Specifies how to register Package in feed. + * + * @return the isRegularRegistration value. + */ + public Boolean isRegularRegistration() { + return this.isRegularRegistration; + } + + /** + * Set the isRegularRegistration property: Specifies how to register Package in feed. + * + * @param isRegularRegistration the isRegularRegistration value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withIsRegularRegistration(Boolean isRegularRegistration) { + this.isRegularRegistration = isRegularRegistration; + return this; + } + + /** + * Get the isActive property: Make this version of the package the active one across the hostpool. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Set the isActive property: Make this version of the package the active one across the hostpool. + * + * @param isActive the isActive value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withIsActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get the packageDependencies property: List of package dependencies. + * + * @return the packageDependencies value. + */ + public List packageDependencies() { + return this.packageDependencies; + } + + /** + * Set the packageDependencies property: List of package dependencies. + * + * @param packageDependencies the packageDependencies value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageDependencies(List packageDependencies) { + this.packageDependencies = packageDependencies; + return this; + } + + /** + * Get the version property: Package version found in the appxmanifest.xml. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Package version found in the appxmanifest.xml. + * + * @param version the version value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. + * + * @return the lastUpdated value. + */ + public OffsetDateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. + * + * @param lastUpdated the lastUpdated value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withLastUpdated(OffsetDateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the packageApplications property: List of package applications. + * + * @return the packageApplications value. + */ + public List packageApplications() { + return this.packageApplications; + } + + /** + * Set the packageApplications property: List of package applications. + * + * @param packageApplications the packageApplications value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withPackageApplications(List packageApplications) { + this.packageApplications = packageApplications; + return this; + } + + /** + * Get the certificateName property: Certificate name found in the appxmanifest.xml. + * + * @return the certificateName value. + */ + public String certificateName() { + return this.certificateName; + } + + /** + * Set the certificateName property: Certificate name found in the appxmanifest.xml. + * + * @param certificateName the certificateName value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withCertificateName(String certificateName) { + this.certificateName = certificateName; + return this; + } + + /** + * Get the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. + * + * @return the certificateExpiry value. + */ + public OffsetDateTime certificateExpiry() { + return this.certificateExpiry; + } + + /** + * Set the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. + * + * @param certificateExpiry the certificateExpiry value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withCertificateExpiry(OffsetDateTime certificateExpiry) { + this.certificateExpiry = certificateExpiry; + return this; + } + + /** + * Get the isPackageTimestamped property: Is package timestamped so it can ignore the certificate expiry date. + * + * @return the isPackageTimestamped value. + */ + public PackageTimestamped isPackageTimestamped() { + return this.isPackageTimestamped; + } + + /** + * Set the isPackageTimestamped property: Is package timestamped so it can ignore the certificate expiry date. + * + * @param isPackageTimestamped the isPackageTimestamped value to set. + * @return the AppAttachPackageInfoProperties object itself. + */ + public AppAttachPackageInfoProperties withIsPackageTimestamped(PackageTimestamped isPackageTimestamped) { + this.isPackageTimestamped = isPackageTimestamped; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (packageDependencies() != null) { + packageDependencies().forEach(e -> e.validate()); + } + if (packageApplications() != null) { + packageApplications().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("packageAlias", this.packageAlias); + jsonWriter.writeStringField("imagePath", this.imagePath); + jsonWriter.writeStringField("packageName", this.packageName); + jsonWriter.writeStringField("packageFamilyName", this.packageFamilyName); + jsonWriter.writeStringField("packageFullName", this.packageFullName); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("packageRelativePath", this.packageRelativePath); + jsonWriter.writeBooleanField("isRegularRegistration", this.isRegularRegistration); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeArrayField("packageDependencies", this.packageDependencies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("lastUpdated", + this.lastUpdated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdated)); + jsonWriter.writeArrayField("packageApplications", this.packageApplications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("certificateName", this.certificateName); + jsonWriter.writeStringField("certificateExpiry", + this.certificateExpiry == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.certificateExpiry)); + jsonWriter.writeStringField("isPackageTimestamped", + this.isPackageTimestamped == null ? null : this.isPackageTimestamped.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppAttachPackageInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppAttachPackageInfoProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppAttachPackageInfoProperties. + */ + public static AppAttachPackageInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppAttachPackageInfoProperties deserializedAppAttachPackageInfoProperties + = new AppAttachPackageInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("packageAlias".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.packageAlias = reader.getString(); + } else if ("imagePath".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.imagePath = reader.getString(); + } else if ("packageName".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.packageName = reader.getString(); + } else if ("packageFamilyName".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.packageFamilyName = reader.getString(); + } else if ("packageFullName".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.packageFullName = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.displayName = reader.getString(); + } else if ("packageRelativePath".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.packageRelativePath = reader.getString(); + } else if ("isRegularRegistration".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.isRegularRegistration + = reader.getNullable(JsonReader::getBoolean); + } else if ("isActive".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("packageDependencies".equals(fieldName)) { + List packageDependencies + = reader.readArray(reader1 -> MsixPackageDependencies.fromJson(reader1)); + deserializedAppAttachPackageInfoProperties.packageDependencies = packageDependencies; + } else if ("version".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.version = reader.getString(); + } else if ("lastUpdated".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.lastUpdated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("packageApplications".equals(fieldName)) { + List packageApplications + = reader.readArray(reader1 -> MsixPackageApplications.fromJson(reader1)); + deserializedAppAttachPackageInfoProperties.packageApplications = packageApplications; + } else if ("certificateName".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.certificateName = reader.getString(); + } else if ("certificateExpiry".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.certificateExpiry = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("isPackageTimestamped".equals(fieldName)) { + deserializedAppAttachPackageInfoProperties.isPackageTimestamped + = PackageTimestamped.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAppAttachPackageInfoProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java new file mode 100644 index 000000000000..2a9a9318daed --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageInfoes.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of AppAttachPackageInfoes. + */ +public interface AppAttachPackageInfoes { + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with + * {@link PagedIterable}. + */ + PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest); + + /** + * Gets information from a package given the path to the package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param importPackageInfoRequest Object containing URI to package image and other optional properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from a package given the path to the package as paginated response with + * {@link PagedIterable}. + */ + PagedIterable importMethod(String resourceGroupName, String hostPoolName, + ImportPackageInfoRequest importPackageInfoRequest, Context context); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java new file mode 100644 index 000000000000..208512a65b36 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageList.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.desktopvirtualization.fluent.models.AppAttachPackageInner; +import java.io.IOException; +import java.util.List; + +/** + * AppAttachPackageList + * + * List of App Attach Package definitions. + */ +@Fluent +public final class AppAttachPackageList implements JsonSerializable { + /* + * List of App Attach Package definitions. + */ + private List value; + + /* + * Link to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of AppAttachPackageList class. + */ + public AppAttachPackageList() { + } + + /** + * Get the value property: List of App Attach Package definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of App Attach Package definitions. + * + * @param value the value value to set. + * @return the AppAttachPackageList object itself. + */ + public AppAttachPackageList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppAttachPackageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppAttachPackageList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppAttachPackageList. + */ + public static AppAttachPackageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppAttachPackageList deserializedAppAttachPackageList = new AppAttachPackageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AppAttachPackageInner.fromJson(reader1)); + deserializedAppAttachPackageList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppAttachPackageList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppAttachPackageList; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java new file mode 100644 index 000000000000..3ea0a89f04ed --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatch.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Schema for updatable App Attach Package properties. + */ +@Fluent +public final class AppAttachPackagePatch extends ProxyResource { + /* + * Detailed properties for App Attach Package + */ + private AppAttachPackagePatchProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AppAttachPackagePatch class. + */ + public AppAttachPackagePatch() { + } + + /** + * Get the properties property: Detailed properties for App Attach Package. + * + * @return the properties value. + */ + public AppAttachPackagePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Detailed properties for App Attach Package. + * + * @param properties the properties value to set. + * @return the AppAttachPackagePatch object itself. + */ + public AppAttachPackagePatch withProperties(AppAttachPackagePatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppAttachPackagePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppAttachPackagePatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppAttachPackagePatch. + */ + public static AppAttachPackagePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppAttachPackagePatch deserializedAppAttachPackagePatch = new AppAttachPackagePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppAttachPackagePatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppAttachPackagePatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppAttachPackagePatch.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAppAttachPackagePatch.properties = AppAttachPackagePatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppAttachPackagePatch.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppAttachPackagePatch; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java new file mode 100644 index 000000000000..c19158727da9 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackagePatchProperties.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Schema for patchable fields on an App Attach Package. + */ +@Fluent +public final class AppAttachPackagePatchProperties implements JsonSerializable { + /* + * Detailed properties for App Attach Package + */ + private AppAttachPackageInfoProperties image; + + /* + * List of Hostpool resource Ids. + */ + private List hostPoolReferences; + + /* + * URL path to certificate name located in keyVault + */ + private String keyVaultUrl; + + /* + * Parameter indicating how the health check should behave if this package fails staging + */ + private FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure; + + /** + * Creates an instance of AppAttachPackagePatchProperties class. + */ + public AppAttachPackagePatchProperties() { + } + + /** + * Get the image property: Detailed properties for App Attach Package. + * + * @return the image value. + */ + public AppAttachPackageInfoProperties image() { + return this.image; + } + + /** + * Set the image property: Detailed properties for App Attach Package. + * + * @param image the image value to set. + * @return the AppAttachPackagePatchProperties object itself. + */ + public AppAttachPackagePatchProperties withImage(AppAttachPackageInfoProperties image) { + this.image = image; + return this; + } + + /** + * Get the hostPoolReferences property: List of Hostpool resource Ids. + * + * @return the hostPoolReferences value. + */ + public List hostPoolReferences() { + return this.hostPoolReferences; + } + + /** + * Set the hostPoolReferences property: List of Hostpool resource Ids. + * + * @param hostPoolReferences the hostPoolReferences value to set. + * @return the AppAttachPackagePatchProperties object itself. + */ + public AppAttachPackagePatchProperties withHostPoolReferences(List hostPoolReferences) { + this.hostPoolReferences = hostPoolReferences; + return this; + } + + /** + * Get the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @param keyVaultUrl the keyVaultUrl value to set. + * @return the AppAttachPackagePatchProperties object itself. + */ + public AppAttachPackagePatchProperties withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + + /** + * Get the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this + * package fails staging. + * + * @return the failHealthCheckOnStagingFailure value. + */ + public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() { + return this.failHealthCheckOnStagingFailure; + } + + /** + * Set the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this + * package fails staging. + * + * @param failHealthCheckOnStagingFailure the failHealthCheckOnStagingFailure value to set. + * @return the AppAttachPackagePatchProperties object itself. + */ + public AppAttachPackagePatchProperties + withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure) { + this.failHealthCheckOnStagingFailure = failHealthCheckOnStagingFailure; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() != null) { + image().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeArrayField("hostPoolReferences", this.hostPoolReferences, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("keyVaultURL", this.keyVaultUrl); + jsonWriter.writeStringField("failHealthCheckOnStagingFailure", + this.failHealthCheckOnStagingFailure == null ? null : this.failHealthCheckOnStagingFailure.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppAttachPackagePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppAttachPackagePatchProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppAttachPackagePatchProperties. + */ + public static AppAttachPackagePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppAttachPackagePatchProperties deserializedAppAttachPackagePatchProperties + = new AppAttachPackagePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("image".equals(fieldName)) { + deserializedAppAttachPackagePatchProperties.image = AppAttachPackageInfoProperties.fromJson(reader); + } else if ("hostPoolReferences".equals(fieldName)) { + List hostPoolReferences = reader.readArray(reader1 -> reader1.getString()); + deserializedAppAttachPackagePatchProperties.hostPoolReferences = hostPoolReferences; + } else if ("keyVaultURL".equals(fieldName)) { + deserializedAppAttachPackagePatchProperties.keyVaultUrl = reader.getString(); + } else if ("failHealthCheckOnStagingFailure".equals(fieldName)) { + deserializedAppAttachPackagePatchProperties.failHealthCheckOnStagingFailure + = FailHealthCheckOnStagingFailure.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAppAttachPackagePatchProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java new file mode 100644 index 000000000000..9cfcd7110011 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackageProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Schema for App Attach Package properties. + */ +@Fluent +public final class AppAttachPackageProperties implements JsonSerializable { + /* + * The provisioning state of the App Attach Package. + */ + private ProvisioningState provisioningState; + + /* + * Detailed properties for App Attach Package + */ + private AppAttachPackageInfoProperties image; + + /* + * List of Hostpool resource Ids. + */ + private List hostPoolReferences; + + /* + * URL path to certificate name located in keyVault + */ + private String keyVaultUrl; + + /* + * Parameter indicating how the health check should behave if this package fails staging + */ + private FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure; + + /** + * Creates an instance of AppAttachPackageProperties class. + */ + public AppAttachPackageProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the App Attach Package. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the image property: Detailed properties for App Attach Package. + * + * @return the image value. + */ + public AppAttachPackageInfoProperties image() { + return this.image; + } + + /** + * Set the image property: Detailed properties for App Attach Package. + * + * @param image the image value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties withImage(AppAttachPackageInfoProperties image) { + this.image = image; + return this; + } + + /** + * Get the hostPoolReferences property: List of Hostpool resource Ids. + * + * @return the hostPoolReferences value. + */ + public List hostPoolReferences() { + return this.hostPoolReferences; + } + + /** + * Set the hostPoolReferences property: List of Hostpool resource Ids. + * + * @param hostPoolReferences the hostPoolReferences value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties withHostPoolReferences(List hostPoolReferences) { + this.hostPoolReferences = hostPoolReferences; + return this; + } + + /** + * Get the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: URL path to certificate name located in keyVault. + * + * @param keyVaultUrl the keyVaultUrl value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + + /** + * Get the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this + * package fails staging. + * + * @return the failHealthCheckOnStagingFailure value. + */ + public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() { + return this.failHealthCheckOnStagingFailure; + } + + /** + * Set the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this + * package fails staging. + * + * @param failHealthCheckOnStagingFailure the failHealthCheckOnStagingFailure value to set. + * @return the AppAttachPackageProperties object itself. + */ + public AppAttachPackageProperties + withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure) { + this.failHealthCheckOnStagingFailure = failHealthCheckOnStagingFailure; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (image() != null) { + image().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeArrayField("hostPoolReferences", this.hostPoolReferences, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("keyVaultURL", this.keyVaultUrl); + jsonWriter.writeStringField("failHealthCheckOnStagingFailure", + this.failHealthCheckOnStagingFailure == null ? null : this.failHealthCheckOnStagingFailure.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppAttachPackageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppAttachPackageProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppAttachPackageProperties. + */ + public static AppAttachPackageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppAttachPackageProperties deserializedAppAttachPackageProperties = new AppAttachPackageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedAppAttachPackageProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("image".equals(fieldName)) { + deserializedAppAttachPackageProperties.image = AppAttachPackageInfoProperties.fromJson(reader); + } else if ("hostPoolReferences".equals(fieldName)) { + List hostPoolReferences = reader.readArray(reader1 -> reader1.getString()); + deserializedAppAttachPackageProperties.hostPoolReferences = hostPoolReferences; + } else if ("keyVaultURL".equals(fieldName)) { + deserializedAppAttachPackageProperties.keyVaultUrl = reader.getString(); + } else if ("failHealthCheckOnStagingFailure".equals(fieldName)) { + deserializedAppAttachPackageProperties.failHealthCheckOnStagingFailure + = FailHealthCheckOnStagingFailure.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAppAttachPackageProperties; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java new file mode 100644 index 000000000000..3e7f0b94f613 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/AppAttachPackages.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AppAttachPackages. + */ +public interface AppAttachPackages { + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + Context context); + + /** + * Get an app attach package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package. + */ + AppAttachPackage getByResourceGroup(String resourceGroupName, String appAttachPackageName); + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String appAttachPackageName, + Context context); + + /** + * Remove an App Attach Package. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param appAttachPackageName The name of the App Attach package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String appAttachPackageName); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List App Attach packages in resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter OData filter expression. Valid properties for filtering are package name and host pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * List App Attach packages in subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List App Attach packages in subscription. + * + * @param filter OData filter expression. Valid properties for filtering are package name, host pool, and resource + * group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return appAttachPackageList as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); + + /** + * Get an app attach package. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response}. + */ + AppAttachPackage getById(String id); + + /** + * Get an app attach package. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an app attach package along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove an App Attach Package. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Remove an App Attach Package. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AppAttachPackage resource. + * + * @param name resource name. + * @return the first stage of the new AppAttachPackage definition. + */ + AppAttachPackage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java index 56d9578bed4f..d1b8b553ffe9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Application.java @@ -9,81 +9,83 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; import java.util.Map; -/** An immutable client-side representation of Application. */ +/** + * An immutable client-side representation of Application. + */ public interface Application { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of Application. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the description property: Description of Application. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: Friendly name of Application. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the filePath property: Specifies a path for the executable file for the application. - * + * * @return the filePath value. */ String filePath(); /** * Gets the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @return the msixPackageFamilyName value. */ String msixPackageFamilyName(); /** * Gets the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @return the msixPackageApplicationId value. */ String msixPackageApplicationId(); /** * Gets the applicationType property: Resource Type of Application. - * + * * @return the applicationType value. */ RemoteApplicationType applicationType(); @@ -92,86 +94,91 @@ public interface Application { * Gets the commandLineSetting property: 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. - * + * * @return the commandLineSetting value. */ CommandLineSetting commandLineSetting(); /** * Gets the commandLineArguments property: Command Line Arguments for Application. - * + * * @return the commandLineArguments value. */ String commandLineArguments(); /** * Gets the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @return the showInPortal value. */ Boolean showInPortal(); /** * Gets the iconPath property: Path to icon. - * + * * @return the iconPath value. */ String iconPath(); /** * Gets the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ Integer iconIndex(); /** * Gets the iconHash property: Hash of the icon. - * + * * @return the iconHash value. */ String iconHash(); /** * Gets the iconContent property: the icon a 64 bit string as a byte array. - * + * * @return the iconContent value. */ byte[] iconContent(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner object. - * + * * @return the inner object. */ ApplicationInner innerModel(); - /** The entirety of the Application definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithCommandLineSetting, - DefinitionStages.WithCreate { + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithCommandLineSetting, DefinitionStages.WithCreate { } - /** The Application definition stages. */ + /** + * The Application definition stages. + */ interface DefinitionStages { - /** The first stage of the Application definition. */ + /** + * The first stage of the Application definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Application definition allowing to specify parent resource. */ + /** + * The stage of the Application definition allowing to specify parent resource. + */ interface WithParentResource { /** * 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. @@ -179,16 +186,18 @@ interface WithParentResource { WithCommandLineSetting withExistingApplicationGroup(String resourceGroupName, String applicationGroupName); } - /** The stage of the Application definition allowing to specify commandLineSetting. */ + /** + * The stage of the Application definition allowing to specify commandLineSetting. + */ interface WithCommandLineSetting { /** * Specifies the commandLineSetting property: 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.. - * + * * @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. + * arguments provided by the client, command line arguments specified at publish time, or no command line + * arguments at all. * @return the next definition stage. */ WithCreate withCommandLineSetting(CommandLineSetting commandLineSetting); @@ -199,138 +208,152 @@ interface WithCommandLineSetting { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithDescription, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithFilePath, - DefinitionStages.WithMsixPackageFamilyName, - DefinitionStages.WithMsixPackageApplicationId, - DefinitionStages.WithApplicationType, - DefinitionStages.WithCommandLineArguments, - DefinitionStages.WithShowInPortal, - DefinitionStages.WithIconPath, - DefinitionStages.WithIconIndex { + extends DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithFilePath, + DefinitionStages.WithMsixPackageFamilyName, DefinitionStages.WithMsixPackageApplicationId, + DefinitionStages.WithApplicationType, DefinitionStages.WithCommandLineArguments, + DefinitionStages.WithShowInPortal, DefinitionStages.WithIconPath, DefinitionStages.WithIconIndex { /** * Executes the create request. - * + * * @return the created resource. */ Application create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Application create(Context context); } - /** The stage of the Application definition allowing to specify description. */ + /** + * The stage of the Application definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of Application.. - * + * * @param description Description of Application. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the Application definition allowing to specify friendlyName. */ + /** + * The stage of the Application definition allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of Application.. - * + * * @param friendlyName Friendly name of Application. * @return the next definition stage. */ WithCreate withFriendlyName(String friendlyName); } - /** The stage of the Application definition allowing to specify filePath. */ + /** + * The stage of the Application definition allowing to specify filePath. + */ interface WithFilePath { /** * Specifies the filePath property: Specifies a path for the executable file for the application.. - * + * * @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 msixPackageFamilyName. */ + /** + * The stage of the Application definition allowing to specify msixPackageFamilyName. + */ interface WithMsixPackageFamilyName { /** * Specifies the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @param msixPackageFamilyName Specifies the package family name for MSIX applications. * @return the next definition stage. */ WithCreate withMsixPackageFamilyName(String msixPackageFamilyName); } - /** The stage of the Application definition allowing to specify msixPackageApplicationId. */ + /** + * The stage of the Application definition allowing to specify msixPackageApplicationId. + */ interface WithMsixPackageApplicationId { /** * Specifies the msixPackageApplicationId property: Specifies the package application Id for MSIX * applications. - * + * * @param msixPackageApplicationId Specifies the package application Id for MSIX applications. * @return the next definition stage. */ WithCreate withMsixPackageApplicationId(String msixPackageApplicationId); } - /** The stage of the Application definition allowing to specify applicationType. */ + /** + * The stage of the Application definition allowing to specify applicationType. + */ interface WithApplicationType { /** * Specifies the applicationType property: Resource Type of Application.. - * + * * @param applicationType Resource Type of Application. * @return the next definition stage. */ WithCreate withApplicationType(RemoteApplicationType applicationType); } - /** The stage of the Application definition allowing to specify commandLineArguments. */ + /** + * The stage of the Application definition allowing to specify commandLineArguments. + */ interface WithCommandLineArguments { /** * Specifies the commandLineArguments property: Command Line Arguments for Application.. - * + * * @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 showInPortal. */ + /** + * The stage of the Application definition allowing to specify showInPortal. + */ interface WithShowInPortal { /** * Specifies the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access * server.. - * + * * @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 Application definition allowing to specify iconPath. */ + /** + * The stage of the Application definition allowing to specify iconPath. + */ interface WithIconPath { /** * Specifies the iconPath property: Path to icon.. - * + * * @param iconPath Path to icon. * @return the next definition stage. */ WithCreate withIconPath(String iconPath); } - /** The stage of the Application definition allowing to specify iconIndex. */ + /** + * The stage of the Application definition allowing to specify iconIndex. + */ interface WithIconIndex { /** * Specifies the iconIndex property: Index of the icon.. - * + * * @param iconIndex Index of the icon. * @return the next definition stage. */ @@ -340,175 +363,195 @@ interface WithIconIndex { /** * Begins update for the Application resource. - * + * * @return the stage of resource update. */ Application.Update update(); - /** The template for Application update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithDescription, - UpdateStages.WithFriendlyName, - UpdateStages.WithFilePath, - UpdateStages.WithCommandLineSetting, - UpdateStages.WithCommandLineArguments, - UpdateStages.WithShowInPortal, - UpdateStages.WithIconPath, - UpdateStages.WithIconIndex, - UpdateStages.WithMsixPackageFamilyName, - UpdateStages.WithMsixPackageApplicationId, - UpdateStages.WithApplicationType { + /** + * The template for Application update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, + UpdateStages.WithFilePath, UpdateStages.WithCommandLineSetting, UpdateStages.WithCommandLineArguments, + UpdateStages.WithShowInPortal, UpdateStages.WithIconPath, UpdateStages.WithIconIndex, + UpdateStages.WithMsixPackageFamilyName, UpdateStages.WithMsixPackageApplicationId, + UpdateStages.WithApplicationType { /** * Executes the update request. - * + * * @return the updated resource. */ Application apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Application apply(Context context); } - /** The Application update stages. */ + /** + * The Application update stages. + */ interface UpdateStages { - /** The stage of the Application update allowing to specify tags. */ + /** + * The stage of the Application update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: tags to be updated. - * + * * @param tags tags to be updated. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Application update allowing to specify description. */ + /** + * The stage of the Application update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of Application.. - * + * * @param description Description of Application. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the Application update allowing to specify friendlyName. */ + /** + * The stage of the Application update allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of Application.. - * + * * @param friendlyName Friendly name of Application. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } - /** The stage of the Application update allowing to specify filePath. */ + /** + * The stage of the Application update allowing to specify filePath. + */ interface WithFilePath { /** * Specifies the filePath property: Specifies a path for the executable file for the application.. - * + * * @param filePath Specifies a path for the executable file for the application. * @return the next definition stage. */ Update withFilePath(String filePath); } - /** The stage of the Application update allowing to specify commandLineSetting. */ + /** + * The stage of the Application update allowing to specify commandLineSetting. + */ interface WithCommandLineSetting { /** * Specifies the commandLineSetting property: 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.. - * + * * @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. + * arguments provided by the client, command line arguments specified at publish time, or no command line + * arguments at all. * @return the next definition stage. */ Update withCommandLineSetting(CommandLineSetting commandLineSetting); } - /** The stage of the Application update allowing to specify commandLineArguments. */ + /** + * The stage of the Application update allowing to specify commandLineArguments. + */ interface WithCommandLineArguments { /** * Specifies the commandLineArguments property: Command Line Arguments for Application.. - * + * * @param commandLineArguments Command Line Arguments for Application. * @return the next definition stage. */ Update withCommandLineArguments(String commandLineArguments); } - /** The stage of the Application update allowing to specify showInPortal. */ + /** + * The stage of the Application update allowing to specify showInPortal. + */ interface WithShowInPortal { /** * Specifies the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access * server.. - * + * * @param showInPortal Specifies whether to show the RemoteApp program in the RD Web Access server. * @return the next definition stage. */ Update withShowInPortal(Boolean showInPortal); } - /** The stage of the Application update allowing to specify iconPath. */ + /** + * The stage of the Application update allowing to specify iconPath. + */ interface WithIconPath { /** * Specifies the iconPath property: Path to icon.. - * + * * @param iconPath Path to icon. * @return the next definition stage. */ Update withIconPath(String iconPath); } - /** The stage of the Application update allowing to specify iconIndex. */ + /** + * The stage of the Application update allowing to specify iconIndex. + */ interface WithIconIndex { /** * Specifies the iconIndex property: Index of the icon.. - * + * * @param iconIndex Index of the icon. * @return the next definition stage. */ Update withIconIndex(Integer iconIndex); } - /** The stage of the Application update allowing to specify msixPackageFamilyName. */ + /** + * The stage of the Application update allowing to specify msixPackageFamilyName. + */ interface WithMsixPackageFamilyName { /** * Specifies the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @param msixPackageFamilyName Specifies the package family name for MSIX applications. * @return the next definition stage. */ Update withMsixPackageFamilyName(String msixPackageFamilyName); } - /** The stage of the Application update allowing to specify msixPackageApplicationId. */ + /** + * The stage of the Application update allowing to specify msixPackageApplicationId. + */ interface WithMsixPackageApplicationId { /** * Specifies the msixPackageApplicationId property: Specifies the package application Id for MSIX * applications. - * + * * @param msixPackageApplicationId Specifies the package application Id for MSIX applications. * @return the next definition stage. */ Update withMsixPackageApplicationId(String msixPackageApplicationId); } - /** The stage of the Application update allowing to specify applicationType. */ + /** + * The stage of the Application update allowing to specify applicationType. + */ interface WithApplicationType { /** * Specifies the applicationType property: Resource Type of Application.. - * + * * @param applicationType Resource Type of Application. * @return the next definition stage. */ @@ -518,14 +561,14 @@ interface WithApplicationType { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Application refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java index 5c8769c4ada6..b065e3f9f667 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroup.java @@ -10,39 +10,41 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupInner; import java.util.Map; -/** An immutable client-side representation of ApplicationGroup. */ +/** + * An immutable client-side representation of ApplicationGroup. + */ public interface ApplicationGroup { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -51,16 +53,16 @@ public interface ApplicationGroup { * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment * will not delete the resource if it is removed from the template since it is managed by another resource. - * + * * @return the managedBy value. */ String managedBy(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ String kind(); @@ -70,144 +72,148 @@ public interface ApplicationGroup { * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * + * * @return the etag value. */ String etag(); /** * Gets the identity property: The identity property. - * + * * @return the identity value. */ ResourceModelWithAllowedPropertySetIdentity identity(); /** * Gets the sku property: The sku property. - * + * * @return the sku value. */ ResourceModelWithAllowedPropertySetSku sku(); /** * Gets the plan property: The plan property. - * + * * @return the plan value. */ ResourceModelWithAllowedPropertySetPlan plan(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of ApplicationGroup. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the description property: Description of ApplicationGroup. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: Friendly name of ApplicationGroup. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the hostPoolArmPath property: HostPool arm path of ApplicationGroup. - * + * * @return the hostPoolArmPath value. */ String hostPoolArmPath(); /** * Gets the workspaceArmPath property: Workspace arm path of ApplicationGroup. - * + * * @return the workspaceArmPath value. */ String workspaceArmPath(); /** * Gets the applicationGroupType property: Resource Type of ApplicationGroup. - * + * * @return the applicationGroupType value. */ ApplicationGroupType applicationGroupType(); /** * Gets the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ Boolean cloudPcResource(); /** * Gets the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @return the showInFeed value. */ Boolean showInFeed(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupInner object. - * + * * @return the inner object. */ ApplicationGroupInner innerModel(); - /** The entirety of the ApplicationGroup definition. */ + /** + * The entirety of the ApplicationGroup definition. + */ interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithHostPoolArmPath, - DefinitionStages.WithApplicationGroupType, - DefinitionStages.WithCreate { + extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, + DefinitionStages.WithHostPoolArmPath, DefinitionStages.WithApplicationGroupType, DefinitionStages.WithCreate { } - /** The ApplicationGroup definition stages. */ + /** + * The ApplicationGroup definition stages. + */ interface DefinitionStages { - /** The first stage of the ApplicationGroup definition. */ + /** + * The first stage of the ApplicationGroup definition. + */ interface Blank extends WithLocation { } - /** The stage of the ApplicationGroup definition allowing to specify location. */ + /** + * The stage of the ApplicationGroup definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -215,40 +221,46 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the ApplicationGroup definition allowing to specify parent resource. */ + /** + * The stage of the ApplicationGroup definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithHostPoolArmPath withExistingResourceGroup(String resourceGroupName); } - /** The stage of the ApplicationGroup definition allowing to specify hostPoolArmPath. */ + /** + * The stage of the ApplicationGroup definition allowing to specify hostPoolArmPath. + */ interface WithHostPoolArmPath { /** * Specifies the hostPoolArmPath property: HostPool arm path of ApplicationGroup.. - * + * * @param hostPoolArmPath HostPool arm path of ApplicationGroup. * @return the next definition stage. */ WithApplicationGroupType withHostPoolArmPath(String hostPoolArmPath); } - /** The stage of the ApplicationGroup definition allowing to specify applicationGroupType. */ + /** + * The stage of the ApplicationGroup definition allowing to specify applicationGroupType. + */ interface WithApplicationGroupType { /** * Specifies the applicationGroupType property: Resource Type of ApplicationGroup.. - * + * * @param applicationGroupType Resource Type of ApplicationGroup. * @return the next definition stage. */ @@ -260,134 +272,146 @@ interface WithApplicationGroupType { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithManagedBy, - DefinitionStages.WithKind, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithPlan, - DefinitionStages.WithDescription, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithShowInFeed { + extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, + DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithPlan, + DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithShowInFeed { /** * Executes the create request. - * + * * @return the created resource. */ ApplicationGroup create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ApplicationGroup create(Context context); } - /** The stage of the ApplicationGroup definition allowing to specify tags. */ + /** + * The stage of the ApplicationGroup definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ApplicationGroup definition allowing to specify managedBy. */ + /** + * The stage of the ApplicationGroup definition allowing to specify managedBy. + */ interface WithManagedBy { /** * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete * mode deployment will not delete the resource if it is removed from the template since it is managed by * another resource.. - * + * * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will - * not delete the resource if it is removed from the template since it is managed by another resource. + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ WithCreate withManagedBy(String managedBy); } - /** The stage of the ApplicationGroup definition allowing to specify kind. */ + /** + * The stage of the ApplicationGroup definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider - * must validate and persist this value. + * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the ApplicationGroup definition allowing to specify identity. */ + /** + * The stage of the ApplicationGroup definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity property.. - * + * * @param identity The identity property. * @return the next definition stage. */ WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); } - /** The stage of the ApplicationGroup definition allowing to specify sku. */ + /** + * The stage of the ApplicationGroup definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku property.. - * + * * @param sku The sku property. * @return the next definition stage. */ WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); } - /** The stage of the ApplicationGroup definition allowing to specify plan. */ + /** + * The stage of the ApplicationGroup definition allowing to specify plan. + */ interface WithPlan { /** * Specifies the plan property: The plan property.. - * + * * @param plan The plan property. * @return the next definition stage. */ WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); } - /** The stage of the ApplicationGroup definition allowing to specify description. */ + /** + * The stage of the ApplicationGroup definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of ApplicationGroup.. - * + * * @param description Description of ApplicationGroup. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the ApplicationGroup definition allowing to specify friendlyName. */ + /** + * The stage of the ApplicationGroup definition allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of ApplicationGroup.. - * + * * @param friendlyName Friendly name of ApplicationGroup. * @return the next definition stage. */ WithCreate withFriendlyName(String friendlyName); } - /** The stage of the ApplicationGroup definition allowing to specify showInFeed. */ + /** + * The stage of the ApplicationGroup definition allowing to specify showInFeed. + */ interface WithShowInFeed { /** * Specifies the showInFeed property: Boolean representing whether the applicationGroup is show in the * feed.. - * + * * @param showInFeed Boolean representing whether the applicationGroup is show in the feed. * @return the next definition stage. */ @@ -397,74 +421,83 @@ interface WithShowInFeed { /** * Begins update for the ApplicationGroup resource. - * + * * @return the stage of resource update. */ ApplicationGroup.Update update(); - /** The template for ApplicationGroup update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithDescription, - UpdateStages.WithFriendlyName, - UpdateStages.WithShowInFeed { + /** + * The template for ApplicationGroup update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, + UpdateStages.WithShowInFeed { /** * Executes the update request. - * + * * @return the updated resource. */ ApplicationGroup apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ApplicationGroup apply(Context context); } - /** The ApplicationGroup update stages. */ + /** + * The ApplicationGroup update stages. + */ interface UpdateStages { - /** The stage of the ApplicationGroup update allowing to specify tags. */ + /** + * The stage of the ApplicationGroup update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: tags to be updated. - * + * * @param tags tags to be updated. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the ApplicationGroup update allowing to specify description. */ + /** + * The stage of the ApplicationGroup update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of ApplicationGroup.. - * + * * @param description Description of ApplicationGroup. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the ApplicationGroup update allowing to specify friendlyName. */ + /** + * The stage of the ApplicationGroup update allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of ApplicationGroup.. - * + * * @param friendlyName Friendly name of ApplicationGroup. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } - /** The stage of the ApplicationGroup update allowing to specify showInFeed. */ + /** + * The stage of the ApplicationGroup update allowing to specify showInFeed. + */ interface WithShowInFeed { /** * Specifies the showInFeed property: Boolean representing whether the applicationGroup is show in the * feed.. - * + * * @param showInFeed Boolean representing whether the applicationGroup is show in the feed. * @return the next definition stage. */ @@ -474,14 +507,14 @@ interface WithShowInFeed { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ApplicationGroup refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java index 6c2e29d502aa..d4b7297c2a71 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ApplicationGroupList - * - *

List of ApplicationGroup definitions. + * + * List of ApplicationGroup definitions. */ @Fluent -public final class ApplicationGroupList { +public final class ApplicationGroupList implements JsonSerializable { /* * List of ApplicationGroup 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; - /** Creates an instance of ApplicationGroupList class. */ + /** + * Creates an instance of ApplicationGroupList class. + */ public ApplicationGroupList() { } /** * Get the value property: List of ApplicationGroup definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of ApplicationGroup definitions. - * + * * @param value the value value to set. * @return the ApplicationGroupList object itself. */ @@ -54,7 +58,7 @@ public ApplicationGroupList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGroupList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGroupList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGroupList. + */ + public static ApplicationGroupList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGroupList deserializedApplicationGroupList = new ApplicationGroupList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApplicationGroupInner.fromJson(reader1)); + deserializedApplicationGroupList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationGroupList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGroupList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java index 015db48e8ec1..77ebddb82534 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupPatch.java @@ -6,34 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationGroupPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** ApplicationGroup properties that can be patched. */ +/** + * ApplicationGroup properties that can be patched. + */ @Fluent public final class ApplicationGroupPatch extends ProxyResource { /* * tags to be updated */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * ApplicationGroup properties that can be patched. */ - @JsonProperty(value = "properties") private ApplicationGroupPatchProperties innerProperties; - /** Creates an instance of ApplicationGroupPatch class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ApplicationGroupPatch class. + */ public ApplicationGroupPatch() { } /** * Get the tags property: tags to be updated. - * + * * @return the tags value. */ public Map tags() { @@ -42,7 +66,7 @@ public Map tags() { /** * Set the tags property: tags to be updated. - * + * * @param tags the tags value to set. * @return the ApplicationGroupPatch object itself. */ @@ -53,16 +77,55 @@ public ApplicationGroupPatch withTags(Map tags) { /** * Get the innerProperties property: ApplicationGroup properties that can be patched. - * + * * @return the innerProperties value. */ private ApplicationGroupPatchProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the description property: Description of ApplicationGroup. - * + * * @return the description value. */ public String description() { @@ -71,7 +134,7 @@ public String description() { /** * Set the description property: Description of ApplicationGroup. - * + * * @param description the description value to set. * @return the ApplicationGroupPatch object itself. */ @@ -85,7 +148,7 @@ public ApplicationGroupPatch withDescription(String description) { /** * Get the friendlyName property: Friendly name of ApplicationGroup. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -94,7 +157,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of ApplicationGroup. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationGroupPatch object itself. */ @@ -108,7 +171,7 @@ public ApplicationGroupPatch withFriendlyName(String friendlyName) { /** * Get the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @return the showInFeed value. */ public Boolean showInFeed() { @@ -117,7 +180,7 @@ public Boolean showInFeed() { /** * Set the showInFeed property: Boolean representing whether the applicationGroup is show in the feed. - * + * * @param showInFeed the showInFeed value to set. * @return the ApplicationGroupPatch object itself. */ @@ -131,7 +194,7 @@ public ApplicationGroupPatch withShowInFeed(Boolean showInFeed) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -139,4 +202,54 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGroupPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGroupPatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGroupPatch. + */ + public static ApplicationGroupPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGroupPatch deserializedApplicationGroupPatch = new ApplicationGroupPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGroupPatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApplicationGroupPatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGroupPatch.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationGroupPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedApplicationGroupPatch.innerProperties + = ApplicationGroupPatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedApplicationGroupPatch.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGroupPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupType.java index e618394a9c5e..14a35f64b21f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroupType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Resource Type of ApplicationGroup. */ +/** + * Resource Type of ApplicationGroup. + */ public final class ApplicationGroupType extends ExpandableStringEnum { - /** Static value RemoteApp for ApplicationGroupType. */ + /** + * Static value RemoteApp for ApplicationGroupType. + */ public static final ApplicationGroupType REMOTE_APP = fromString("RemoteApp"); - /** Static value Desktop for ApplicationGroupType. */ + /** + * Static value Desktop for ApplicationGroupType. + */ public static final ApplicationGroupType DESKTOP = fromString("Desktop"); /** * Creates a new instance of ApplicationGroupType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ApplicationGroupType() { /** * 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); } /** * Gets known ApplicationGroupType values. - * + * * @return known ApplicationGroupType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java index d4b001edc24d..60a00401b56e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationGroups.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ApplicationGroups. */ +/** + * Resource collection API of ApplicationGroups. + */ public interface ApplicationGroups { /** * 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 context The context to associate with this operation. @@ -21,12 +23,12 @@ public interface ApplicationGroups { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an application group along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String applicationGroupName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, + Context context); /** * 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. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * 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 context The context to associate with this operation. @@ -47,12 +49,12 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByResourceGroupWithResponse( - String resourceGroupName, String applicationGroupName, Context context); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String applicationGroupName, + Context context); /** * 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. @@ -63,7 +65,7 @@ Response deleteByResourceGroupWithResponse( /** * List applicationGroups. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -74,7 +76,7 @@ Response deleteByResourceGroupWithResponse( /** * 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 pageSize Number of items per page. @@ -86,17 +88,12 @@ Response deleteByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationGroupList as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup( - String resourceGroupName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * List applicationGroups in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationGroupList as paginated response with {@link PagedIterable}. @@ -105,7 +102,7 @@ PagedIterable listByResourceGroup( /** * List applicationGroups in subscription. - * + * * @param filter OData filter expression. Valid properties for filtering are applicationGroupType. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,7 +114,7 @@ PagedIterable listByResourceGroup( /** * Get an application group. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -128,7 +125,7 @@ PagedIterable listByResourceGroup( /** * Get an application group. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,7 +137,7 @@ PagedIterable listByResourceGroup( /** * Remove an applicationGroup. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -150,7 +147,7 @@ PagedIterable listByResourceGroup( /** * Remove an applicationGroup. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -162,7 +159,7 @@ PagedIterable listByResourceGroup( /** * Begins definition for a new ApplicationGroup resource. - * + * * @param name resource name. * @return the first stage of the new ApplicationGroup definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java index 8b1f4ababfb2..92ec800a9eae 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ApplicationList - * - *

List of Application definitions. + * + * List of Application definitions. */ @Fluent -public final class ApplicationList { +public final class ApplicationList implements JsonSerializable { /* * List of Application 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; - /** Creates an instance of ApplicationList class. */ + /** + * Creates an instance of ApplicationList class. + */ public ApplicationList() { } /** * Get the value property: List of Application definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of Application definitions. - * + * * @param value the value value to set. * @return the ApplicationList object itself. */ @@ -54,7 +58,7 @@ public ApplicationList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationList. + */ + public static ApplicationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationList deserializedApplicationList = new ApplicationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ApplicationInner.fromJson(reader1)); + deserializedApplicationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java index ffb452e260b5..b92fc5eee5af 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationPatch.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Application properties that can be patched. */ +/** + * Application properties that can be patched. + */ @Fluent -public final class ApplicationPatch { +public final class ApplicationPatch implements JsonSerializable { /* * tags to be updated */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Detailed properties for Application */ - @JsonProperty(value = "properties") private ApplicationPatchProperties innerProperties; - /** Creates an instance of ApplicationPatch class. */ + /** + * Creates an instance of ApplicationPatch class. + */ public ApplicationPatch() { } /** * Get the tags property: tags to be updated. - * + * * @return the tags value. */ public Map tags() { @@ -41,7 +45,7 @@ public Map tags() { /** * Set the tags property: tags to be updated. - * + * * @param tags the tags value to set. * @return the ApplicationPatch object itself. */ @@ -52,7 +56,7 @@ public ApplicationPatch withTags(Map tags) { /** * Get the innerProperties property: Detailed properties for Application. - * + * * @return the innerProperties value. */ private ApplicationPatchProperties innerProperties() { @@ -61,7 +65,7 @@ private ApplicationPatchProperties innerProperties() { /** * Get the description property: Description of Application. - * + * * @return the description value. */ public String description() { @@ -70,7 +74,7 @@ public String description() { /** * Set the description property: Description of Application. - * + * * @param description the description value to set. * @return the ApplicationPatch object itself. */ @@ -84,7 +88,7 @@ public ApplicationPatch withDescription(String description) { /** * Get the friendlyName property: Friendly name of Application. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -93,7 +97,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Application. - * + * * @param friendlyName the friendlyName value to set. * @return the ApplicationPatch object itself. */ @@ -107,7 +111,7 @@ public ApplicationPatch withFriendlyName(String friendlyName) { /** * Get the filePath property: Specifies a path for the executable file for the application. - * + * * @return the filePath value. */ public String filePath() { @@ -116,7 +120,7 @@ public String filePath() { /** * Set the filePath property: Specifies a path for the executable file for the application. - * + * * @param filePath the filePath value to set. * @return the ApplicationPatch object itself. */ @@ -132,7 +136,7 @@ public ApplicationPatch withFilePath(String filePath) { * Get the commandLineSetting property: 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. - * + * * @return the commandLineSetting value. */ public CommandLineSetting commandLineSetting() { @@ -143,7 +147,7 @@ public CommandLineSetting commandLineSetting() { * Set the commandLineSetting property: 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. - * + * * @param commandLineSetting the commandLineSetting value to set. * @return the ApplicationPatch object itself. */ @@ -157,7 +161,7 @@ public ApplicationPatch withCommandLineSetting(CommandLineSetting commandLineSet /** * Get the commandLineArguments property: Command Line Arguments for Application. - * + * * @return the commandLineArguments value. */ public String commandLineArguments() { @@ -166,7 +170,7 @@ public String commandLineArguments() { /** * Set the commandLineArguments property: Command Line Arguments for Application. - * + * * @param commandLineArguments the commandLineArguments value to set. * @return the ApplicationPatch object itself. */ @@ -180,7 +184,7 @@ public ApplicationPatch withCommandLineArguments(String commandLineArguments) { /** * Get the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server. - * + * * @return the showInPortal value. */ public Boolean showInPortal() { @@ -189,7 +193,7 @@ public Boolean showInPortal() { /** * Set the showInPortal property: 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. */ @@ -203,7 +207,7 @@ public ApplicationPatch withShowInPortal(Boolean showInPortal) { /** * Get the iconPath property: Path to icon. - * + * * @return the iconPath value. */ public String iconPath() { @@ -212,7 +216,7 @@ public String iconPath() { /** * Set the iconPath property: Path to icon. - * + * * @param iconPath the iconPath value to set. * @return the ApplicationPatch object itself. */ @@ -226,7 +230,7 @@ public ApplicationPatch withIconPath(String iconPath) { /** * Get the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ public Integer iconIndex() { @@ -235,7 +239,7 @@ public Integer iconIndex() { /** * Set the iconIndex property: Index of the icon. - * + * * @param iconIndex the iconIndex value to set. * @return the ApplicationPatch object itself. */ @@ -249,7 +253,7 @@ public ApplicationPatch withIconIndex(Integer iconIndex) { /** * Get the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @return the msixPackageFamilyName value. */ public String msixPackageFamilyName() { @@ -258,7 +262,7 @@ public String msixPackageFamilyName() { /** * Set the msixPackageFamilyName property: Specifies the package family name for MSIX applications. - * + * * @param msixPackageFamilyName the msixPackageFamilyName value to set. * @return the ApplicationPatch object itself. */ @@ -272,7 +276,7 @@ public ApplicationPatch withMsixPackageFamilyName(String msixPackageFamilyName) /** * Get the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @return the msixPackageApplicationId value. */ public String msixPackageApplicationId() { @@ -281,7 +285,7 @@ public String msixPackageApplicationId() { /** * Set the msixPackageApplicationId property: Specifies the package application Id for MSIX applications. - * + * * @param msixPackageApplicationId the msixPackageApplicationId value to set. * @return the ApplicationPatch object itself. */ @@ -295,7 +299,7 @@ public ApplicationPatch withMsixPackageApplicationId(String msixPackageApplicati /** * Get the applicationType property: Resource Type of Application. - * + * * @return the applicationType value. */ public RemoteApplicationType applicationType() { @@ -304,7 +308,7 @@ public RemoteApplicationType applicationType() { /** * Set the applicationType property: Resource Type of Application. - * + * * @param applicationType the applicationType value to set. * @return the ApplicationPatch object itself. */ @@ -318,7 +322,7 @@ public ApplicationPatch withApplicationType(RemoteApplicationType applicationTyp /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -326,4 +330,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationPatch. + */ + public static ApplicationPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationPatch deserializedApplicationPatch = new ApplicationPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedApplicationPatch.innerProperties = ApplicationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java index 342b886848b4..58a661bac723 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ApplicationType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Application type of application. */ +/** + * Application type of application. + */ public final class ApplicationType extends ExpandableStringEnum { - /** Static value RemoteApp for ApplicationType. */ + /** + * Static value RemoteApp for ApplicationType. + */ public static final ApplicationType REMOTE_APP = fromString("RemoteApp"); - /** Static value Desktop for ApplicationType. */ + /** + * Static value Desktop for ApplicationType. + */ public static final ApplicationType DESKTOP = fromString("Desktop"); /** * Creates a new instance of ApplicationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ApplicationType() { /** * 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); } /** * Gets known ApplicationType values. - * + * * @return known ApplicationType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java index e8576ae8e0e9..4806df3eaea6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Applications.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Applications. */ +/** + * Resource collection API of Applications. + */ public interface Applications { /** * 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. @@ -22,12 +24,12 @@ public interface Applications { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an application along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context); + Response getWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Context context); /** * 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. @@ -40,7 +42,7 @@ Response getWithResponse( /** * 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. @@ -50,12 +52,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String applicationGroupName, String applicationName, Context context); + Response deleteWithResponse(String resourceGroupName, String applicationGroupName, String applicationName, + Context context); /** * 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. @@ -67,7 +69,7 @@ Response deleteWithResponse( /** * 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. @@ -79,7 +81,7 @@ Response deleteWithResponse( /** * List applications. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -91,17 +93,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return applicationList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * Get an application. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,7 +109,7 @@ PagedIterable list( /** * Get an application. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +121,7 @@ PagedIterable list( /** * Remove an application. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,7 +131,7 @@ PagedIterable list( /** * Remove an application. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,7 +143,7 @@ PagedIterable list( /** * Begins definition for a new Application resource. - * + * * @param name resource name. * @return the first stage of the new Application definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java index 17fad5d97d9a..19fdf2db5b71 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/CommandLineSetting.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,18 +12,24 @@ * command line arguments specified at publish time, or no command line arguments at all. */ public final class CommandLineSetting extends ExpandableStringEnum { - /** Static value DoNotAllow for CommandLineSetting. */ + /** + * Static value DoNotAllow for CommandLineSetting. + */ public static final CommandLineSetting DO_NOT_ALLOW = fromString("DoNotAllow"); - /** Static value Allow for CommandLineSetting. */ + /** + * Static value Allow for CommandLineSetting. + */ public static final CommandLineSetting ALLOW = fromString("Allow"); - /** Static value Require for CommandLineSetting. */ + /** + * Static value Require for CommandLineSetting. + */ public static final CommandLineSetting REQUIRE = fromString("Require"); /** * Creates a new instance of CommandLineSetting value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +38,17 @@ public CommandLineSetting() { /** * 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); } /** * Gets known CommandLineSetting values. - * + * * @return known CommandLineSetting values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java index e7a4324672a1..afd20bacaede 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DayOfWeek.java @@ -4,33 +4,48 @@ package com.azure.resourcemanager.desktopvirtualization.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Day of the week. */ +/** + * Day of the week. + */ public enum DayOfWeek { - /** Enum value Monday. */ + /** + * Enum value Monday. + */ MONDAY("Monday"), - /** Enum value Tuesday. */ + /** + * Enum value Tuesday. + */ TUESDAY("Tuesday"), - /** Enum value Wednesday. */ + /** + * Enum value Wednesday. + */ WEDNESDAY("Wednesday"), - /** Enum value Thursday. */ + /** + * Enum value Thursday. + */ THURSDAY("Thursday"), - /** Enum value Friday. */ + /** + * Enum value Friday. + */ FRIDAY("Friday"), - /** Enum value Saturday. */ + /** + * Enum value Saturday. + */ SATURDAY("Saturday"), - /** Enum value Sunday. */ + /** + * Enum value Sunday. + */ SUNDAY("Sunday"); - /** The actual serialized value for a DayOfWeek instance. */ + /** + * The actual serialized value for a DayOfWeek instance. + */ private final String value; DayOfWeek(String value) { @@ -39,11 +54,10 @@ public enum DayOfWeek { /** * Parses a serialized value to a DayOfWeek instance. - * + * * @param value the serialized value to parse. * @return the parsed DayOfWeek object, or null if unable to parse. */ - @JsonCreator public static DayOfWeek fromString(String value) { if (value == null) { return null; @@ -57,8 +71,9 @@ public static DayOfWeek fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java index 78aa4afce1d2..ed363a804c89 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktop.java @@ -7,74 +7,76 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner; -/** An immutable client-side representation of Desktop. */ +/** + * An immutable client-side representation of Desktop. + */ public interface Desktop { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of Desktop. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the description property: Description of Desktop. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: Friendly name of Desktop. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the iconHash property: Hash of the icon. - * + * * @return the iconHash value. */ String iconHash(); /** * Gets the iconContent property: The icon a 64 bit string as a byte array. - * + * * @return the iconContent value. */ byte[] iconContent(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner object. - * + * * @return the inner object. */ DesktopInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java index ba3adad3bccd..80eb5ddd846a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * DesktopList - * - *

List of Desktop definitions. + * + * List of Desktop definitions. */ @Fluent -public final class DesktopList { +public final class DesktopList implements JsonSerializable { /* * 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; - /** Creates an instance of DesktopList class. */ + /** + * Creates an instance of DesktopList class. + */ public DesktopList() { } /** * Get the value property: List of Desktop definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of Desktop definitions. - * + * * @param value the value value to set. * @return the DesktopList object itself. */ @@ -54,7 +58,7 @@ public DesktopList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DesktopList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DesktopList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DesktopList. + */ + public static DesktopList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DesktopList deserializedDesktopList = new DesktopList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DesktopInner.fromJson(reader1)); + deserializedDesktopList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDesktopList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDesktopList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java index 6ff80cdfed02..14b44f746a26 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/DesktopPatch.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Desktop properties that can be patched. */ +/** + * Desktop properties that can be patched. + */ @Fluent -public final class DesktopPatch { +public final class DesktopPatch implements JsonSerializable { /* * tags to be updated */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Detailed properties for Desktop */ - @JsonProperty(value = "properties") private DesktopPatchProperties innerProperties; - /** Creates an instance of DesktopPatch class. */ + /** + * Creates an instance of DesktopPatch class. + */ public DesktopPatch() { } /** * Get the tags property: tags to be updated. - * + * * @return the tags value. */ public Map tags() { @@ -41,7 +45,7 @@ public Map tags() { /** * Set the tags property: tags to be updated. - * + * * @param tags the tags value to set. * @return the DesktopPatch object itself. */ @@ -52,7 +56,7 @@ public DesktopPatch withTags(Map tags) { /** * Get the innerProperties property: Detailed properties for Desktop. - * + * * @return the innerProperties value. */ private DesktopPatchProperties innerProperties() { @@ -61,7 +65,7 @@ private DesktopPatchProperties innerProperties() { /** * Get the description property: Description of Desktop. - * + * * @return the description value. */ public String description() { @@ -70,7 +74,7 @@ public String description() { /** * Set the description property: Description of Desktop. - * + * * @param description the description value to set. * @return the DesktopPatch object itself. */ @@ -84,7 +88,7 @@ public DesktopPatch withDescription(String description) { /** * Get the friendlyName property: Friendly name of Desktop. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -93,7 +97,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Desktop. - * + * * @param friendlyName the friendlyName value to set. * @return the DesktopPatch object itself. */ @@ -107,7 +111,7 @@ public DesktopPatch withFriendlyName(String friendlyName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -115,4 +119,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DesktopPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DesktopPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DesktopPatch. + */ + public static DesktopPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DesktopPatch deserializedDesktopPatch = new DesktopPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDesktopPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedDesktopPatch.innerProperties = DesktopPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDesktopPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java index 80e3c1c177a4..7392e7f52f5f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Desktops.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Desktops. */ +/** + * Resource collection API of Desktops. + */ public interface Desktops { /** * 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. @@ -22,12 +24,12 @@ public interface Desktops { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a desktop along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String applicationGroupName, String desktopName, Context context); + Response getWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + Context context); /** * 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. @@ -40,7 +42,7 @@ Response getWithResponse( /** * 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. @@ -51,16 +53,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return schema for Desktop properties along with {@link Response}. */ - Response updateWithResponse( - String resourceGroupName, - String applicationGroupName, - String desktopName, - DesktopPatch desktop, - Context context); + Response updateWithResponse(String resourceGroupName, String applicationGroupName, String desktopName, + DesktopPatch desktop, Context context); /** * 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. @@ -73,7 +71,7 @@ Response updateWithResponse( /** * 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. @@ -85,7 +83,7 @@ Response updateWithResponse( /** * List desktops. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param applicationGroupName The name of the application group. * @param pageSize Number of items per page. @@ -97,11 +95,6 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return desktopList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java index a70dcd0f08cd..cafd12037999 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImage.java @@ -4,50 +4,60 @@ package com.azure.resourcemanager.desktopvirtualization.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of ExpandMsixImage. */ +/** + * An immutable client-side representation of ExpandMsixImage. + */ public interface ExpandMsixImage { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the packageAlias property: Alias of MSIX Package. - * + * * @return the packageAlias value. */ String packageAlias(); /** * Gets the imagePath property: VHD/CIM image path on Network Share. - * + * * @return the imagePath value. */ String imagePath(); /** * Gets the packageName property: Package Name from appxmanifest.xml. - * + * * @return the packageName value. */ String packageName(); @@ -55,77 +65,91 @@ public interface ExpandMsixImage { /** * Gets the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @return the packageFamilyName value. */ String packageFamilyName(); /** * Gets the packageFullName property: Package Full Name from appxmanifest.xml. - * + * * @return the packageFullName value. */ String packageFullName(); /** * Gets the displayName property: User friendly Name to be displayed in the portal. - * + * * @return the displayName value. */ String displayName(); /** * Gets the packageRelativePath property: Relative Path to the package inside the image. - * + * * @return the packageRelativePath value. */ String packageRelativePath(); /** * Gets the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @return the isRegularRegistration value. */ Boolean isRegularRegistration(); /** * Gets the isActive property: Make this version of the package the active one across the hostpool. - * + * * @return the isActive value. */ Boolean isActive(); /** * Gets the packageDependencies property: List of package dependencies. - * + * * @return the packageDependencies value. */ List packageDependencies(); /** - * Gets the version property: Package Version found in the appxmanifest.xml. - * + * Gets the version property: Package version found in the appxmanifest.xml. + * * @return the version value. */ String version(); /** * Gets the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * + * * @return the lastUpdated value. */ OffsetDateTime lastUpdated(); /** * Gets the packageApplications property: List of package applications. - * + * * @return the packageApplications value. */ List packageApplications(); + /** + * Gets the certificateName property: Certificate name found in the appxmanifest.xml. + * + * @return the certificateName value. + */ + String certificateName(); + + /** + * Gets the certificateExpiry property: Date certificate expires, found in the appxmanifest.xml. + * + * @return the certificateExpiry value. + */ + OffsetDateTime certificateExpiry(); + /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner object. - * + * * @return the inner object. */ ExpandMsixImageInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java index 178c8b8ad58a..a6cfdf37f5f9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ExpandMsixImageList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ExpandMsixImageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ExpandMsixImageList - * - *

List of MSIX package properties retrieved from MSIX Image expansion. + * + * List of MSIX package properties retrieved from MSIX Image expansion. */ @Fluent -public final class ExpandMsixImageList { +public final class ExpandMsixImageList implements JsonSerializable { /* * List of MSIX package properties from give MSIX Image. */ - @JsonProperty(value = "value") private List value; /* * Link to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ExpandMsixImageList class. */ + /** + * Creates an instance of ExpandMsixImageList class. + */ public ExpandMsixImageList() { } /** * Get the value property: List of MSIX package properties from give MSIX Image. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of MSIX package properties from give MSIX Image. - * + * * @param value the value value to set. * @return the ExpandMsixImageList object itself. */ @@ -54,7 +58,7 @@ public ExpandMsixImageList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpandMsixImageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpandMsixImageList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpandMsixImageList. + */ + public static ExpandMsixImageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpandMsixImageList deserializedExpandMsixImageList = new ExpandMsixImageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpandMsixImageInner.fromJson(reader1)); + deserializedExpandMsixImageList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpandMsixImageList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpandMsixImageList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java new file mode 100644 index 000000000000..1190796b54df --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/FailHealthCheckOnStagingFailure.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Parameter indicating how the health check should behave if this package fails staging. + */ +public final class FailHealthCheckOnStagingFailure extends ExpandableStringEnum { + /** + * Static value Unhealthy for FailHealthCheckOnStagingFailure. + */ + public static final FailHealthCheckOnStagingFailure UNHEALTHY = fromString("Unhealthy"); + + /** + * Static value NeedsAssistance for FailHealthCheckOnStagingFailure. + */ + public static final FailHealthCheckOnStagingFailure NEEDS_ASSISTANCE = fromString("NeedsAssistance"); + + /** + * Static value DoNotFail for FailHealthCheckOnStagingFailure. + */ + public static final FailHealthCheckOnStagingFailure DO_NOT_FAIL = fromString("DoNotFail"); + + /** + * Creates a new instance of FailHealthCheckOnStagingFailure value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FailHealthCheckOnStagingFailure() { + } + + /** + * Creates or finds a FailHealthCheckOnStagingFailure from its string representation. + * + * @param name a name to look for. + * @return the corresponding FailHealthCheckOnStagingFailure. + */ + public static FailHealthCheckOnStagingFailure fromString(String name) { + return fromString(name, FailHealthCheckOnStagingFailure.class); + } + + /** + * Gets known FailHealthCheckOnStagingFailure values. + * + * @return known FailHealthCheckOnStagingFailure values. + */ + public static Collection values() { + return values(FailHealthCheckOnStagingFailure.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java index 2ec1634405e8..84a258bbabdb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckName.java @@ -5,47 +5,70 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Represents the name of the health check operation performed. */ +/** + * Represents the name of the health check operation performed. + */ public final class HealthCheckName extends ExpandableStringEnum { - /** Static value DomainJoinedCheck for HealthCheckName. */ + /** + * Static value DomainJoinedCheck for HealthCheckName. + */ public static final HealthCheckName DOMAIN_JOINED_CHECK = fromString("DomainJoinedCheck"); - /** Static value DomainTrustCheck for HealthCheckName. */ + /** + * Static value DomainTrustCheck for HealthCheckName. + */ public static final HealthCheckName DOMAIN_TRUST_CHECK = fromString("DomainTrustCheck"); - /** Static value FSLogixHealthCheck for HealthCheckName. */ + /** + * Static value FSLogixHealthCheck for HealthCheckName. + */ public static final HealthCheckName FSLOGIX_HEALTH_CHECK = fromString("FSLogixHealthCheck"); - /** Static value SxSStackListenerCheck for HealthCheckName. */ + /** + * Static value SxSStackListenerCheck for HealthCheckName. + */ public static final HealthCheckName SX_SSTACK_LISTENER_CHECK = fromString("SxSStackListenerCheck"); - /** Static value UrlsAccessibleCheck for HealthCheckName. */ + /** + * Static value UrlsAccessibleCheck for HealthCheckName. + */ public static final HealthCheckName URLS_ACCESSIBLE_CHECK = fromString("UrlsAccessibleCheck"); - /** Static value MonitoringAgentCheck for HealthCheckName. */ + /** + * Static value MonitoringAgentCheck for HealthCheckName. + */ public static final HealthCheckName MONITORING_AGENT_CHECK = fromString("MonitoringAgentCheck"); - /** Static value DomainReachable for HealthCheckName. */ + /** + * Static value DomainReachable for HealthCheckName. + */ public static final HealthCheckName DOMAIN_REACHABLE = fromString("DomainReachable"); - /** Static value WebRTCRedirectorCheck for HealthCheckName. */ + /** + * Static value WebRTCRedirectorCheck for HealthCheckName. + */ public static final HealthCheckName WEB_RTCREDIRECTOR_CHECK = fromString("WebRTCRedirectorCheck"); - /** Static value SupportedEncryptionCheck for HealthCheckName. */ + /** + * Static value SupportedEncryptionCheck for HealthCheckName. + */ public static final HealthCheckName SUPPORTED_ENCRYPTION_CHECK = fromString("SupportedEncryptionCheck"); - /** Static value MetaDataServiceCheck for HealthCheckName. */ + /** + * Static value MetaDataServiceCheck for HealthCheckName. + */ public static final HealthCheckName META_DATA_SERVICE_CHECK = fromString("MetaDataServiceCheck"); - /** Static value AppAttachHealthCheck for HealthCheckName. */ + /** + * Static value AppAttachHealthCheck for HealthCheckName. + */ public static final HealthCheckName APP_ATTACH_HEALTH_CHECK = fromString("AppAttachHealthCheck"); /** * Creates a new instance of HealthCheckName value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -54,18 +77,17 @@ public HealthCheckName() { /** * Creates or finds a HealthCheckName from its string representation. - * + * * @param name a name to look for. * @return the corresponding HealthCheckName. */ - @JsonCreator public static HealthCheckName fromString(String name) { return fromString(name, HealthCheckName.class); } /** * Gets known HealthCheckName values. - * + * * @return known HealthCheckName values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java index d5dd24f33c55..73d35a4db64a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HealthCheckResult.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Represents the Health state of the health check we performed. */ +/** + * Represents the Health state of the health check we performed. + */ public final class HealthCheckResult extends ExpandableStringEnum { - /** Static value Unknown for HealthCheckResult. */ + /** + * Static value Unknown for HealthCheckResult. + */ public static final HealthCheckResult UNKNOWN = fromString("Unknown"); - /** Static value HealthCheckSucceeded for HealthCheckResult. */ + /** + * Static value HealthCheckSucceeded for HealthCheckResult. + */ public static final HealthCheckResult HEALTH_CHECK_SUCCEEDED = fromString("HealthCheckSucceeded"); - /** Static value HealthCheckFailed for HealthCheckResult. */ + /** + * Static value HealthCheckFailed for HealthCheckResult. + */ public static final HealthCheckResult HEALTH_CHECK_FAILED = fromString("HealthCheckFailed"); - /** Static value SessionHostShutdown for HealthCheckResult. */ + /** + * Static value SessionHostShutdown for HealthCheckResult. + */ public static final HealthCheckResult SESSION_HOST_SHUTDOWN = fromString("SessionHostShutdown"); /** * Creates a new instance of HealthCheckResult value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public HealthCheckResult() { /** * Creates or finds a HealthCheckResult from its string representation. - * + * * @param name a name to look for. * @return the corresponding HealthCheckResult. */ - @JsonCreator public static HealthCheckResult fromString(String name) { return fromString(name, HealthCheckResult.class); } /** * Gets known HealthCheckResult values. - * + * * @return known HealthCheckResult values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java index 2e2df0ffcb0b..141e7459f03e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPool.java @@ -13,39 +13,41 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of HostPool. */ +/** + * An immutable client-side representation of HostPool. + */ public interface HostPool { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -54,16 +56,16 @@ public interface HostPool { * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment * will not delete the resource if it is removed from the template since it is managed by another resource. - * + * * @return the managedBy value. */ String managedBy(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ String kind(); @@ -73,140 +75,147 @@ public interface HostPool { * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * + * * @return the etag value. */ String etag(); /** * Gets the identity property: The identity property. - * + * * @return the identity value. */ ResourceModelWithAllowedPropertySetIdentity identity(); /** * Gets the sku property: The sku property. - * + * * @return the sku value. */ ResourceModelWithAllowedPropertySetSku sku(); /** * Gets the plan property: The plan property. - * + * * @return the plan value. */ ResourceModelWithAllowedPropertySetPlan plan(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of HostPool. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the friendlyName property: Friendly name of HostPool. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the description property: Description of HostPool. - * + * * @return the description value. */ String description(); /** * Gets the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ HostPoolType hostPoolType(); /** * Gets the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @return the personalDesktopAssignmentType value. */ PersonalDesktopAssignmentType personalDesktopAssignmentType(); /** * Gets the customRdpProperty property: Custom rdp property of HostPool. - * + * * @return the customRdpProperty value. */ String customRdpProperty(); /** * Gets the maxSessionLimit property: The max session limit of HostPool. - * + * * @return the maxSessionLimit value. */ Integer maxSessionLimit(); /** * Gets the loadBalancerType property: The type of the load balancer. - * + * * @return the loadBalancerType value. */ LoadBalancerType loadBalancerType(); /** * Gets the ring property: The ring number of HostPool. - * + * * @return the ring value. */ Integer ring(); /** * Gets the validationEnvironment property: Is validation environment. - * + * * @return the validationEnvironment value. */ Boolean validationEnvironment(); /** * Gets the registrationInfo property: The registration info of HostPool. - * + * * @return the registrationInfo value. */ RegistrationInfo registrationInfo(); /** * Gets the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @return the vmTemplate value. */ String vmTemplate(); /** * Gets the applicationGroupReferences property: List of applicationGroup links. - * + * * @return the applicationGroupReferences value. */ List applicationGroupReferences(); + /** + * Gets the appAttachPackageReferences property: List of App Attach Package links. + * + * @return the appAttachPackageReferences value. + */ + List appAttachPackageReferences(); + /** * Gets the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @return the ssoadfsAuthority value. */ String ssoadfsAuthority(); /** * Gets the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @return the ssoClientId value. */ String ssoClientId(); @@ -214,14 +223,14 @@ public interface HostPool { /** * Gets the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication * to ADFS. - * + * * @return the ssoClientSecretKeyVaultPath value. */ String ssoClientSecretKeyVaultPath(); /** * Gets the ssoSecretType property: The type of single sign on Secret Type. - * + * * @return the ssoSecretType value. */ SsoSecretType ssoSecretType(); @@ -229,21 +238,21 @@ public interface HostPool { /** * Gets the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @return the preferredAppGroupType value. */ PreferredAppGroupType preferredAppGroupType(); /** * Gets the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @return the startVMOnConnect value. */ Boolean startVMOnConnect(); /** * Gets the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ Boolean cloudPcResource(); @@ -251,7 +260,7 @@ public interface HostPool { /** * Gets the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ HostpoolPublicNetworkAccess publicNetworkAccess(); @@ -259,7 +268,7 @@ public interface HostPool { /** * Gets the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @return the agentUpdate value. */ AgentUpdateProperties agentUpdate(); @@ -267,61 +276,64 @@ public interface HostPool { /** * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ List privateEndpointConnections(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner object. - * + * * @return the inner object. */ HostPoolInner innerModel(); - /** The entirety of the HostPool definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithHostPoolType, - DefinitionStages.WithLoadBalancerType, - DefinitionStages.WithPreferredAppGroupType, - DefinitionStages.WithCreate { + /** + * The entirety of the HostPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithHostPoolType, DefinitionStages.WithLoadBalancerType, + DefinitionStages.WithPreferredAppGroupType, DefinitionStages.WithCreate { } - /** The HostPool definition stages. */ + /** + * The HostPool definition stages. + */ interface DefinitionStages { - /** The first stage of the HostPool definition. */ + /** + * The first stage of the HostPool definition. + */ interface Blank extends WithLocation { } - /** The stage of the HostPool definition allowing to specify location. */ + /** + * The stage of the HostPool definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -329,54 +341,62 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the HostPool definition allowing to specify parent resource. */ + /** + * The stage of the HostPool definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithHostPoolType withExistingResourceGroup(String resourceGroupName); } - /** The stage of the HostPool definition allowing to specify hostPoolType. */ + /** + * The stage of the HostPool definition allowing to specify hostPoolType. + */ interface WithHostPoolType { /** * Specifies the hostPoolType property: HostPool type for desktop.. - * + * * @param hostPoolType HostPool type for desktop. * @return the next definition stage. */ WithLoadBalancerType withHostPoolType(HostPoolType hostPoolType); } - /** The stage of the HostPool definition allowing to specify loadBalancerType. */ + /** + * The stage of the HostPool definition allowing to specify loadBalancerType. + */ interface WithLoadBalancerType { /** * Specifies the loadBalancerType property: The type of the load balancer.. - * + * * @param loadBalancerType The type of the load balancer. * @return the next definition stage. */ WithPreferredAppGroupType withLoadBalancerType(LoadBalancerType loadBalancerType); } - /** The stage of the HostPool definition allowing to specify preferredAppGroupType. */ + /** + * The stage of the HostPool definition allowing to specify preferredAppGroupType. + */ interface WithPreferredAppGroupType { /** * Specifies the preferredAppGroupType property: The type of preferred application group type, default to * Desktop Application Group. - * + * * @param preferredAppGroupType The type of preferred application group type, default to Desktop Application - * Group. + * Group. * @return the next definition stage. */ WithCreate withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType); @@ -386,298 +406,329 @@ interface WithPreferredAppGroupType { * The stage of the HostPool definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithManagedBy, - DefinitionStages.WithKind, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithPlan, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithDescription, - DefinitionStages.WithPersonalDesktopAssignmentType, - DefinitionStages.WithCustomRdpProperty, - DefinitionStages.WithMaxSessionLimit, - DefinitionStages.WithRing, - DefinitionStages.WithValidationEnvironment, - DefinitionStages.WithRegistrationInfo, - DefinitionStages.WithVmTemplate, - DefinitionStages.WithSsoadfsAuthority, - DefinitionStages.WithSsoClientId, - DefinitionStages.WithSsoClientSecretKeyVaultPath, - DefinitionStages.WithSsoSecretType, - DefinitionStages.WithStartVMOnConnect, - DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithAgentUpdate { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, + DefinitionStages.WithKind, DefinitionStages.WithIdentity, DefinitionStages.WithSku, + DefinitionStages.WithPlan, DefinitionStages.WithFriendlyName, DefinitionStages.WithDescription, + DefinitionStages.WithPersonalDesktopAssignmentType, DefinitionStages.WithCustomRdpProperty, + DefinitionStages.WithMaxSessionLimit, DefinitionStages.WithRing, DefinitionStages.WithValidationEnvironment, + DefinitionStages.WithRegistrationInfo, DefinitionStages.WithVmTemplate, + DefinitionStages.WithSsoadfsAuthority, DefinitionStages.WithSsoClientId, + DefinitionStages.WithSsoClientSecretKeyVaultPath, DefinitionStages.WithSsoSecretType, + DefinitionStages.WithStartVMOnConnect, DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithAgentUpdate { /** * Executes the create request. - * + * * @return the created resource. */ HostPool create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ HostPool create(Context context); } - /** The stage of the HostPool definition allowing to specify tags. */ + /** + * The stage of the HostPool definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the HostPool definition allowing to specify managedBy. */ + /** + * The stage of the HostPool definition allowing to specify managedBy. + */ interface WithManagedBy { /** * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete * mode deployment will not delete the resource if it is removed from the template since it is managed by * another resource.. - * + * * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will - * not delete the resource if it is removed from the template since it is managed by another resource. + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ WithCreate withManagedBy(String managedBy); } - /** The stage of the HostPool definition allowing to specify kind. */ + /** + * The stage of the HostPool definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider - * must validate and persist this value. + * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the HostPool definition allowing to specify identity. */ + /** + * The stage of the HostPool definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity property.. - * + * * @param identity The identity property. * @return the next definition stage. */ WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); } - /** The stage of the HostPool definition allowing to specify sku. */ + /** + * The stage of the HostPool definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku property.. - * + * * @param sku The sku property. * @return the next definition stage. */ WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); } - /** The stage of the HostPool definition allowing to specify plan. */ + /** + * The stage of the HostPool definition allowing to specify plan. + */ interface WithPlan { /** * Specifies the plan property: The plan property.. - * + * * @param plan The plan property. * @return the next definition stage. */ WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); } - /** The stage of the HostPool definition allowing to specify friendlyName. */ + /** + * The stage of the HostPool definition allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of HostPool.. - * + * * @param friendlyName Friendly name of HostPool. * @return the next definition stage. */ WithCreate withFriendlyName(String friendlyName); } - /** The stage of the HostPool definition allowing to specify description. */ + /** + * The stage of the HostPool definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of HostPool.. - * + * * @param description Description of HostPool. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the HostPool definition allowing to specify personalDesktopAssignmentType. */ + /** + * The stage of the HostPool definition allowing to specify personalDesktopAssignmentType. + */ interface WithPersonalDesktopAssignmentType { /** * Specifies the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool.. - * + * * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. * @return the next definition stage. */ WithCreate withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType); } - /** The stage of the HostPool definition allowing to specify customRdpProperty. */ + /** + * The stage of the HostPool definition allowing to specify customRdpProperty. + */ interface WithCustomRdpProperty { /** * Specifies the customRdpProperty property: Custom rdp property of HostPool.. - * + * * @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 maxSessionLimit. */ + /** + * The stage of the HostPool definition allowing to specify maxSessionLimit. + */ interface WithMaxSessionLimit { /** * Specifies the maxSessionLimit property: The max session limit of HostPool.. - * + * * @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 ring. */ + /** + * The stage of the HostPool definition allowing to specify ring. + */ interface WithRing { /** * Specifies the ring property: The ring number of HostPool.. - * + * * @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 validationEnvironment. */ + /** + * The stage of the HostPool definition allowing to specify validationEnvironment. + */ interface WithValidationEnvironment { /** * Specifies the validationEnvironment property: Is validation environment.. - * + * * @param validationEnvironment Is validation environment. * @return the next definition stage. */ WithCreate withValidationEnvironment(Boolean validationEnvironment); } - /** The stage of the HostPool definition allowing to specify registrationInfo. */ + /** + * The stage of the HostPool definition allowing to specify registrationInfo. + */ interface WithRegistrationInfo { /** * Specifies the registrationInfo property: The registration info of HostPool.. - * + * * @param registrationInfo The registration info of HostPool. * @return the next definition stage. */ WithCreate withRegistrationInfo(RegistrationInfoInner registrationInfo); } - /** The stage of the HostPool definition allowing to specify vmTemplate. */ + /** + * The stage of the HostPool definition allowing to specify vmTemplate. + */ interface WithVmTemplate { /** * Specifies the vmTemplate property: VM template for sessionhosts configuration within hostpool.. - * + * * @param vmTemplate VM template for sessionhosts configuration within hostpool. * @return the next definition stage. */ WithCreate withVmTemplate(String vmTemplate); } - /** The stage of the HostPool definition allowing to specify ssoadfsAuthority. */ + /** + * The stage of the HostPool definition allowing to specify ssoadfsAuthority. + */ interface WithSsoadfsAuthority { /** * Specifies the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates.. - * + * * @param ssoadfsAuthority URL to customer ADFS server for signing WVD SSO certificates. * @return the next definition stage. */ WithCreate withSsoadfsAuthority(String ssoadfsAuthority); } - /** The stage of the HostPool definition allowing to specify ssoClientId. */ + /** + * The stage of the HostPool definition allowing to specify ssoClientId. + */ interface WithSsoClientId { /** * Specifies the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO * certificates.. - * + * * @param ssoClientId ClientId for the registered Relying Party used to issue WVD SSO certificates. * @return the next definition stage. */ WithCreate withSsoClientId(String ssoClientId); } - /** The stage of the HostPool definition allowing to specify ssoClientSecretKeyVaultPath. */ + /** + * The stage of the HostPool definition allowing to specify ssoClientSecretKeyVaultPath. + */ interface WithSsoClientSecretKeyVaultPath { /** * Specifies the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for * communication to ADFS.. - * + * * @param ssoClientSecretKeyVaultPath Path to Azure KeyVault storing the secret used for communication to - * ADFS. + * ADFS. * @return the next definition stage. */ WithCreate withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath); } - /** The stage of the HostPool definition allowing to specify ssoSecretType. */ + /** + * The stage of the HostPool definition allowing to specify ssoSecretType. + */ interface WithSsoSecretType { /** * Specifies the ssoSecretType property: The type of single sign on Secret Type.. - * + * * @param ssoSecretType The type of single sign on Secret Type. * @return the next definition stage. */ WithCreate withSsoSecretType(SsoSecretType ssoSecretType); } - /** The stage of the HostPool definition allowing to specify startVMOnConnect. */ + /** + * The stage of the HostPool definition allowing to specify startVMOnConnect. + */ interface WithStartVMOnConnect { /** * Specifies the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature.. - * + * * @param startVMOnConnect The flag to turn on/off StartVMOnConnect feature. * @return the next definition stage. */ WithCreate withStartVMOnConnect(Boolean startVMOnConnect); } - /** The stage of the HostPool definition allowing to specify publicNetworkAccess. */ + /** + * The stage of the HostPool definition allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Enabled allows this resource to be accessed from both public * and private networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @param publicNetworkAccess Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. + * networks, Disabled allows this resource to only be accessed via private endpoints. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess); } - /** The stage of the HostPool definition allowing to specify agentUpdate. */ + /** + * The stage of the HostPool definition allowing to specify agentUpdate. + */ interface WithAgentUpdate { /** * Specifies the agentUpdate property: The session host configuration for updating agent, monitoring agent, * and stack component.. - * + * * @param agentUpdate The session host configuration for updating agent, monitoring agent, and stack - * component. + * component. * @return the next definition stage. */ WithCreate withAgentUpdate(AgentUpdateProperties agentUpdate); @@ -686,262 +737,291 @@ interface WithAgentUpdate { /** * Begins update for the HostPool resource. - * + * * @return the stage of resource update. */ HostPool.Update update(); - /** The template for HostPool update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithFriendlyName, - UpdateStages.WithDescription, - UpdateStages.WithCustomRdpProperty, - UpdateStages.WithMaxSessionLimit, - UpdateStages.WithPersonalDesktopAssignmentType, - UpdateStages.WithLoadBalancerType, - UpdateStages.WithRing, - UpdateStages.WithValidationEnvironment, - UpdateStages.WithRegistrationInfo, - UpdateStages.WithVmTemplate, - UpdateStages.WithSsoadfsAuthority, - UpdateStages.WithSsoClientId, - UpdateStages.WithSsoClientSecretKeyVaultPath, - UpdateStages.WithSsoSecretType, - UpdateStages.WithPreferredAppGroupType, - UpdateStages.WithStartVMOnConnect, - UpdateStages.WithPublicNetworkAccess, - UpdateStages.WithAgentUpdate { + /** + * The template for HostPool update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithFriendlyName, UpdateStages.WithDescription, + UpdateStages.WithCustomRdpProperty, UpdateStages.WithMaxSessionLimit, + UpdateStages.WithPersonalDesktopAssignmentType, UpdateStages.WithLoadBalancerType, UpdateStages.WithRing, + UpdateStages.WithValidationEnvironment, UpdateStages.WithRegistrationInfo, UpdateStages.WithVmTemplate, + UpdateStages.WithSsoadfsAuthority, UpdateStages.WithSsoClientId, UpdateStages.WithSsoClientSecretKeyVaultPath, + UpdateStages.WithSsoSecretType, UpdateStages.WithPreferredAppGroupType, UpdateStages.WithStartVMOnConnect, + UpdateStages.WithPublicNetworkAccess, UpdateStages.WithAgentUpdate { /** * Executes the update request. - * + * * @return the updated resource. */ HostPool apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ HostPool apply(Context context); } - /** The HostPool update stages. */ + /** + * The HostPool update stages. + */ interface UpdateStages { - /** The stage of the HostPool update allowing to specify tags. */ + /** + * The stage of the HostPool update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: tags to be updated. - * + * * @param tags tags to be updated. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the HostPool update allowing to specify friendlyName. */ + /** + * The stage of the HostPool update allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of HostPool.. - * + * * @param friendlyName Friendly name of HostPool. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } - /** The stage of the HostPool update allowing to specify description. */ + /** + * The stage of the HostPool update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of HostPool.. - * + * * @param description Description of HostPool. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the HostPool update allowing to specify customRdpProperty. */ + /** + * The stage of the HostPool update allowing to specify customRdpProperty. + */ interface WithCustomRdpProperty { /** * Specifies the customRdpProperty property: Custom rdp property of HostPool.. - * + * * @param customRdpProperty Custom rdp property of HostPool. * @return the next definition stage. */ Update withCustomRdpProperty(String customRdpProperty); } - /** The stage of the HostPool update allowing to specify maxSessionLimit. */ + /** + * The stage of the HostPool update allowing to specify maxSessionLimit. + */ interface WithMaxSessionLimit { /** * Specifies the maxSessionLimit property: The max session limit of HostPool.. - * + * * @param maxSessionLimit The max session limit of HostPool. * @return the next definition stage. */ Update withMaxSessionLimit(Integer maxSessionLimit); } - /** The stage of the HostPool update allowing to specify personalDesktopAssignmentType. */ + /** + * The stage of the HostPool update allowing to specify personalDesktopAssignmentType. + */ interface WithPersonalDesktopAssignmentType { /** * Specifies the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool.. - * + * * @param personalDesktopAssignmentType PersonalDesktopAssignment type for HostPool. * @return the next definition stage. */ Update withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType); } - /** The stage of the HostPool update allowing to specify loadBalancerType. */ + /** + * The stage of the HostPool update allowing to specify loadBalancerType. + */ interface WithLoadBalancerType { /** * Specifies the loadBalancerType property: The type of the load balancer.. - * + * * @param loadBalancerType The type of the load balancer. * @return the next definition stage. */ Update withLoadBalancerType(LoadBalancerType loadBalancerType); } - /** The stage of the HostPool update allowing to specify ring. */ + /** + * The stage of the HostPool update allowing to specify ring. + */ interface WithRing { /** * Specifies the ring property: The ring number of HostPool.. - * + * * @param ring The ring number of HostPool. * @return the next definition stage. */ Update withRing(Integer ring); } - /** The stage of the HostPool update allowing to specify validationEnvironment. */ + /** + * The stage of the HostPool update allowing to specify validationEnvironment. + */ interface WithValidationEnvironment { /** * Specifies the validationEnvironment property: Is validation environment.. - * + * * @param validationEnvironment Is validation environment. * @return the next definition stage. */ Update withValidationEnvironment(Boolean validationEnvironment); } - /** The stage of the HostPool update allowing to specify registrationInfo. */ + /** + * The stage of the HostPool update allowing to specify registrationInfo. + */ interface WithRegistrationInfo { /** * Specifies the registrationInfo property: The registration info of HostPool.. - * + * * @param registrationInfo The registration info of HostPool. * @return the next definition stage. */ Update withRegistrationInfo(RegistrationInfoPatch registrationInfo); } - /** The stage of the HostPool update allowing to specify vmTemplate. */ + /** + * The stage of the HostPool update allowing to specify vmTemplate. + */ interface WithVmTemplate { /** * Specifies the vmTemplate property: VM template for sessionhosts configuration within hostpool.. - * + * * @param vmTemplate VM template for sessionhosts configuration within hostpool. * @return the next definition stage. */ Update withVmTemplate(String vmTemplate); } - /** The stage of the HostPool update allowing to specify ssoadfsAuthority. */ + /** + * The stage of the HostPool update allowing to specify ssoadfsAuthority. + */ interface WithSsoadfsAuthority { /** * Specifies the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates.. - * + * * @param ssoadfsAuthority URL to customer ADFS server for signing WVD SSO certificates. * @return the next definition stage. */ Update withSsoadfsAuthority(String ssoadfsAuthority); } - /** The stage of the HostPool update allowing to specify ssoClientId. */ + /** + * The stage of the HostPool update allowing to specify ssoClientId. + */ interface WithSsoClientId { /** * Specifies the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO * certificates.. - * + * * @param ssoClientId ClientId for the registered Relying Party used to issue WVD SSO certificates. * @return the next definition stage. */ Update withSsoClientId(String ssoClientId); } - /** The stage of the HostPool update allowing to specify ssoClientSecretKeyVaultPath. */ + /** + * The stage of the HostPool update allowing to specify ssoClientSecretKeyVaultPath. + */ interface WithSsoClientSecretKeyVaultPath { /** * Specifies the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for * communication to ADFS.. - * + * * @param ssoClientSecretKeyVaultPath Path to Azure KeyVault storing the secret used for communication to - * ADFS. + * ADFS. * @return the next definition stage. */ Update withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVaultPath); } - /** The stage of the HostPool update allowing to specify ssoSecretType. */ + /** + * The stage of the HostPool update allowing to specify ssoSecretType. + */ interface WithSsoSecretType { /** * Specifies the ssoSecretType property: The type of single sign on Secret Type.. - * + * * @param ssoSecretType The type of single sign on Secret Type. * @return the next definition stage. */ Update withSsoSecretType(SsoSecretType ssoSecretType); } - /** The stage of the HostPool update allowing to specify preferredAppGroupType. */ + /** + * The stage of the HostPool update allowing to specify preferredAppGroupType. + */ interface WithPreferredAppGroupType { /** * Specifies the preferredAppGroupType property: The type of preferred application group type, default to * Desktop Application Group. - * + * * @param preferredAppGroupType The type of preferred application group type, default to Desktop Application - * Group. + * Group. * @return the next definition stage. */ Update withPreferredAppGroupType(PreferredAppGroupType preferredAppGroupType); } - /** The stage of the HostPool update allowing to specify startVMOnConnect. */ + /** + * The stage of the HostPool update allowing to specify startVMOnConnect. + */ interface WithStartVMOnConnect { /** * Specifies the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature.. - * + * * @param startVMOnConnect The flag to turn on/off StartVMOnConnect feature. * @return the next definition stage. */ Update withStartVMOnConnect(Boolean startVMOnConnect); } - /** The stage of the HostPool update allowing to specify publicNetworkAccess. */ + /** + * The stage of the HostPool update allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Enabled to allow this resource to be access from the public * network. - * + * * @param publicNetworkAccess Enabled to allow this resource to be access from the public network. * @return the next definition stage. */ Update withPublicNetworkAccess(HostpoolPublicNetworkAccess publicNetworkAccess); } - /** The stage of the HostPool update allowing to specify agentUpdate. */ + /** + * The stage of the HostPool update allowing to specify agentUpdate. + */ interface WithAgentUpdate { /** * Specifies the agentUpdate property: The session host configuration for updating agent, monitoring agent, * and stack component.. - * + * * @param agentUpdate The session host configuration for updating agent, monitoring agent, and stack - * component. + * component. * @return the next definition stage. */ Update withAgentUpdate(AgentUpdatePatchProperties agentUpdate); @@ -950,14 +1030,14 @@ interface WithAgentUpdate { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ HostPool refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -965,7 +1045,7 @@ interface WithAgentUpdate { /** * Registration token of the host pool. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -976,10 +1056,30 @@ interface WithAgentUpdate { /** * Registration token of the host pool. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a RegistrationInfo definition. */ RegistrationInfo retrieveRegistrationToken(); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response}. + */ + Response listRegistrationTokensWithResponse(Context context); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList. + */ + RegistrationTokenList listRegistrationTokens(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java index bd83fe63e797..16238b8f04aa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * HostPoolList - * - *

List of HostPool definitions. + * + * List of HostPool definitions. */ @Fluent -public final class HostPoolList { +public final class HostPoolList implements JsonSerializable { /* * List of HostPool 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; - /** Creates an instance of HostPoolList class. */ + /** + * Creates an instance of HostPoolList class. + */ public HostPoolList() { } /** * Get the value property: List of HostPool definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of HostPool definitions. - * + * * @param value the value value to set. * @return the HostPoolList object itself. */ @@ -54,7 +58,7 @@ public HostPoolList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HostPoolList. + */ + public static HostPoolList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolList deserializedHostPoolList = new HostPoolList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HostPoolInner.fromJson(reader1)); + deserializedHostPoolList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHostPoolList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java index 3732c02ff16f..66bd112d6ccc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolPatch.java @@ -6,34 +6,58 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** HostPool properties that can be patched. */ +/** + * HostPool properties that can be patched. + */ @Fluent public final class HostPoolPatch extends ProxyResource { /* * tags to be updated */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * HostPool properties that can be patched. */ - @JsonProperty(value = "properties") private HostPoolPatchProperties innerProperties; - /** Creates an instance of HostPoolPatch class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HostPoolPatch class. + */ public HostPoolPatch() { } /** * Get the tags property: tags to be updated. - * + * * @return the tags value. */ public Map tags() { @@ -42,7 +66,7 @@ public Map tags() { /** * Set the tags property: tags to be updated. - * + * * @param tags the tags value to set. * @return the HostPoolPatch object itself. */ @@ -53,16 +77,55 @@ public HostPoolPatch withTags(Map tags) { /** * Get the innerProperties property: HostPool properties that can be patched. - * + * * @return the innerProperties value. */ private HostPoolPatchProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the friendlyName property: Friendly name of HostPool. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -71,7 +134,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of HostPool. - * + * * @param friendlyName the friendlyName value to set. * @return the HostPoolPatch object itself. */ @@ -85,7 +148,7 @@ public HostPoolPatch withFriendlyName(String friendlyName) { /** * Get the description property: Description of HostPool. - * + * * @return the description value. */ public String description() { @@ -94,7 +157,7 @@ public String description() { /** * Set the description property: Description of HostPool. - * + * * @param description the description value to set. * @return the HostPoolPatch object itself. */ @@ -108,7 +171,7 @@ public HostPoolPatch withDescription(String description) { /** * Get the customRdpProperty property: Custom rdp property of HostPool. - * + * * @return the customRdpProperty value. */ public String customRdpProperty() { @@ -117,7 +180,7 @@ public String customRdpProperty() { /** * Set the customRdpProperty property: Custom rdp property of HostPool. - * + * * @param customRdpProperty the customRdpProperty value to set. * @return the HostPoolPatch object itself. */ @@ -131,7 +194,7 @@ public HostPoolPatch withCustomRdpProperty(String customRdpProperty) { /** * Get the maxSessionLimit property: The max session limit of HostPool. - * + * * @return the maxSessionLimit value. */ public Integer maxSessionLimit() { @@ -140,7 +203,7 @@ public Integer maxSessionLimit() { /** * Set the maxSessionLimit property: The max session limit of HostPool. - * + * * @param maxSessionLimit the maxSessionLimit value to set. * @return the HostPoolPatch object itself. */ @@ -154,7 +217,7 @@ public HostPoolPatch withMaxSessionLimit(Integer maxSessionLimit) { /** * Get the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @return the personalDesktopAssignmentType value. */ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { @@ -163,12 +226,12 @@ public PersonalDesktopAssignmentType personalDesktopAssignmentType() { /** * Set the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @param personalDesktopAssignmentType the personalDesktopAssignmentType value to set. * @return the HostPoolPatch object itself. */ - public HostPoolPatch withPersonalDesktopAssignmentType( - PersonalDesktopAssignmentType personalDesktopAssignmentType) { + public HostPoolPatch + withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType personalDesktopAssignmentType) { if (this.innerProperties() == null) { this.innerProperties = new HostPoolPatchProperties(); } @@ -178,7 +241,7 @@ public HostPoolPatch withPersonalDesktopAssignmentType( /** * Get the loadBalancerType property: The type of the load balancer. - * + * * @return the loadBalancerType value. */ public LoadBalancerType loadBalancerType() { @@ -187,7 +250,7 @@ public LoadBalancerType loadBalancerType() { /** * Set the loadBalancerType property: The type of the load balancer. - * + * * @param loadBalancerType the loadBalancerType value to set. * @return the HostPoolPatch object itself. */ @@ -201,7 +264,7 @@ public HostPoolPatch withLoadBalancerType(LoadBalancerType loadBalancerType) { /** * Get the ring property: The ring number of HostPool. - * + * * @return the ring value. */ public Integer ring() { @@ -210,7 +273,7 @@ public Integer ring() { /** * Set the ring property: The ring number of HostPool. - * + * * @param ring the ring value to set. * @return the HostPoolPatch object itself. */ @@ -224,7 +287,7 @@ public HostPoolPatch withRing(Integer ring) { /** * Get the validationEnvironment property: Is validation environment. - * + * * @return the validationEnvironment value. */ public Boolean validationEnvironment() { @@ -233,7 +296,7 @@ public Boolean validationEnvironment() { /** * Set the validationEnvironment property: Is validation environment. - * + * * @param validationEnvironment the validationEnvironment value to set. * @return the HostPoolPatch object itself. */ @@ -247,7 +310,7 @@ public HostPoolPatch withValidationEnvironment(Boolean validationEnvironment) { /** * Get the registrationInfo property: The registration info of HostPool. - * + * * @return the registrationInfo value. */ public RegistrationInfoPatch registrationInfo() { @@ -256,7 +319,7 @@ public RegistrationInfoPatch registrationInfo() { /** * Set the registrationInfo property: The registration info of HostPool. - * + * * @param registrationInfo the registrationInfo value to set. * @return the HostPoolPatch object itself. */ @@ -270,7 +333,7 @@ public HostPoolPatch withRegistrationInfo(RegistrationInfoPatch registrationInfo /** * Get the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @return the vmTemplate value. */ public String vmTemplate() { @@ -279,7 +342,7 @@ public String vmTemplate() { /** * Set the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @param vmTemplate the vmTemplate value to set. * @return the HostPoolPatch object itself. */ @@ -293,7 +356,7 @@ public HostPoolPatch withVmTemplate(String vmTemplate) { /** * Get the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @return the ssoadfsAuthority value. */ public String ssoadfsAuthority() { @@ -302,7 +365,7 @@ public String ssoadfsAuthority() { /** * Set the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @param ssoadfsAuthority the ssoadfsAuthority value to set. * @return the HostPoolPatch object itself. */ @@ -316,7 +379,7 @@ public HostPoolPatch withSsoadfsAuthority(String ssoadfsAuthority) { /** * Get the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @return the ssoClientId value. */ public String ssoClientId() { @@ -325,7 +388,7 @@ public String ssoClientId() { /** * Set the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @param ssoClientId the ssoClientId value to set. * @return the HostPoolPatch object itself. */ @@ -340,7 +403,7 @@ public HostPoolPatch withSsoClientId(String ssoClientId) { /** * Get the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @return the ssoClientSecretKeyVaultPath value. */ public String ssoClientSecretKeyVaultPath() { @@ -350,7 +413,7 @@ public String ssoClientSecretKeyVaultPath() { /** * Set the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication to * ADFS. - * + * * @param ssoClientSecretKeyVaultPath the ssoClientSecretKeyVaultPath value to set. * @return the HostPoolPatch object itself. */ @@ -364,7 +427,7 @@ public HostPoolPatch withSsoClientSecretKeyVaultPath(String ssoClientSecretKeyVa /** * Get the ssoSecretType property: The type of single sign on Secret Type. - * + * * @return the ssoSecretType value. */ public SsoSecretType ssoSecretType() { @@ -373,7 +436,7 @@ public SsoSecretType ssoSecretType() { /** * Set the ssoSecretType property: The type of single sign on Secret Type. - * + * * @param ssoSecretType the ssoSecretType value to set. * @return the HostPoolPatch object itself. */ @@ -388,7 +451,7 @@ public HostPoolPatch withSsoSecretType(SsoSecretType ssoSecretType) { /** * Get the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @return the preferredAppGroupType value. */ public PreferredAppGroupType preferredAppGroupType() { @@ -398,7 +461,7 @@ public PreferredAppGroupType preferredAppGroupType() { /** * Set the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @param preferredAppGroupType the preferredAppGroupType value to set. * @return the HostPoolPatch object itself. */ @@ -412,7 +475,7 @@ public HostPoolPatch withPreferredAppGroupType(PreferredAppGroupType preferredAp /** * Get the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @return the startVMOnConnect value. */ public Boolean startVMOnConnect() { @@ -421,7 +484,7 @@ public Boolean startVMOnConnect() { /** * Set the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @param startVMOnConnect the startVMOnConnect value to set. * @return the HostPoolPatch object itself. */ @@ -435,7 +498,7 @@ public HostPoolPatch withStartVMOnConnect(Boolean startVMOnConnect) { /** * Get the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @return the publicNetworkAccess value. */ public HostpoolPublicNetworkAccess publicNetworkAccess() { @@ -444,7 +507,7 @@ public HostpoolPublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the HostPoolPatch object itself. */ @@ -459,7 +522,7 @@ public HostPoolPatch withPublicNetworkAccess(HostpoolPublicNetworkAccess publicN /** * Get the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @return the agentUpdate value. */ public AgentUpdatePatchProperties agentUpdate() { @@ -469,7 +532,7 @@ public AgentUpdatePatchProperties agentUpdate() { /** * Set the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @param agentUpdate the agentUpdate value to set. * @return the HostPoolPatch object itself. */ @@ -483,7 +546,7 @@ public HostPoolPatch withAgentUpdate(AgentUpdatePatchProperties agentUpdate) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -491,4 +554,53 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostPoolPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostPoolPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HostPoolPatch. + */ + public static HostPoolPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostPoolPatch deserializedHostPoolPatch = new HostPoolPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHostPoolPatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHostPoolPatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHostPoolPatch.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHostPoolPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedHostPoolPatch.innerProperties = HostPoolPatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHostPoolPatch.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHostPoolPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java index e93b31ff7770..52393af79cba 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolProperties.java @@ -7,109 +7,118 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPropertiesInner; import java.util.List; -/** An immutable client-side representation of HostPoolProperties. */ +/** + * An immutable client-side representation of HostPoolProperties. + */ public interface HostPoolProperties { /** * Gets the objectId property: ObjectId of HostPool. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the friendlyName property: Friendly name of HostPool. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the description property: Description of HostPool. - * + * * @return the description value. */ String description(); /** * Gets the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ HostPoolType hostPoolType(); /** * Gets the personalDesktopAssignmentType property: PersonalDesktopAssignment type for HostPool. - * + * * @return the personalDesktopAssignmentType value. */ PersonalDesktopAssignmentType personalDesktopAssignmentType(); /** * Gets the customRdpProperty property: Custom rdp property of HostPool. - * + * * @return the customRdpProperty value. */ String customRdpProperty(); /** * Gets the maxSessionLimit property: The max session limit of HostPool. - * + * * @return the maxSessionLimit value. */ Integer maxSessionLimit(); /** * Gets the loadBalancerType property: The type of the load balancer. - * + * * @return the loadBalancerType value. */ LoadBalancerType loadBalancerType(); /** * Gets the ring property: The ring number of HostPool. - * + * * @return the ring value. */ Integer ring(); /** * Gets the validationEnvironment property: Is validation environment. - * + * * @return the validationEnvironment value. */ Boolean validationEnvironment(); /** * Gets the registrationInfo property: The registration info of HostPool. - * + * * @return the registrationInfo value. */ RegistrationInfo registrationInfo(); /** * Gets the vmTemplate property: VM template for sessionhosts configuration within hostpool. - * + * * @return the vmTemplate value. */ String vmTemplate(); /** * Gets the applicationGroupReferences property: List of applicationGroup links. - * + * * @return the applicationGroupReferences value. */ List applicationGroupReferences(); + /** + * Gets the appAttachPackageReferences property: List of App Attach Package links. + * + * @return the appAttachPackageReferences value. + */ + List appAttachPackageReferences(); + /** * Gets the ssoadfsAuthority property: URL to customer ADFS server for signing WVD SSO certificates. - * + * * @return the ssoadfsAuthority value. */ String ssoadfsAuthority(); /** * Gets the ssoClientId property: ClientId for the registered Relying Party used to issue WVD SSO certificates. - * + * * @return the ssoClientId value. */ String ssoClientId(); @@ -117,14 +126,14 @@ public interface HostPoolProperties { /** * Gets the ssoClientSecretKeyVaultPath property: Path to Azure KeyVault storing the secret used for communication * to ADFS. - * + * * @return the ssoClientSecretKeyVaultPath value. */ String ssoClientSecretKeyVaultPath(); /** * Gets the ssoSecretType property: The type of single sign on Secret Type. - * + * * @return the ssoSecretType value. */ SsoSecretType ssoSecretType(); @@ -132,21 +141,21 @@ public interface HostPoolProperties { /** * Gets the preferredAppGroupType property: The type of preferred application group type, default to Desktop * Application Group. - * + * * @return the preferredAppGroupType value. */ PreferredAppGroupType preferredAppGroupType(); /** * Gets the startVMOnConnect property: The flag to turn on/off StartVMOnConnect feature. - * + * * @return the startVMOnConnect value. */ Boolean startVMOnConnect(); /** * Gets the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ Boolean cloudPcResource(); @@ -154,7 +163,7 @@ public interface HostPoolProperties { /** * Gets the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ HostpoolPublicNetworkAccess publicNetworkAccess(); @@ -162,7 +171,7 @@ public interface HostPoolProperties { /** * Gets the agentUpdate property: The session host configuration for updating agent, monitoring agent, and stack * component. - * + * * @return the agentUpdate value. */ AgentUpdateProperties agentUpdate(); @@ -170,14 +179,14 @@ public interface HostPoolProperties { /** * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ List privateEndpointConnections(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.HostPoolPropertiesInner object. - * + * * @return the inner object. */ HostPoolPropertiesInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java index ae2946370f8f..7099c7232561 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPoolType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** HostPool type for desktop. */ +/** + * HostPool type for desktop. + */ public final class HostPoolType extends ExpandableStringEnum { - /** Static value Personal for HostPoolType. */ + /** + * Static value Personal for HostPoolType. + */ public static final HostPoolType PERSONAL = fromString("Personal"); - /** Static value Pooled for HostPoolType. */ + /** + * Static value Pooled for HostPoolType. + */ public static final HostPoolType POOLED = fromString("Pooled"); - /** Static value BYODesktop for HostPoolType. */ + /** + * Static value BYODesktop for HostPoolType. + */ public static final HostPoolType BYODESKTOP = fromString("BYODesktop"); /** * Creates a new instance of HostPoolType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public HostPoolType() { /** * 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); } /** * Gets known HostPoolType values. - * + * * @return known HostPoolType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java index 71be49d892fa..c76eb279bfe3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostPools.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of HostPools. */ +/** + * Resource collection API of HostPools. + */ public interface HostPools { /** * 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 context The context to associate with this operation. @@ -25,7 +27,7 @@ public interface HostPools { /** * 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. @@ -37,7 +39,7 @@ public interface HostPools { /** * 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. @@ -51,7 +53,7 @@ public interface HostPools { /** * 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. @@ -62,7 +64,7 @@ public interface HostPools { /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -73,7 +75,7 @@ public interface HostPools { /** * List hostPools. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -84,12 +86,12 @@ public interface HostPools { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return hostPoolList as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** * List hostPools in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return hostPoolList as paginated response with {@link PagedIterable}. @@ -98,7 +100,7 @@ PagedIterable listByResourceGroup( /** * List hostPools in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -112,7 +114,7 @@ PagedIterable listByResourceGroup( /** * Registration token of the 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 context The context to associate with this operation. @@ -121,12 +123,12 @@ PagedIterable listByResourceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a RegistrationInfo definition along with {@link Response}. */ - Response retrieveRegistrationTokenWithResponse( - String resourceGroupName, String hostPoolName, Context context); + Response retrieveRegistrationTokenWithResponse(String resourceGroupName, String hostPoolName, + Context context); /** * Registration token of the 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. @@ -136,9 +138,35 @@ Response retrieveRegistrationTokenWithResponse( */ RegistrationInfo retrieveRegistrationToken(String resourceGroupName, String hostPoolName); + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList along with {@link Response}. + */ + Response listRegistrationTokensWithResponse(String resourceGroupName, String hostPoolName, + Context context); + + /** + * Operation to list the RegistrationTokens associated with the HostPool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hostPoolName The name of the host pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registrationTokenList. + */ + RegistrationTokenList listRegistrationTokens(String resourceGroupName, String hostPoolName); + /** * Get a host pool. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -149,7 +177,7 @@ Response retrieveRegistrationTokenWithResponse( /** * Get a host pool. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -161,7 +189,7 @@ Response retrieveRegistrationTokenWithResponse( /** * Remove a host pool. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -171,7 +199,7 @@ Response retrieveRegistrationTokenWithResponse( /** * Remove a host pool. - * + * * @param id the resource ID. * @param force Force flag to delete sessionHost. * @param context The context to associate with this operation. @@ -184,7 +212,7 @@ Response retrieveRegistrationTokenWithResponse( /** * Begins definition for a new HostPool resource. - * + * * @param name resource name. * @return the first stage of the new HostPool definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java index 57801eb24489..6f4676aaf0c9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/HostpoolPublicNetworkAccess.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,22 +12,30 @@ * only be accessed via private endpoints. */ public final class HostpoolPublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for HostpoolPublicNetworkAccess. */ + /** + * Static value Enabled for HostpoolPublicNetworkAccess. + */ public static final HostpoolPublicNetworkAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for HostpoolPublicNetworkAccess. */ + /** + * Static value Disabled for HostpoolPublicNetworkAccess. + */ public static final HostpoolPublicNetworkAccess DISABLED = fromString("Disabled"); - /** Static value EnabledForSessionHostsOnly for HostpoolPublicNetworkAccess. */ - public static final HostpoolPublicNetworkAccess ENABLED_FOR_SESSION_HOSTS_ONLY = - fromString("EnabledForSessionHostsOnly"); + /** + * Static value EnabledForSessionHostsOnly for HostpoolPublicNetworkAccess. + */ + public static final HostpoolPublicNetworkAccess ENABLED_FOR_SESSION_HOSTS_ONLY + = fromString("EnabledForSessionHostsOnly"); - /** Static value EnabledForClientsOnly for HostpoolPublicNetworkAccess. */ + /** + * Static value EnabledForClientsOnly for HostpoolPublicNetworkAccess. + */ public static final HostpoolPublicNetworkAccess ENABLED_FOR_CLIENTS_ONLY = fromString("EnabledForClientsOnly"); /** * Creates a new instance of HostpoolPublicNetworkAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +44,17 @@ public HostpoolPublicNetworkAccess() { /** * Creates or finds a HostpoolPublicNetworkAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding HostpoolPublicNetworkAccess. */ - @JsonCreator public static HostpoolPublicNetworkAccess fromString(String name) { return fromString(name, HostpoolPublicNetworkAccess.class); } /** * Gets known HostpoolPublicNetworkAccess values. - * + * * @return known HostpoolPublicNetworkAccess values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java index d78b5907e0d8..f7212bff036d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Identity.java @@ -5,54 +5,82 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; -/** Identity for the resource. */ +/** + * Identity for the resource. + */ @Fluent -public class Identity { +public class Identity implements JsonSerializable { /* - * The principal ID of resource identity. + * The principal ID of resource identity. The value must be an UUID. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; + private UUID principalId; /* - * The tenant ID of resource. + * The tenant ID of resource. The value must be an UUID. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; + private UUID tenantId; /* * The identity type. */ - @JsonProperty(value = "type") private ResourceIdentityType type; - /** Creates an instance of Identity class. */ + /** + * Creates an instance of Identity class. + */ public Identity() { } /** - * Get the principalId property: The principal ID of resource identity. - * + * Get the principalId property: The principal ID of resource identity. The value must be an UUID. + * * @return the principalId value. */ - public String principalId() { + public UUID principalId() { return this.principalId; } /** - * Get the tenantId property: The tenant ID of resource. - * + * Set the principalId property: The principal ID of resource identity. The value must be an UUID. + * + * @param principalId the principalId value to set. + * @return the Identity object itself. + */ + Identity withPrincipalId(UUID principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID of resource. The value must be an UUID. + * * @return the tenantId value. */ - public String tenantId() { + public UUID tenantId() { return this.tenantId; } + /** + * Set the tenantId property: The tenant ID of resource. The value must be an UUID. + * + * @param tenantId the tenantId value to set. + * @return the Identity object itself. + */ + Identity withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + /** * Get the type property: The identity type. - * + * * @return the type value. */ public ResourceIdentityType type() { @@ -61,7 +89,7 @@ public ResourceIdentityType type() { /** * Set the type property: The identity type. - * + * * @param type the type value to set. * @return the Identity object itself. */ @@ -72,9 +100,51 @@ public Identity withType(ResourceIdentityType type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java new file mode 100644 index 000000000000..4c420a71a61b --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ImportPackageInfoRequest.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information to import app attach package. + */ +@Fluent +public final class ImportPackageInfoRequest implements JsonSerializable { + /* + * URI to Image + */ + private String path; + + /* + * Possible device architectures that an app attach package can be configured for + */ + private AppAttachPackageArchitectures packageArchitecture; + + /** + * Creates an instance of ImportPackageInfoRequest class. + */ + public ImportPackageInfoRequest() { + } + + /** + * Get the path property: URI to Image. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: URI to Image. + * + * @param path the path value to set. + * @return the ImportPackageInfoRequest object itself. + */ + public ImportPackageInfoRequest withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the packageArchitecture property: Possible device architectures that an app attach package can be configured + * for. + * + * @return the packageArchitecture value. + */ + public AppAttachPackageArchitectures packageArchitecture() { + return this.packageArchitecture; + } + + /** + * Set the packageArchitecture property: Possible device architectures that an app attach package can be configured + * for. + * + * @param packageArchitecture the packageArchitecture value to set. + * @return the ImportPackageInfoRequest object itself. + */ + public ImportPackageInfoRequest withPackageArchitecture(AppAttachPackageArchitectures packageArchitecture) { + this.packageArchitecture = packageArchitecture; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("packageArchitecture", + this.packageArchitecture == null ? null : this.packageArchitecture.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportPackageInfoRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportPackageInfoRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImportPackageInfoRequest. + */ + public static ImportPackageInfoRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportPackageInfoRequest deserializedImportPackageInfoRequest = new ImportPackageInfoRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedImportPackageInfoRequest.path = reader.getString(); + } else if ("packageArchitecture".equals(fieldName)) { + deserializedImportPackageInfoRequest.packageArchitecture + = AppAttachPackageArchitectures.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImportPackageInfoRequest; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java index 56c996f1f731..f147cea0d2dc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LoadBalancerType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the load balancer. */ +/** + * The type of the load balancer. + */ public final class LoadBalancerType extends ExpandableStringEnum { - /** Static value BreadthFirst for LoadBalancerType. */ + /** + * Static value BreadthFirst for LoadBalancerType. + */ public static final LoadBalancerType BREADTH_FIRST = fromString("BreadthFirst"); - /** Static value DepthFirst for LoadBalancerType. */ + /** + * Static value DepthFirst for LoadBalancerType. + */ public static final LoadBalancerType DEPTH_FIRST = fromString("DepthFirst"); - /** Static value Persistent for LoadBalancerType. */ + /** + * Static value Persistent for LoadBalancerType. + */ public static final LoadBalancerType PERSISTENT = fromString("Persistent"); /** * Creates a new instance of LoadBalancerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public LoadBalancerType() { /** * 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); } /** * Gets known LoadBalancerType values. - * + * * @return known LoadBalancerType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java index f431828f285d..8eb95ebd6191 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/LogSpecification.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Specifications of the Log for Azure Monitoring. */ +/** + * Specifications of the Log for Azure Monitoring. + */ @Fluent -public final class LogSpecification { +public final class LogSpecification implements JsonSerializable { /* * Name of the log */ - @JsonProperty(value = "name") private String name; /* * Localized friendly display name of the log */ - @JsonProperty(value = "displayName") private String displayName; /* * Blob duration of the log */ - @JsonProperty(value = "blobDuration") private String blobDuration; - /** Creates an instance of LogSpecification class. */ + /** + * Creates an instance of LogSpecification class. + */ public LogSpecification() { } /** * Get the name property: Name of the log. - * + * * @return the name value. */ public String name() { @@ -43,7 +48,7 @@ public String name() { /** * Set the name property: Name of the log. - * + * * @param name the name value to set. * @return the LogSpecification object itself. */ @@ -54,7 +59,7 @@ public LogSpecification withName(String name) { /** * Get the displayName property: Localized friendly display name of the log. - * + * * @return the displayName value. */ public String displayName() { @@ -63,7 +68,7 @@ public String displayName() { /** * Set the displayName property: Localized friendly display name of the log. - * + * * @param displayName the displayName value to set. * @return the LogSpecification object itself. */ @@ -74,7 +79,7 @@ public LogSpecification withDisplayName(String displayName) { /** * Get the blobDuration property: Blob duration of the log. - * + * * @return the blobDuration value. */ public String blobDuration() { @@ -83,7 +88,7 @@ public String blobDuration() { /** * Set the blobDuration property: Blob duration of the log. - * + * * @param blobDuration the blobDuration value to set. * @return the LogSpecification object itself. */ @@ -94,9 +99,51 @@ public LogSpecification withBlobDuration(String blobDuration) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogSpecification. + */ + public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSpecification deserializedLogSpecification = new LogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedLogSpecification.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogSpecification; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowPatchProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowPatchProperties.java index b2fe15817df3..6f4a89fe7c26 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowPatchProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowPatchProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Maintenance window starting hour and day of week. */ +/** + * Maintenance window starting hour and day of week. + */ @Fluent -public final class MaintenanceWindowPatchProperties { +public final class MaintenanceWindowPatchProperties implements JsonSerializable { /* * The update start hour of the day. (0 - 23) */ - @JsonProperty(value = "hour") private Integer hour; /* * Day of the week. */ - @JsonProperty(value = "dayOfWeek") private DayOfWeek dayOfWeek; - /** Creates an instance of MaintenanceWindowPatchProperties class. */ + /** + * Creates an instance of MaintenanceWindowPatchProperties class. + */ public MaintenanceWindowPatchProperties() { } /** * Get the hour property: The update start hour of the day. (0 - 23). - * + * * @return the hour value. */ public Integer hour() { @@ -37,7 +43,7 @@ public Integer hour() { /** * Set the hour property: The update start hour of the day. (0 - 23). - * + * * @param hour the hour value to set. * @return the MaintenanceWindowPatchProperties object itself. */ @@ -48,7 +54,7 @@ public MaintenanceWindowPatchProperties withHour(Integer hour) { /** * Get the dayOfWeek property: Day of the week. - * + * * @return the dayOfWeek value. */ public DayOfWeek dayOfWeek() { @@ -57,7 +63,7 @@ public DayOfWeek dayOfWeek() { /** * Set the dayOfWeek property: Day of the week. - * + * * @param dayOfWeek the dayOfWeek value to set. * @return the MaintenanceWindowPatchProperties object itself. */ @@ -68,9 +74,49 @@ public MaintenanceWindowPatchProperties withDayOfWeek(DayOfWeek dayOfWeek) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("hour", this.hour); + jsonWriter.writeStringField("dayOfWeek", this.dayOfWeek == null ? null : this.dayOfWeek.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceWindowPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceWindowPatchProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceWindowPatchProperties. + */ + public static MaintenanceWindowPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceWindowPatchProperties deserializedMaintenanceWindowPatchProperties + = new MaintenanceWindowPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hour".equals(fieldName)) { + deserializedMaintenanceWindowPatchProperties.hour = reader.getNullable(JsonReader::getInt); + } else if ("dayOfWeek".equals(fieldName)) { + deserializedMaintenanceWindowPatchProperties.dayOfWeek = DayOfWeek.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceWindowPatchProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowProperties.java index 6b9223fe4dab..ddd26d6388b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MaintenanceWindowProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Maintenance window starting hour and day of week. */ +/** + * Maintenance window starting hour and day of week. + */ @Fluent -public final class MaintenanceWindowProperties { +public final class MaintenanceWindowProperties implements JsonSerializable { /* * The update start hour of the day. (0 - 23) */ - @JsonProperty(value = "hour") private Integer hour; /* * Day of the week. */ - @JsonProperty(value = "dayOfWeek") private DayOfWeek dayOfWeek; - /** Creates an instance of MaintenanceWindowProperties class. */ + /** + * Creates an instance of MaintenanceWindowProperties class. + */ public MaintenanceWindowProperties() { } /** * Get the hour property: The update start hour of the day. (0 - 23). - * + * * @return the hour value. */ public Integer hour() { @@ -37,7 +43,7 @@ public Integer hour() { /** * Set the hour property: The update start hour of the day. (0 - 23). - * + * * @param hour the hour value to set. * @return the MaintenanceWindowProperties object itself. */ @@ -48,7 +54,7 @@ public MaintenanceWindowProperties withHour(Integer hour) { /** * Get the dayOfWeek property: Day of the week. - * + * * @return the dayOfWeek value. */ public DayOfWeek dayOfWeek() { @@ -57,7 +63,7 @@ public DayOfWeek dayOfWeek() { /** * Set the dayOfWeek property: Day of the week. - * + * * @param dayOfWeek the dayOfWeek value to set. * @return the MaintenanceWindowProperties object itself. */ @@ -68,9 +74,48 @@ public MaintenanceWindowProperties withDayOfWeek(DayOfWeek dayOfWeek) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("hour", this.hour); + jsonWriter.writeStringField("dayOfWeek", this.dayOfWeek == null ? null : this.dayOfWeek.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceWindowProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceWindowProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaintenanceWindowProperties. + */ + public static MaintenanceWindowProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceWindowProperties deserializedMaintenanceWindowProperties = new MaintenanceWindowProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hour".equals(fieldName)) { + deserializedMaintenanceWindowProperties.hour = reader.getNullable(JsonReader::getInt); + } else if ("dayOfWeek".equals(fieldName)) { + deserializedMaintenanceWindowProperties.dayOfWeek = DayOfWeek.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceWindowProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java index bc38ad3b1f9c..89e7251e10a7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImageUri.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Represents URI referring to MSIX Image. */ +/** + * Represents URI referring to MSIX Image. + */ @Fluent -public final class MsixImageUri { +public final class MsixImageUri implements JsonSerializable { /* * URI to Image */ - @JsonProperty(value = "uri") private String uri; - /** Creates an instance of MsixImageUri class. */ + /** + * Creates an instance of MsixImageUri class. + */ public MsixImageUri() { } /** * Get the uri property: URI to Image. - * + * * @return the uri value. */ public String uri() { @@ -31,7 +38,7 @@ public String uri() { /** * Set the uri property: URI to Image. - * + * * @param uri the uri value to set. * @return the MsixImageUri object itself. */ @@ -42,9 +49,45 @@ public MsixImageUri withUri(String uri) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixImageUri from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixImageUri if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MsixImageUri. + */ + public static MsixImageUri fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixImageUri deserializedMsixImageUri = new MsixImageUri(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uri".equals(fieldName)) { + deserializedMsixImageUri.uri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixImageUri; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java index 88b7bbafedb5..1ebc9780d610 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixImages.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of MsixImages. */ +/** + * Resource collection API of MsixImages. + */ public interface MsixImages { /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -24,7 +26,7 @@ public interface MsixImages { /** * Expands and Lists MSIX packages in an Image, given the Image Path. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixImageUri Object containing URI to MSIX Image. @@ -34,6 +36,6 @@ public interface MsixImages { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return expandMsixImageList as paginated response with {@link PagedIterable}. */ - PagedIterable expand( - String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, Context context); + PagedIterable expand(String resourceGroupName, String hostPoolName, MsixImageUri msixImageUri, + Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java index e86c10a6d0e5..b8747028e4ef 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackage.java @@ -10,46 +10,48 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of MsixPackage. */ +/** + * An immutable client-side representation of MsixPackage. + */ public interface MsixPackage { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the imagePath property: VHD/CIM image path on Network Share. - * + * * @return the imagePath value. */ String imagePath(); /** * Gets the packageName property: Package Name from appxmanifest.xml. - * + * * @return the packageName value. */ String packageName(); @@ -57,97 +59,105 @@ public interface MsixPackage { /** * Gets the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package Name and * Publisher name. - * + * * @return the packageFamilyName value. */ String packageFamilyName(); /** * Gets the displayName property: User friendly Name to be displayed in the portal. - * + * * @return the displayName value. */ String displayName(); /** * Gets the packageRelativePath property: Relative Path to the package inside the image. - * + * * @return the packageRelativePath value. */ String packageRelativePath(); /** * Gets the isRegularRegistration property: Specifies how to register Package in feed. - * + * * @return the isRegularRegistration value. */ Boolean isRegularRegistration(); /** * Gets the isActive property: Make this version of the package the active one across the hostpool. - * + * * @return the isActive value. */ Boolean isActive(); /** * Gets the packageDependencies property: List of package dependencies. - * + * * @return the packageDependencies value. */ List packageDependencies(); /** - * Gets the version property: Package Version found in the appxmanifest.xml. - * + * Gets the version property: Package version found in the appxmanifest.xml. + * * @return the version value. */ String version(); /** * Gets the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. - * + * * @return the lastUpdated value. */ OffsetDateTime lastUpdated(); /** * Gets the packageApplications property: List of package applications. - * + * * @return the packageApplications value. */ List packageApplications(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner object. - * + * * @return the inner object. */ MsixPackageInner innerModel(); - /** The entirety of the MsixPackage definition. */ + /** + * The entirety of the MsixPackage definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The MsixPackage definition stages. */ + /** + * The MsixPackage definition stages. + */ interface DefinitionStages { - /** The first stage of the MsixPackage definition. */ + /** + * The first stage of the MsixPackage definition. + */ interface Blank extends WithParentResource { } - /** The stage of the MsixPackage definition allowing to specify parent resource. */ + /** + * The stage of the MsixPackage definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, hostPoolName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @return the next definition stage. @@ -159,151 +169,166 @@ interface WithParentResource { * The stage of the MsixPackage definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithImagePath, - DefinitionStages.WithPackageName, - DefinitionStages.WithPackageFamilyName, - DefinitionStages.WithDisplayName, - DefinitionStages.WithPackageRelativePath, - DefinitionStages.WithIsRegularRegistration, - DefinitionStages.WithIsActive, - DefinitionStages.WithPackageDependencies, - DefinitionStages.WithVersion, - DefinitionStages.WithLastUpdated, - DefinitionStages.WithPackageApplications { + interface WithCreate extends DefinitionStages.WithImagePath, DefinitionStages.WithPackageName, + DefinitionStages.WithPackageFamilyName, DefinitionStages.WithDisplayName, + DefinitionStages.WithPackageRelativePath, DefinitionStages.WithIsRegularRegistration, + DefinitionStages.WithIsActive, DefinitionStages.WithPackageDependencies, DefinitionStages.WithVersion, + DefinitionStages.WithLastUpdated, DefinitionStages.WithPackageApplications { /** * Executes the create request. - * + * * @return the created resource. */ MsixPackage create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ MsixPackage create(Context context); } - /** The stage of the MsixPackage definition allowing to specify imagePath. */ + /** + * The stage of the MsixPackage definition allowing to specify imagePath. + */ interface WithImagePath { /** * Specifies the imagePath property: VHD/CIM image path on Network Share.. - * + * * @param imagePath VHD/CIM image path on Network Share. * @return the next definition stage. */ WithCreate withImagePath(String imagePath); } - /** The stage of the MsixPackage definition allowing to specify packageName. */ + /** + * The stage of the MsixPackage definition allowing to specify packageName. + */ interface WithPackageName { /** * Specifies the packageName property: Package Name from appxmanifest.xml. . - * + * * @param packageName Package Name from appxmanifest.xml. * @return the next definition stage. */ WithCreate withPackageName(String packageName); } - /** The stage of the MsixPackage definition allowing to specify packageFamilyName. */ + /** + * The stage of the MsixPackage definition allowing to specify packageFamilyName. + */ interface WithPackageFamilyName { /** * Specifies the packageFamilyName property: Package Family Name from appxmanifest.xml. Contains Package * Name and Publisher name. . - * + * * @param packageFamilyName Package Family Name from appxmanifest.xml. Contains Package Name and Publisher - * name. + * name. * @return the next definition stage. */ WithCreate withPackageFamilyName(String packageFamilyName); } - /** The stage of the MsixPackage definition allowing to specify displayName. */ + /** + * The stage of the MsixPackage definition allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: User friendly Name to be displayed in the portal. . - * + * * @param displayName User friendly Name to be displayed in the portal. * @return the next definition stage. */ WithCreate withDisplayName(String displayName); } - /** The stage of the MsixPackage definition allowing to specify packageRelativePath. */ + /** + * The stage of the MsixPackage definition allowing to specify packageRelativePath. + */ interface WithPackageRelativePath { /** * Specifies the packageRelativePath property: Relative Path to the package inside the image. . - * + * * @param packageRelativePath Relative Path to the package inside the image. * @return the next definition stage. */ WithCreate withPackageRelativePath(String packageRelativePath); } - /** The stage of the MsixPackage definition allowing to specify isRegularRegistration. */ + /** + * The stage of the MsixPackage definition allowing to specify isRegularRegistration. + */ interface WithIsRegularRegistration { /** * Specifies the isRegularRegistration property: Specifies how to register Package in feed.. - * + * * @param isRegularRegistration Specifies how to register Package in feed. * @return the next definition stage. */ WithCreate withIsRegularRegistration(Boolean isRegularRegistration); } - /** The stage of the MsixPackage definition allowing to specify isActive. */ + /** + * The stage of the MsixPackage definition allowing to specify isActive. + */ interface WithIsActive { /** * Specifies the isActive property: Make this version of the package the active one across the hostpool. . - * + * * @param isActive Make this version of the package the active one across the hostpool. * @return the next definition stage. */ WithCreate withIsActive(Boolean isActive); } - /** The stage of the MsixPackage definition allowing to specify packageDependencies. */ + /** + * The stage of the MsixPackage definition allowing to specify packageDependencies. + */ interface WithPackageDependencies { /** * Specifies the packageDependencies property: List of package dependencies. . - * + * * @param packageDependencies List of package dependencies. * @return the next definition stage. */ WithCreate withPackageDependencies(List packageDependencies); } - /** The stage of the MsixPackage definition allowing to specify version. */ + /** + * The stage of the MsixPackage definition allowing to specify version. + */ interface WithVersion { /** - * Specifies the version property: Package Version found in the appxmanifest.xml. . - * - * @param version Package Version found in the appxmanifest.xml. + * Specifies the version property: Package version found in the appxmanifest.xml. . + * + * @param version Package version found in the appxmanifest.xml. * @return the next definition stage. */ WithCreate withVersion(String version); } - /** The stage of the MsixPackage definition allowing to specify lastUpdated. */ + /** + * The stage of the MsixPackage definition allowing to specify lastUpdated. + */ interface WithLastUpdated { /** * Specifies the lastUpdated property: Date Package was last updated, found in the appxmanifest.xml. . - * + * * @param lastUpdated Date Package was last updated, found in the appxmanifest.xml. * @return the next definition stage. */ WithCreate withLastUpdated(OffsetDateTime lastUpdated); } - /** The stage of the MsixPackage definition allowing to specify packageApplications. */ + /** + * The stage of the MsixPackage definition allowing to specify packageApplications. + */ interface WithPackageApplications { /** * Specifies the packageApplications property: List of package applications. . - * + * * @param packageApplications List of package applications. * @return the next definition stage. */ @@ -313,59 +338,69 @@ interface WithPackageApplications { /** * Begins update for the MsixPackage resource. - * + * * @return the stage of resource update. */ MsixPackage.Update update(); - /** The template for MsixPackage update. */ + /** + * The template for MsixPackage update. + */ interface Update extends UpdateStages.WithIsActive, UpdateStages.WithIsRegularRegistration, UpdateStages.WithDisplayName { /** * Executes the update request. - * + * * @return the updated resource. */ MsixPackage apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ MsixPackage apply(Context context); } - /** The MsixPackage update stages. */ + /** + * The MsixPackage update stages. + */ interface UpdateStages { - /** The stage of the MsixPackage update allowing to specify isActive. */ + /** + * The stage of the MsixPackage update allowing to specify isActive. + */ interface WithIsActive { /** * Specifies the isActive property: Set a version of the package to be active across hostpool. . - * + * * @param isActive Set a version of the package to be active across hostpool. * @return the next definition stage. */ Update withIsActive(Boolean isActive); } - /** The stage of the MsixPackage update allowing to specify isRegularRegistration. */ + /** + * The stage of the MsixPackage update allowing to specify isRegularRegistration. + */ interface WithIsRegularRegistration { /** * Specifies the isRegularRegistration property: Set Registration mode. Regular or Delayed.. - * + * * @param isRegularRegistration Set Registration mode. Regular or Delayed. * @return the next definition stage. */ Update withIsRegularRegistration(Boolean isRegularRegistration); } - /** The stage of the MsixPackage update allowing to specify displayName. */ + /** + * The stage of the MsixPackage update allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: Display name for MSIX Package.. - * + * * @param displayName Display name for MSIX Package. * @return the next definition stage. */ @@ -375,14 +410,14 @@ interface WithDisplayName { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ MsixPackage refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java index fd29936acefe..f9a131e740fa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageApplications.java @@ -6,60 +6,61 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Schema for MSIX Package Application properties. */ +/** + * Schema for MSIX Package Application properties. + */ @Fluent -public final class MsixPackageApplications { +public final class MsixPackageApplications implements JsonSerializable { /* * Package Application Id, found in appxmanifest.xml. */ - @JsonProperty(value = "appId") private String appId; /* * Description of Package Application. */ - @JsonProperty(value = "description") private String description; /* * Used to activate Package Application. Consists of Package Name and ApplicationID. Found in appxmanifest.xml. */ - @JsonProperty(value = "appUserModelID") private String appUserModelId; /* * User friendly name. */ - @JsonProperty(value = "friendlyName") private String friendlyName; /* * User friendly name. */ - @JsonProperty(value = "iconImageName") private String iconImageName; /* * the icon a 64 bit string as a byte array. */ - @JsonProperty(value = "rawIcon") private byte[] rawIcon; /* * the icon a 64 bit string as a byte array. */ - @JsonProperty(value = "rawPng") private byte[] rawPng; - /** Creates an instance of MsixPackageApplications class. */ + /** + * Creates an instance of MsixPackageApplications class. + */ public MsixPackageApplications() { } /** * Get the appId property: Package Application Id, found in appxmanifest.xml. - * + * * @return the appId value. */ public String appId() { @@ -68,7 +69,7 @@ public String appId() { /** * Set the appId property: Package Application Id, found in appxmanifest.xml. - * + * * @param appId the appId value to set. * @return the MsixPackageApplications object itself. */ @@ -79,7 +80,7 @@ public MsixPackageApplications withAppId(String appId) { /** * Get the description property: Description of Package Application. - * + * * @return the description value. */ public String description() { @@ -88,7 +89,7 @@ public String description() { /** * Set the description property: Description of Package Application. - * + * * @param description the description value to set. * @return the MsixPackageApplications object itself. */ @@ -100,7 +101,7 @@ public MsixPackageApplications withDescription(String description) { /** * Get the appUserModelId property: Used to activate Package Application. Consists of Package Name and * ApplicationID. Found in appxmanifest.xml. - * + * * @return the appUserModelId value. */ public String appUserModelId() { @@ -110,7 +111,7 @@ public String appUserModelId() { /** * Set the appUserModelId property: Used to activate Package Application. Consists of Package Name and * ApplicationID. Found in appxmanifest.xml. - * + * * @param appUserModelId the appUserModelId value to set. * @return the MsixPackageApplications object itself. */ @@ -121,7 +122,7 @@ public MsixPackageApplications withAppUserModelId(String appUserModelId) { /** * Get the friendlyName property: User friendly name. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -130,7 +131,7 @@ public String friendlyName() { /** * Set the friendlyName property: User friendly name. - * + * * @param friendlyName the friendlyName value to set. * @return the MsixPackageApplications object itself. */ @@ -141,7 +142,7 @@ public MsixPackageApplications withFriendlyName(String friendlyName) { /** * Get the iconImageName property: User friendly name. - * + * * @return the iconImageName value. */ public String iconImageName() { @@ -150,7 +151,7 @@ public String iconImageName() { /** * Set the iconImageName property: User friendly name. - * + * * @param iconImageName the iconImageName value to set. * @return the MsixPackageApplications object itself. */ @@ -161,7 +162,7 @@ public MsixPackageApplications withIconImageName(String iconImageName) { /** * Get the rawIcon property: the icon a 64 bit string as a byte array. - * + * * @return the rawIcon value. */ public byte[] rawIcon() { @@ -170,7 +171,7 @@ public byte[] rawIcon() { /** * Set the rawIcon property: the icon a 64 bit string as a byte array. - * + * * @param rawIcon the rawIcon value to set. * @return the MsixPackageApplications object itself. */ @@ -181,7 +182,7 @@ public MsixPackageApplications withRawIcon(byte[] rawIcon) { /** * Get the rawPng property: the icon a 64 bit string as a byte array. - * + * * @return the rawPng value. */ public byte[] rawPng() { @@ -190,7 +191,7 @@ public byte[] rawPng() { /** * Set the rawPng property: the icon a 64 bit string as a byte array. - * + * * @param rawPng the rawPng value to set. * @return the MsixPackageApplications object itself. */ @@ -201,9 +202,63 @@ public MsixPackageApplications withRawPng(byte[] rawPng) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("appUserModelID", this.appUserModelId); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("iconImageName", this.iconImageName); + jsonWriter.writeBinaryField("rawIcon", this.rawIcon); + jsonWriter.writeBinaryField("rawPng", this.rawPng); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackageApplications from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackageApplications if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MsixPackageApplications. + */ + public static MsixPackageApplications fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackageApplications deserializedMsixPackageApplications = new MsixPackageApplications(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appId".equals(fieldName)) { + deserializedMsixPackageApplications.appId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedMsixPackageApplications.description = reader.getString(); + } else if ("appUserModelID".equals(fieldName)) { + deserializedMsixPackageApplications.appUserModelId = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedMsixPackageApplications.friendlyName = reader.getString(); + } else if ("iconImageName".equals(fieldName)) { + deserializedMsixPackageApplications.iconImageName = reader.getString(); + } else if ("rawIcon".equals(fieldName)) { + deserializedMsixPackageApplications.rawIcon = reader.getBinary(); + } else if ("rawPng".equals(fieldName)) { + deserializedMsixPackageApplications.rawPng = reader.getBinary(); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackageApplications; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java index 8947f3932601..8ca5b3da9a52 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageDependencies.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Schema for MSIX Package Dependencies properties. */ +/** + * Schema for MSIX Package Dependencies properties. + */ @Fluent -public final class MsixPackageDependencies { +public final class MsixPackageDependencies implements JsonSerializable { /* * Name of package dependency. */ - @JsonProperty(value = "dependencyName") private String dependencyName; /* * Name of dependency publisher. */ - @JsonProperty(value = "publisher") private String publisher; /* * Dependency version required. */ - @JsonProperty(value = "minVersion") private String minVersion; - /** Creates an instance of MsixPackageDependencies class. */ + /** + * Creates an instance of MsixPackageDependencies class. + */ public MsixPackageDependencies() { } /** * Get the dependencyName property: Name of package dependency. - * + * * @return the dependencyName value. */ public String dependencyName() { @@ -43,7 +48,7 @@ public String dependencyName() { /** * Set the dependencyName property: Name of package dependency. - * + * * @param dependencyName the dependencyName value to set. * @return the MsixPackageDependencies object itself. */ @@ -54,7 +59,7 @@ public MsixPackageDependencies withDependencyName(String dependencyName) { /** * Get the publisher property: Name of dependency publisher. - * + * * @return the publisher value. */ public String publisher() { @@ -63,7 +68,7 @@ public String publisher() { /** * Set the publisher property: Name of dependency publisher. - * + * * @param publisher the publisher value to set. * @return the MsixPackageDependencies object itself. */ @@ -74,7 +79,7 @@ public MsixPackageDependencies withPublisher(String publisher) { /** * Get the minVersion property: Dependency version required. - * + * * @return the minVersion value. */ public String minVersion() { @@ -83,7 +88,7 @@ public String minVersion() { /** * Set the minVersion property: Dependency version required. - * + * * @param minVersion the minVersion value to set. * @return the MsixPackageDependencies object itself. */ @@ -94,9 +99,51 @@ public MsixPackageDependencies withMinVersion(String minVersion) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dependencyName", this.dependencyName); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("minVersion", this.minVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackageDependencies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackageDependencies if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MsixPackageDependencies. + */ + public static MsixPackageDependencies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackageDependencies deserializedMsixPackageDependencies = new MsixPackageDependencies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dependencyName".equals(fieldName)) { + deserializedMsixPackageDependencies.dependencyName = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedMsixPackageDependencies.publisher = reader.getString(); + } else if ("minVersion".equals(fieldName)) { + deserializedMsixPackageDependencies.minVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackageDependencies; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java index 8cb5af5ada0e..ab50d938508c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackageList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * MsixPackageList - * - *

List of MSIX Package definitions. + * + * List of MSIX Package definitions. */ @Fluent -public final class MsixPackageList { +public final class MsixPackageList implements JsonSerializable { /* * List of MSIX Package 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; - /** Creates an instance of MsixPackageList class. */ + /** + * Creates an instance of MsixPackageList class. + */ public MsixPackageList() { } /** * Get the value property: List of MSIX Package definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of MSIX Package definitions. - * + * * @param value the value value to set. * @return the MsixPackageList object itself. */ @@ -54,7 +58,7 @@ public MsixPackageList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackageList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MsixPackageList. + */ + public static MsixPackageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackageList deserializedMsixPackageList = new MsixPackageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MsixPackageInner.fromJson(reader1)); + deserializedMsixPackageList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMsixPackageList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackageList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java index 46862b3d1d56..c4e8e7957a2f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackagePatch.java @@ -6,34 +6,100 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.MsixPackagePatchProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** MSIX Package properties that can be patched. */ +/** + * MSIX Package properties that can be patched. + */ @Fluent public final class MsixPackagePatch extends ProxyResource { /* * Detailed properties for MSIX Package */ - @JsonProperty(value = "properties") private MsixPackagePatchProperties innerProperties; - /** Creates an instance of MsixPackagePatch class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MsixPackagePatch class. + */ public MsixPackagePatch() { } /** * Get the innerProperties property: Detailed properties for MSIX Package. - * + * * @return the innerProperties value. */ private MsixPackagePatchProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the isActive property: Set a version of the package to be active across hostpool. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -42,7 +108,7 @@ public Boolean isActive() { /** * Set the isActive property: Set a version of the package to be active across hostpool. - * + * * @param isActive the isActive value to set. * @return the MsixPackagePatch object itself. */ @@ -56,7 +122,7 @@ public MsixPackagePatch withIsActive(Boolean isActive) { /** * Get the isRegularRegistration property: Set Registration mode. Regular or Delayed. - * + * * @return the isRegularRegistration value. */ public Boolean isRegularRegistration() { @@ -65,7 +131,7 @@ public Boolean isRegularRegistration() { /** * Set the isRegularRegistration property: Set Registration mode. Regular or Delayed. - * + * * @param isRegularRegistration the isRegularRegistration value to set. * @return the MsixPackagePatch object itself. */ @@ -79,7 +145,7 @@ public MsixPackagePatch withIsRegularRegistration(Boolean isRegularRegistration) /** * Get the displayName property: Display name for MSIX Package. - * + * * @return the displayName value. */ public String displayName() { @@ -88,7 +154,7 @@ public String displayName() { /** * Set the displayName property: Display name for MSIX Package. - * + * * @param displayName the displayName value to set. * @return the MsixPackagePatch object itself. */ @@ -102,7 +168,7 @@ public MsixPackagePatch withDisplayName(String displayName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -110,4 +176,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MsixPackagePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MsixPackagePatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MsixPackagePatch. + */ + public static MsixPackagePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MsixPackagePatch deserializedMsixPackagePatch = new MsixPackagePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMsixPackagePatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMsixPackagePatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMsixPackagePatch.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMsixPackagePatch.innerProperties = MsixPackagePatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMsixPackagePatch.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMsixPackagePatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java index e06a6c922485..4cce380cfb45 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/MsixPackages.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of MsixPackages. */ +/** + * Resource collection API of MsixPackages. + */ public interface MsixPackages { /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -22,12 +24,12 @@ public interface MsixPackages { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a msixpackage along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context); /** * Get a msixpackage. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -40,7 +42,7 @@ Response getWithResponse( /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -50,12 +52,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String msixPackageFullName, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String msixPackageFullName, + Context context); /** * Remove an MSIX Package. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param msixPackageFullName The version specific package full name of the MSIX package within specified hostpool. @@ -67,7 +69,7 @@ Response deleteWithResponse( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +81,7 @@ Response deleteWithResponse( /** * List MSIX packages in hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -91,17 +93,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return msixPackageList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * Get a msixpackage. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,7 +109,7 @@ PagedIterable list( /** * Get a msixpackage. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +121,7 @@ PagedIterable list( /** * Remove an MSIX Package. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,7 +131,7 @@ PagedIterable list( /** * Remove an MSIX Package. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,7 +143,7 @@ PagedIterable list( /** * Begins definition for a new MsixPackage resource. - * + * * @param name resource name. * @return the first stage of the new MsixPackage definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java index d7fa4eab2a5f..d4bfacf7d23e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/OperationProperties.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Properties of the operation. */ +/** + * Properties of the operation. + */ @Fluent -public final class OperationProperties { +public final class OperationProperties implements JsonSerializable { /* * Service specification payload */ - @JsonProperty(value = "serviceSpecification") private ServiceSpecification serviceSpecification; - /** Creates an instance of OperationProperties class. */ + /** + * Creates an instance of OperationProperties class. + */ public OperationProperties() { } /** * Get the serviceSpecification property: Service specification payload. - * + * * @return the serviceSpecification value. */ public ServiceSpecification serviceSpecification() { @@ -31,7 +38,7 @@ public ServiceSpecification serviceSpecification() { /** * Set the serviceSpecification property: Service specification payload. - * + * * @param serviceSpecification the serviceSpecification value to set. * @return the OperationProperties object itself. */ @@ -42,7 +49,7 @@ public OperationProperties withServiceSpecification(ServiceSpecification service /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { serviceSpecification().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java index 550ed4d98945..85aae6082c58 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Operations.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list operations as paginated response with {@link PagedIterable}. @@ -20,7 +22,7 @@ public interface Operations { /** * List all of the available operations the Desktop Virtualization resource provider supports. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java new file mode 100644 index 000000000000..2e42460e4d53 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PackageTimestamped.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Is package timestamped so it can ignore the certificate expiry date. + */ +public final class PackageTimestamped extends ExpandableStringEnum { + /** + * Static value Timestamped for PackageTimestamped. + */ + public static final PackageTimestamped TIMESTAMPED = fromString("Timestamped"); + + /** + * Static value NotTimestamped for PackageTimestamped. + */ + public static final PackageTimestamped NOT_TIMESTAMPED = fromString("NotTimestamped"); + + /** + * Creates a new instance of PackageTimestamped value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageTimestamped() { + } + + /** + * Creates or finds a PackageTimestamped from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageTimestamped. + */ + public static PackageTimestamped fromString(String name) { + return fromString(name, PackageTimestamped.class); + } + + /** + * Gets known PackageTimestamped values. + * + * @return known PackageTimestamped values. + */ + public static Collection values() { + return values(PackageTimestamped.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java index 6a55f93b23e8..2afe39a19ec3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PersonalDesktopAssignmentType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** PersonalDesktopAssignment type for HostPool. */ +/** + * PersonalDesktopAssignment type for HostPool. + */ public final class PersonalDesktopAssignmentType extends ExpandableStringEnum { - /** Static value Automatic for PersonalDesktopAssignmentType. */ + /** + * Static value Automatic for PersonalDesktopAssignmentType. + */ public static final PersonalDesktopAssignmentType AUTOMATIC = fromString("Automatic"); - /** Static value Direct for PersonalDesktopAssignmentType. */ + /** + * Static value Direct for PersonalDesktopAssignmentType. + */ public static final PersonalDesktopAssignmentType DIRECT = fromString("Direct"); /** * Creates a new instance of PersonalDesktopAssignmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public PersonalDesktopAssignmentType() { /** * 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); } /** * Gets known PersonalDesktopAssignmentType values. - * + * * @return known PersonalDesktopAssignmentType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java index 8de430f2313c..186476fb04f4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Plan.java @@ -6,49 +6,52 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Plan for the resource. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Plan for the resource. + */ @Fluent -public class Plan { +public class Plan implements JsonSerializable { /* * A user defined name of the 3rd Party Artifact that is being procured. */ - @JsonProperty(value = "name", required = true) private String name; /* * The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ - @JsonProperty(value = "publisher", required = true) private String publisher; /* * The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the * artifact at the time of Data Market onboarding. */ - @JsonProperty(value = "product", required = true) private String product; /* * A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ - @JsonProperty(value = "promotionCode") private String promotionCode; /* * The version of the desired product/artifact. */ - @JsonProperty(value = "version") private String version; - /** Creates an instance of Plan class. */ + /** + * Creates an instance of Plan class. + */ public Plan() { } /** * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. - * + * * @return the name value. */ public String name() { @@ -57,7 +60,7 @@ public String name() { /** * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. - * + * * @param name the name value to set. * @return the Plan object itself. */ @@ -68,7 +71,7 @@ public Plan withName(String name) { /** * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. - * + * * @return the publisher value. */ public String publisher() { @@ -77,7 +80,7 @@ public String publisher() { /** * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. - * + * * @param publisher the publisher value to set. * @return the Plan object itself. */ @@ -89,7 +92,7 @@ public Plan withPublisher(String publisher) { /** * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the * OfferID specified for the artifact at the time of Data Market onboarding. - * + * * @return the product value. */ public String product() { @@ -99,7 +102,7 @@ public String product() { /** * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the * OfferID specified for the artifact at the time of Data Market onboarding. - * + * * @param product the product value to set. * @return the Plan object itself. */ @@ -111,7 +114,7 @@ public Plan withProduct(String product) { /** * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said * product/artifact. - * + * * @return the promotionCode value. */ public String promotionCode() { @@ -121,7 +124,7 @@ public String promotionCode() { /** * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said * product/artifact. - * + * * @param promotionCode the promotionCode value to set. * @return the Plan object itself. */ @@ -132,7 +135,7 @@ public Plan withPromotionCode(String promotionCode) { /** * Get the version property: The version of the desired product/artifact. - * + * * @return the version value. */ public String version() { @@ -141,7 +144,7 @@ public String version() { /** * Set the version property: The version of the desired product/artifact. - * + * * @param version the version value to set. * @return the Plan object itself. */ @@ -152,23 +155,70 @@ public Plan withVersion(String version) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Plan")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Plan")); } if (publisher() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property publisher in model Plan")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property publisher in model Plan")); } if (product() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property product in model Plan")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property product in model Plan")); } } private static final ClientLogger LOGGER = new ClientLogger(Plan.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("product", this.product); + jsonWriter.writeStringField("promotionCode", this.promotionCode); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Plan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Plan if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Plan. + */ + public static Plan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Plan deserializedPlan = new Plan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPlan.name = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedPlan.publisher = reader.getString(); + } else if ("product".equals(fieldName)) { + deserializedPlan.product = reader.getString(); + } else if ("promotionCode".equals(fieldName)) { + deserializedPlan.promotionCode = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedPlan.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlan; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java index 1447964f5b14..124466af81c7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PreferredAppGroupType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of preferred application group type, default to Desktop Application Group. */ +/** + * The type of preferred application group type, default to Desktop Application Group. + */ public final class PreferredAppGroupType extends ExpandableStringEnum { - /** Static value None for PreferredAppGroupType. */ + /** + * Static value None for PreferredAppGroupType. + */ public static final PreferredAppGroupType NONE = fromString("None"); - /** Static value Desktop for PreferredAppGroupType. */ + /** + * Static value Desktop for PreferredAppGroupType. + */ public static final PreferredAppGroupType DESKTOP = fromString("Desktop"); - /** Static value RailApplications for PreferredAppGroupType. */ + /** + * Static value RailApplications for PreferredAppGroupType. + */ public static final PreferredAppGroupType RAIL_APPLICATIONS = fromString("RailApplications"); /** * Creates a new instance of PreferredAppGroupType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public PreferredAppGroupType() { /** * 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); } /** * Gets known PreferredAppGroupType values. - * + * * @return known PreferredAppGroupType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java index f05bf19fa1b7..c4987ad99041 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpoint.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The Private Endpoint resource. */ +/** + * The private endpoint resource. + */ @Immutable -public final class PrivateEndpoint { +public final class PrivateEndpoint implements JsonSerializable { /* - * The ARM identifier for Private Endpoint + * The ARM identifier for private endpoint. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of PrivateEndpoint class. */ + /** + * Creates an instance of PrivateEndpoint class. + */ public PrivateEndpoint() { } /** - * Get the id property: The ARM identifier for Private Endpoint. - * + * Get the id property: The ARM identifier for private endpoint. + * * @return the id value. */ public String id() { @@ -31,9 +38,44 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java index 40f1ca1cd7b7..40b8a7b0bdf3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnection.java @@ -6,25 +6,53 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; +import java.util.List; -/** The Private Endpoint Connection resource. */ +/** + * The private endpoint connection resource. + */ @Fluent public class PrivateEndpointConnection extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; - /** Creates an instance of PrivateEndpointConnection class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnection class. + */ public PrivateEndpointConnection() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { @@ -32,8 +60,78 @@ private PrivateEndpointConnectionProperties innerProperties() { } /** - * Get the privateEndpoint property: The resource of private end point. - * + * Set the innerProperties property: Resource properties. + * + * @param innerProperties the innerProperties value to set. + * @return the PrivateEndpointConnection object itself. + */ + PrivateEndpointConnection withInnerProperties(PrivateEndpointConnectionProperties innerProperties) { + this.innerProperties = innerProperties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the PrivateEndpointConnection object itself. + */ + PrivateEndpointConnection withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -41,8 +139,8 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The resource of private end point. - * + * Set the privateEndpoint property: The private endpoint resource. + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnection object itself. */ @@ -57,7 +155,7 @@ public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndp /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -67,12 +165,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnection object itself. */ - public PrivateEndpointConnection withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnection + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -82,7 +180,7 @@ public PrivateEndpointConnection withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -91,7 +189,7 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -99,4 +197,50 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnection. + */ + public static PrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnection deserializedPrivateEndpointConnection = new PrivateEndpointConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnection.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnection.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnection.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnection.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnection.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnection; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java index 482663f331fb..93861715e483 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionListResultWithSystemData.java @@ -5,32 +5,39 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of private endpoint connection associated with the specified storage account. */ +/** + * List of private endpoint connection associated with the specified storage account. + */ @Fluent -public final class PrivateEndpointConnectionListResultWithSystemData { +public final class PrivateEndpointConnectionListResultWithSystemData + implements JsonSerializable { /* * Array of private endpoint connections */ - @JsonProperty(value = "value") private List value; /* * Link to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of PrivateEndpointConnectionListResultWithSystemData class. */ + /** + * Creates an instance of PrivateEndpointConnectionListResultWithSystemData class. + */ public PrivateEndpointConnectionListResultWithSystemData() { } /** * Get the value property: Array of private endpoint connections. - * + * * @return the value value. */ public List value() { @@ -39,19 +46,19 @@ public List value() { /** * Set the value property: Array of private endpoint connections. - * + * * @param value the value value to set. * @return the PrivateEndpointConnectionListResultWithSystemData object itself. */ - public PrivateEndpointConnectionListResultWithSystemData withValue( - List value) { + public PrivateEndpointConnectionListResultWithSystemData + withValue(List value) { this.value = value; return this; } /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -68,4 +75,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResultWithSystemData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResultWithSystemData if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResultWithSystemData. + */ + public static PrivateEndpointConnectionListResultWithSystemData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResultWithSystemData deserializedPrivateEndpointConnectionListResultWithSystemData + = new PrivateEndpointConnectionListResultWithSystemData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionWithSystemDataInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResultWithSystemData.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResultWithSystemData.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResultWithSystemData; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java index 5df9c31ab572..33488bd3ae0c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionProvisioningState.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current provisioning state. */ +/** + * The current provisioning state. + */ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); /** * Creates a new instance of PrivateEndpointConnectionProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public PrivateEndpointConnectionProvisioningState() { /** * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionProvisioningState. */ - @JsonCreator public static PrivateEndpointConnectionProvisioningState fromString(String name) { return fromString(name, PrivateEndpointConnectionProvisioningState.class); } /** * Gets known PrivateEndpointConnectionProvisioningState values. - * + * * @return known PrivateEndpointConnectionProvisioningState values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java index 0ae6d5ef7e2e..eb50adcefc29 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnectionWithSystemData.java @@ -6,33 +6,50 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner; +import java.util.List; -/** An immutable client-side representation of PrivateEndpointConnectionWithSystemData. */ +/** + * An immutable client-side representation of PrivateEndpointConnectionWithSystemData. + */ public interface PrivateEndpointConnectionWithSystemData { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the privateEndpoint property: The resource of private end point. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. + * * @return the privateEndpoint value. */ PrivateEndpoint privateEndpoint(); @@ -40,30 +57,23 @@ public interface PrivateEndpointConnectionWithSystemData { /** * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the * connection between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); /** * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. - * + * * @return the provisioningState value. */ PrivateEndpointConnectionProvisioningState provisioningState(); - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * - * @return the systemData value. - */ - SystemData systemData(); - /** * Gets the inner * com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner * object. - * + * * @return the inner object. */ PrivateEndpointConnectionWithSystemDataInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java index e2fad3ebdb73..9089fca12c53 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointConnections.java @@ -8,25 +8,27 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of PrivateEndpointConnections. */ +/** + * Resource collection API of PrivateEndpointConnections. + */ public interface PrivateEndpointConnections { /** * List private endpoint connections. - * + * * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ - PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName); /** * List private endpoint connections. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -34,65 +36,65 @@ PagedIterable listByWorkspace( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ - PagedIterable listByWorkspace( - String resourceGroupName, String workspaceName, Context context); + PagedIterable listByWorkspace(String resourceGroupName, + String workspaceName, Context context); /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection along with {@link Response}. */ - Response getByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response getByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, Context context); /** * Get a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ - PrivateEndpointConnectionWithSystemData getByWorkspace( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemData getByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByWorkspaceWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + Response deleteByWorkspaceWithResponse(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, Context context); /** * Remove a connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -101,11 +103,11 @@ Response deleteByWorkspaceWithResponse( /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,49 +115,43 @@ Response deleteByWorkspaceWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response updateByWorkspaceWithResponse( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + Response updateByWorkspaceWithResponse(String resourceGroupName, + String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context); /** * Approve or reject a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - PrivateEndpointConnectionWithSystemData updateByWorkspace( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection); + PrivateEndpointConnectionWithSystemData updateByWorkspace(String resourceGroupName, String workspaceName, + String privateEndpointConnectionName, PrivateEndpointConnection connection); /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ - PagedIterable listByHostPool( - String resourceGroupName, String hostPoolName); + PagedIterable listByHostPool(String resourceGroupName, + String hostPoolName); /** * List private endpoint connections associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -166,70 +162,65 @@ PagedIterable listByHostPool( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connection associated with the specified storage account as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection along with {@link Response}. */ - Response getByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context); + Response getByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, Context context); /** * Get a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private endpoint connection. */ - PrivateEndpointConnectionWithSystemData getByHostPool( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName); + PrivateEndpointConnectionWithSystemData getByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName); /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByHostPoolWithResponse( - String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context); + Response deleteByHostPoolWithResponse(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, Context context); /** * Remove a connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -238,11 +229,11 @@ Response deleteByHostPoolWithResponse( /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -250,29 +241,23 @@ Response deleteByHostPoolWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource along with {@link Response}. */ - Response updateByHostPoolWithResponse( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection, + Response updateByHostPoolWithResponse(String resourceGroupName, + String hostPoolName, String privateEndpointConnectionName, PrivateEndpointConnection connection, Context context); /** * Approve or reject a private endpoint connection. - * + * * @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 privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. + * resource. * @param connection Object containing the updated connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - PrivateEndpointConnectionWithSystemData updateByHostPool( - String resourceGroupName, - String hostPoolName, - String privateEndpointConnectionName, - PrivateEndpointConnection connection); + PrivateEndpointConnectionWithSystemData updateByHostPool(String resourceGroupName, String hostPoolName, + String privateEndpointConnectionName, PrivateEndpointConnection connection); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java index 0dc90042b176..f5f95a6ea5df 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateEndpointServiceConnectionStatus.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The private endpoint connection status. */ +/** + * The private endpoint connection status. + */ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); /** * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public PrivateEndpointServiceConnectionStatus() { /** * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointServiceConnectionStatus. */ - @JsonCreator public static PrivateEndpointServiceConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointServiceConnectionStatus.class); } /** * Gets known PrivateEndpointServiceConnectionStatus values. - * + * * @return known PrivateEndpointServiceConnectionStatus values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java index 33100e2656b9..7244a9030ea3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResource.java @@ -4,56 +4,66 @@ package com.azure.resourcemanager.desktopvirtualization.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; import java.util.List; -/** An immutable client-side representation of PrivateLinkResource. */ +/** + * An immutable client-side representation of PrivateLinkResource. + */ public interface PrivateLinkResource { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the groupId property: The private link resource group id. - * + * * @return the groupId value. */ String groupId(); /** * Gets the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ List requiredMembers(); /** * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. - * + * * @return the requiredZoneNames value. */ List requiredZoneNames(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner object. - * + * * @return the inner object. */ PrivateLinkResourceInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java index 24165f968933..acfe449dc07e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResourceListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A list of private link resources. */ +/** + * A list of private link resources. + */ @Fluent -public final class PrivateLinkResourceListResult { +public final class PrivateLinkResourceListResult implements JsonSerializable { /* * Array of private link resources */ - @JsonProperty(value = "value") private List value; /* * Link to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of PrivateLinkResourceListResult class. */ + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ public PrivateLinkResourceListResult() { } /** * Get the value property: Array of private link resources. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: Array of private link resources. - * + * * @param value the value value to set. * @return the PrivateLinkResourceListResult object itself. */ @@ -50,7 +56,7 @@ public PrivateLinkResourceListResult withValue(List va /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -67,4 +73,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java index c80034b42a09..e76f746ceb9c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkResources.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of PrivateLinkResources. */ +/** + * Resource collection API of PrivateLinkResources. + */ public interface PrivateLinkResources { /** * List the private link resources available for this 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. @@ -23,7 +25,7 @@ public interface PrivateLinkResources { /** * List the private link resources available for this workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param pageSize Number of items per page. @@ -35,17 +37,12 @@ public interface PrivateLinkResources { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByWorkspace( - String resourceGroupName, - String workspaceName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,7 +54,7 @@ PagedIterable listByWorkspace( /** * List the private link resources available for this hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -69,11 +66,6 @@ PagedIterable listByWorkspace( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private link resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java index 8c448bf0dcdd..56f0a4d9d858 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PrivateLinkServiceConnectionState.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A collection of information about the state of the connection between service consumer and provider. */ +/** + * A collection of information about the state of the connection between service consumer and provider. + */ @Fluent -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; /* * The reason for approval/rejection of the connection. */ - @JsonProperty(value = "description") private String description; /* * A message indicating if changes on the service provider require any updates on the consumer. */ - @JsonProperty(value = "actionsRequired") private String actionsRequired; - /** Creates an instance of PrivateLinkServiceConnectionState class. */ + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ public PrivateLinkServiceConnectionState() { } /** * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -45,7 +50,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. - * + * * @param status the status value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -56,7 +61,7 @@ public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnec /** * Get the description property: The reason for approval/rejection of the connection. - * + * * @return the description value. */ public String description() { @@ -65,7 +70,7 @@ public String description() { /** * Set the description property: The reason for approval/rejection of the connection. - * + * * @param description the description value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -77,7 +82,7 @@ public PrivateLinkServiceConnectionState withDescription(String description) { /** * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @return the actionsRequired value. */ public String actionsRequired() { @@ -87,7 +92,7 @@ public String actionsRequired() { /** * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @param actionsRequired the actionsRequired value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -98,9 +103,53 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java new file mode 100644 index 000000000000..760c92bc42cc --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java index 40edec9b3e16..f7ad10939287 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/PublicNetworkAccess.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * only be accessed via private endpoints. */ public final class PublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccess. */ + /** + * Static value Enabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for PublicNetworkAccess. */ + /** + * Static value Disabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); /** * Creates a new instance of PublicNetworkAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +33,17 @@ public PublicNetworkAccess() { /** * Creates or finds a PublicNetworkAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ - @JsonCreator public static PublicNetworkAccess fromString(String name) { return fromString(name, PublicNetworkAccess.class); } /** * Gets known PublicNetworkAccess values. - * + * * @return known PublicNetworkAccess values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java index 7293faf50f09..b89d4ebb1ccd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfo.java @@ -7,32 +7,34 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of RegistrationInfo. */ +/** + * An immutable client-side representation of RegistrationInfo. + */ public interface RegistrationInfo { /** * Gets the expirationTime property: Expiration time of registration token. - * + * * @return the expirationTime value. */ OffsetDateTime expirationTime(); /** * Gets the token property: The registration token base64 encoded string. - * + * * @return the token value. */ String token(); /** * Gets the registrationTokenOperation property: The type of resetting the token. - * + * * @return the registrationTokenOperation value. */ RegistrationTokenOperation registrationTokenOperation(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationInfoInner object. - * + * * @return the inner object. */ RegistrationInfoInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java index 6c2a45bfd2b5..62437ac69794 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationInfoPatch.java @@ -5,31 +5,39 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; -/** Represents a RegistrationInfo definition. */ +/** + * Represents a RegistrationInfo definition. + */ @Fluent -public final class RegistrationInfoPatch { +public final class RegistrationInfoPatch implements JsonSerializable { /* * Expiration time of registration token. */ - @JsonProperty(value = "expirationTime") private OffsetDateTime expirationTime; /* * The type of resetting the token. */ - @JsonProperty(value = "registrationTokenOperation") private RegistrationTokenOperation registrationTokenOperation; - /** Creates an instance of RegistrationInfoPatch class. */ + /** + * Creates an instance of RegistrationInfoPatch class. + */ public RegistrationInfoPatch() { } /** * Get the expirationTime property: Expiration time of registration token. - * + * * @return the expirationTime value. */ public OffsetDateTime expirationTime() { @@ -38,7 +46,7 @@ public OffsetDateTime expirationTime() { /** * Set the expirationTime property: Expiration time of registration token. - * + * * @param expirationTime the expirationTime value to set. * @return the RegistrationInfoPatch object itself. */ @@ -49,7 +57,7 @@ public RegistrationInfoPatch withExpirationTime(OffsetDateTime expirationTime) { /** * Get the registrationTokenOperation property: The type of resetting the token. - * + * * @return the registrationTokenOperation value. */ public RegistrationTokenOperation registrationTokenOperation() { @@ -58,7 +66,7 @@ public RegistrationTokenOperation registrationTokenOperation() { /** * Set the registrationTokenOperation property: The type of resetting the token. - * + * * @param registrationTokenOperation the registrationTokenOperation value to set. * @return the RegistrationInfoPatch object itself. */ @@ -69,9 +77,52 @@ public RegistrationInfoPatch withRegistrationTokenOperation(RegistrationTokenOpe /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expirationTime", + this.expirationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTime)); + jsonWriter.writeStringField("registrationTokenOperation", + this.registrationTokenOperation == null ? null : this.registrationTokenOperation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistrationInfoPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistrationInfoPatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistrationInfoPatch. + */ + public static RegistrationInfoPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistrationInfoPatch deserializedRegistrationInfoPatch = new RegistrationInfoPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirationTime".equals(fieldName)) { + deserializedRegistrationInfoPatch.expirationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("registrationTokenOperation".equals(fieldName)) { + deserializedRegistrationInfoPatch.registrationTokenOperation + = RegistrationTokenOperation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistrationInfoPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java new file mode 100644 index 000000000000..e5400f51275e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenList.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner; +import java.util.List; + +/** + * An immutable client-side representation of RegistrationTokenList. + */ +public interface RegistrationTokenList { + /** + * Gets the value property: List of RegistrationToken definitions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.RegistrationTokenListInner object. + * + * @return the inner object. + */ + RegistrationTokenListInner innerModel(); +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java new file mode 100644 index 000000000000..447cd1c8fe76 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenMinimal.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a Minimal set of properties for RegistrationToken definition. + */ +@Fluent +public final class RegistrationTokenMinimal implements JsonSerializable { + /* + * Expiration time of registration token. + */ + private OffsetDateTime expirationTime; + + /* + * The registration token base64 encoded string. + */ + private String token; + + /** + * Creates an instance of RegistrationTokenMinimal class. + */ + public RegistrationTokenMinimal() { + } + + /** + * Get the expirationTime property: Expiration time of registration token. + * + * @return the expirationTime value. + */ + public OffsetDateTime expirationTime() { + return this.expirationTime; + } + + /** + * Set the expirationTime property: Expiration time of registration token. + * + * @param expirationTime the expirationTime value to set. + * @return the RegistrationTokenMinimal object itself. + */ + public RegistrationTokenMinimal withExpirationTime(OffsetDateTime expirationTime) { + this.expirationTime = expirationTime; + return this; + } + + /** + * Get the token property: The registration token base64 encoded string. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: The registration token base64 encoded string. + * + * @param token the token value to set. + * @return the RegistrationTokenMinimal object itself. + */ + public RegistrationTokenMinimal withToken(String token) { + this.token = token; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expirationTime", + this.expirationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTime)); + jsonWriter.writeStringField("token", this.token); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistrationTokenMinimal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistrationTokenMinimal if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistrationTokenMinimal. + */ + public static RegistrationTokenMinimal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistrationTokenMinimal deserializedRegistrationTokenMinimal = new RegistrationTokenMinimal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expirationTime".equals(fieldName)) { + deserializedRegistrationTokenMinimal.expirationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("token".equals(fieldName)) { + deserializedRegistrationTokenMinimal.token = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistrationTokenMinimal; + }); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java index 507fa91aa452..1d35a425b3e0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RegistrationTokenOperation.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of resetting the token. */ +/** + * The type of resetting the token. + */ public final class RegistrationTokenOperation extends ExpandableStringEnum { - /** Static value Delete for RegistrationTokenOperation. */ + /** + * Static value Delete for RegistrationTokenOperation. + */ public static final RegistrationTokenOperation DELETE = fromString("Delete"); - /** Static value None for RegistrationTokenOperation. */ + /** + * Static value None for RegistrationTokenOperation. + */ public static final RegistrationTokenOperation NONE = fromString("None"); - /** Static value Update for RegistrationTokenOperation. */ + /** + * Static value Update for RegistrationTokenOperation. + */ public static final RegistrationTokenOperation UPDATE = fromString("Update"); /** * Creates a new instance of RegistrationTokenOperation value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public RegistrationTokenOperation() { /** * 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); } /** * Gets known RegistrationTokenOperation values. - * + * * @return known RegistrationTokenOperation values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java index 28593bb36ea0..7d152191e6e1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/RemoteApplicationType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Resource Type of Application. */ +/** + * Resource Type of Application. + */ public final class RemoteApplicationType extends ExpandableStringEnum { - /** Static value InBuilt for RemoteApplicationType. */ + /** + * Static value InBuilt for RemoteApplicationType. + */ public static final RemoteApplicationType IN_BUILT = fromString("InBuilt"); - /** Static value MsixApplication for RemoteApplicationType. */ + /** + * Static value MsixApplication for RemoteApplicationType. + */ public static final RemoteApplicationType MSIX_APPLICATION = fromString("MsixApplication"); /** * Creates a new instance of RemoteApplicationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public RemoteApplicationType() { /** * Creates or finds a RemoteApplicationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding RemoteApplicationType. */ - @JsonCreator public static RemoteApplicationType fromString(String name) { return fromString(name, RemoteApplicationType.class); } /** * Gets known RemoteApplicationType values. - * + * * @return known RemoteApplicationType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java index 8254c935fc57..dff980ba0041 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceIdentityType.java @@ -4,15 +4,18 @@ package com.azure.resourcemanager.desktopvirtualization.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The identity type. */ +/** + * The identity type. + */ public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ + /** + * Enum value SystemAssigned. + */ SYSTEM_ASSIGNED("SystemAssigned"); - /** The actual serialized value for a ResourceIdentityType instance. */ + /** + * The actual serialized value for a ResourceIdentityType instance. + */ private final String value; ResourceIdentityType(String value) { @@ -21,11 +24,10 @@ public enum ResourceIdentityType { /** * Parses a serialized value to a ResourceIdentityType instance. - * + * * @param value the serialized value to parse. * @return the parsed ResourceIdentityType object, or null if unable to parse. */ - @JsonCreator public static ResourceIdentityType fromString(String value) { if (value == null) { return null; @@ -39,8 +41,9 @@ public static ResourceIdentityType fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java index f9d419cfd776..9aedb9b65aec 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySet.java @@ -6,7 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -16,49 +20,65 @@ @Fluent public class ResourceModelWithAllowedPropertySet extends Resource { /* - * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is - * managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if - * it is removed from the template since it is managed by another resource. + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed + * by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is + * removed from the template since it is managed by another resource. */ - @JsonProperty(value = "managedBy") private String managedBy; /* - * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. - * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist * this value. */ - @JsonProperty(value = "kind") private String kind; /* * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header - * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested - * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match - * (section 14.26), and If-Range (section 14.27) header fields. + * per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested + * resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section + * 14.26), and If-Range (section 14.27) header fields. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* * The identity property. */ - @JsonProperty(value = "identity") private ResourceModelWithAllowedPropertySetIdentity identity; /* * The sku property. */ - @JsonProperty(value = "sku") private ResourceModelWithAllowedPropertySetSku sku; /* * The plan property. */ - @JsonProperty(value = "plan") private ResourceModelWithAllowedPropertySetPlan plan; - /** Creates an instance of ResourceModelWithAllowedPropertySet class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ResourceModelWithAllowedPropertySet class. + */ public ResourceModelWithAllowedPropertySet() { } @@ -66,7 +86,7 @@ public ResourceModelWithAllowedPropertySet() { * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not * delete the resource if it is removed from the template since it is managed by another resource. - * + * * @return the managedBy value. */ public String managedBy() { @@ -77,7 +97,7 @@ public String managedBy() { * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not * delete the resource if it is removed from the template since it is managed by another resource. - * + * * @param managedBy the managedBy value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ @@ -88,9 +108,9 @@ public ResourceModelWithAllowedPropertySet withManagedBy(String managedBy) { /** * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ public String kind() { @@ -99,9 +119,9 @@ public String kind() { /** * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @param kind the kind value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ @@ -115,16 +135,30 @@ public ResourceModelWithAllowedPropertySet withKind(String kind) { * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * + * * @return the etag value. */ public String etag() { return this.etag; } + /** + * Set the etag property: The etag field is *not* required. If it is provided in the response body, it must also be + * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from + * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), + * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * + * @param etag the etag value to set. + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + ResourceModelWithAllowedPropertySet withEtag(String etag) { + this.etag = etag; + return this; + } + /** * Get the identity property: The identity property. - * + * * @return the identity value. */ public ResourceModelWithAllowedPropertySetIdentity identity() { @@ -133,7 +167,7 @@ public ResourceModelWithAllowedPropertySetIdentity identity() { /** * Set the identity property: The identity property. - * + * * @param identity the identity value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ @@ -144,7 +178,7 @@ public ResourceModelWithAllowedPropertySet withIdentity(ResourceModelWithAllowed /** * Get the sku property: The sku property. - * + * * @return the sku value. */ public ResourceModelWithAllowedPropertySetSku sku() { @@ -153,7 +187,7 @@ public ResourceModelWithAllowedPropertySetSku sku() { /** * Set the sku property: The sku property. - * + * * @param sku the sku value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ @@ -164,7 +198,7 @@ public ResourceModelWithAllowedPropertySet withSku(ResourceModelWithAllowedPrope /** * Get the plan property: The plan property. - * + * * @return the plan value. */ public ResourceModelWithAllowedPropertySetPlan plan() { @@ -173,7 +207,7 @@ public ResourceModelWithAllowedPropertySetPlan plan() { /** * Set the plan property: The plan property. - * + * * @param plan the plan value to set. * @return the ResourceModelWithAllowedPropertySet object itself. */ @@ -182,14 +216,68 @@ public ResourceModelWithAllowedPropertySet withPlan(ResourceModelWithAllowedProp return this; } - /** {@inheritDoc} */ + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the ResourceModelWithAllowedPropertySet object itself. + */ + ResourceModelWithAllowedPropertySet withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySet withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySet withTags(Map tags) { super.withTags(tags); @@ -198,7 +286,7 @@ public ResourceModelWithAllowedPropertySet withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -212,4 +300,74 @@ public void validate() { plan().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("managedBy", this.managedBy); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("plan", this.plan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceModelWithAllowedPropertySet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceModelWithAllowedPropertySet if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceModelWithAllowedPropertySet. + */ + public static ResourceModelWithAllowedPropertySet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceModelWithAllowedPropertySet deserializedResourceModelWithAllowedPropertySet + = new ResourceModelWithAllowedPropertySet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedResourceModelWithAllowedPropertySet.withTags(tags); + } else if ("managedBy".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.managedBy = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.kind = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.identity + = ResourceModelWithAllowedPropertySetIdentity.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.sku + = ResourceModelWithAllowedPropertySetSku.fromJson(reader); + } else if ("plan".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.plan + = ResourceModelWithAllowedPropertySetPlan.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySet.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceModelWithAllowedPropertySet; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java index d85ff3215a1d..1bca18c927f7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetIdentity.java @@ -5,15 +5,56 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; -/** The ResourceModelWithAllowedPropertySetIdentity model. */ +/** + * The ResourceModelWithAllowedPropertySetIdentity model. + */ @Fluent public final class ResourceModelWithAllowedPropertySetIdentity extends Identity { - /** Creates an instance of ResourceModelWithAllowedPropertySetIdentity class. */ + /* + * The tenant ID of resource. The value must be an UUID. + */ + private UUID tenantId; + + /* + * The principal ID of resource identity. The value must be an UUID. + */ + private UUID principalId; + + /** + * Creates an instance of ResourceModelWithAllowedPropertySetIdentity class. + */ public ResourceModelWithAllowedPropertySetIdentity() { } - /** {@inheritDoc} */ + /** + * Get the tenantId property: The tenant ID of resource. The value must be an UUID. + * + * @return the tenantId value. + */ + @Override + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the principalId property: The principal ID of resource identity. The value must be an UUID. + * + * @return the principalId value. + */ + @Override + public UUID principalId() { + return this.principalId; + } + + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetIdentity withType(ResourceIdentityType type) { super.withType(type); @@ -22,11 +63,54 @@ public ResourceModelWithAllowedPropertySetIdentity withType(ResourceIdentityType /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceModelWithAllowedPropertySetIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceModelWithAllowedPropertySetIdentity if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceModelWithAllowedPropertySetIdentity. + */ + public static ResourceModelWithAllowedPropertySetIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceModelWithAllowedPropertySetIdentity deserializedResourceModelWithAllowedPropertySetIdentity + = new ResourceModelWithAllowedPropertySetIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetIdentity + .withType(ResourceIdentityType.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceModelWithAllowedPropertySetIdentity; + }); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java index 5d11137579bd..730de7e2e1c1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetPlan.java @@ -5,43 +5,62 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ResourceModelWithAllowedPropertySetPlan model. */ +/** + * The ResourceModelWithAllowedPropertySetPlan model. + */ @Fluent public final class ResourceModelWithAllowedPropertySetPlan extends Plan { - /** Creates an instance of ResourceModelWithAllowedPropertySetPlan class. */ + /** + * Creates an instance of ResourceModelWithAllowedPropertySetPlan class. + */ public ResourceModelWithAllowedPropertySetPlan() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetPlan withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetPlan withPublisher(String publisher) { super.withPublisher(publisher); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetPlan withProduct(String product) { super.withProduct(product); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetPlan withPromotionCode(String promotionCode) { super.withPromotionCode(promotionCode); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetPlan withVersion(String version) { super.withVersion(version); @@ -50,11 +69,77 @@ public ResourceModelWithAllowedPropertySetPlan withVersion(String version) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ResourceModelWithAllowedPropertySetPlan")); + } + if (publisher() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisher in model ResourceModelWithAllowedPropertySetPlan")); + } + if (product() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property product in model ResourceModelWithAllowedPropertySetPlan")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceModelWithAllowedPropertySetPlan.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("publisher", publisher()); + jsonWriter.writeStringField("product", product()); + jsonWriter.writeStringField("promotionCode", promotionCode()); + jsonWriter.writeStringField("version", version()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceModelWithAllowedPropertySetPlan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceModelWithAllowedPropertySetPlan if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceModelWithAllowedPropertySetPlan. + */ + public static ResourceModelWithAllowedPropertySetPlan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceModelWithAllowedPropertySetPlan deserializedResourceModelWithAllowedPropertySetPlan + = new ResourceModelWithAllowedPropertySetPlan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetPlan.withName(reader.getString()); + } else if ("publisher".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetPlan.withPublisher(reader.getString()); + } else if ("product".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetPlan.withProduct(reader.getString()); + } else if ("promotionCode".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetPlan.withPromotionCode(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetPlan.withVersion(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceModelWithAllowedPropertySetPlan; + }); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java index 2ec2cc8ec542..89db30dd82de 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceModelWithAllowedPropertySetSku.java @@ -5,43 +5,62 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The ResourceModelWithAllowedPropertySetSku model. */ +/** + * The ResourceModelWithAllowedPropertySetSku model. + */ @Fluent public final class ResourceModelWithAllowedPropertySetSku extends Sku { - /** Creates an instance of ResourceModelWithAllowedPropertySetSku class. */ + /** + * Creates an instance of ResourceModelWithAllowedPropertySetSku class. + */ public ResourceModelWithAllowedPropertySetSku() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetSku withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetSku withTier(SkuTier tier) { super.withTier(tier); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetSku withSize(String size) { super.withSize(size); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetSku withFamily(String family) { super.withFamily(family); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResourceModelWithAllowedPropertySetSku withCapacity(Integer capacity) { super.withCapacity(capacity); @@ -50,11 +69,68 @@ public ResourceModelWithAllowedPropertySetSku withCapacity(Integer capacity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { - super.validate(); + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ResourceModelWithAllowedPropertySetSku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceModelWithAllowedPropertySetSku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("tier", tier() == null ? null : tier().toString()); + jsonWriter.writeStringField("size", size()); + jsonWriter.writeStringField("family", family()); + jsonWriter.writeNumberField("capacity", capacity()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceModelWithAllowedPropertySetSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceModelWithAllowedPropertySetSku if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceModelWithAllowedPropertySetSku. + */ + public static ResourceModelWithAllowedPropertySetSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceModelWithAllowedPropertySetSku deserializedResourceModelWithAllowedPropertySetSku + = new ResourceModelWithAllowedPropertySetSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetSku.withName(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetSku.withTier(SkuTier.fromString(reader.getString())); + } else if ("size".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetSku.withSize(reader.getString()); + } else if ("family".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetSku.withFamily(reader.getString()); + } else if ("capacity".equals(fieldName)) { + deserializedResourceModelWithAllowedPropertySetSku + .withCapacity(reader.getNullable(JsonReader::getInt)); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceModelWithAllowedPropertySetSku; + }); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java index 09d857577d90..1b40ef2ba3da 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperation.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; -/** An immutable client-side representation of ResourceProviderOperation. */ +/** + * An immutable client-side representation of ResourceProviderOperation. + */ public interface ResourceProviderOperation { /** * Gets the name property: Operation name, in format of {provider}/{resource}/{operation}. - * + * * @return the name value. */ String name(); /** * Gets the display property: Display metadata associated with the operation. - * + * * @return the display value. */ ResourceProviderOperationDisplay display(); /** * Gets the isDataAction property: Is a data action. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the properties property: Properties of the operation. - * + * * @return the properties value. */ OperationProperties properties(); @@ -39,7 +41,7 @@ public interface ResourceProviderOperation { /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner * object. - * + * * @return the inner object. */ ResourceProviderOperationInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java index 560241227dcd..c8cdb5eb938f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationDisplay.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Display metadata associated with the operation. + */ @Fluent -public final class ResourceProviderOperationDisplay { +public final class ResourceProviderOperationDisplay implements JsonSerializable { /* * 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; - /** Creates an instance of ResourceProviderOperationDisplay class. */ + /** + * Creates an instance of ResourceProviderOperationDisplay class. + */ public ResourceProviderOperationDisplay() { } /** * Get the provider property: Resource provider: Microsoft Desktop Virtualization. - * + * * @return the provider value. */ public String provider() { @@ -49,7 +53,7 @@ public String provider() { /** * Set the provider property: Resource provider: Microsoft Desktop Virtualization. - * + * * @param provider the provider value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -60,7 +64,7 @@ public ResourceProviderOperationDisplay withProvider(String provider) { /** * Get the resource property: Resource on which the operation is performed. - * + * * @return the resource value. */ public String resource() { @@ -69,7 +73,7 @@ public String resource() { /** * Set the resource property: Resource on which the operation is performed. - * + * * @param resource the resource value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -80,7 +84,7 @@ public ResourceProviderOperationDisplay withResource(String resource) { /** * Get the operation property: Type of operation: get, read, delete, etc. - * + * * @return the operation value. */ public String operation() { @@ -89,7 +93,7 @@ public String operation() { /** * Set the operation property: Type of operation: get, read, delete, etc. - * + * * @param operation the operation value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -100,7 +104,7 @@ public ResourceProviderOperationDisplay withOperation(String operation) { /** * Get the description property: Description of this operation. - * + * * @return the description value. */ public String description() { @@ -109,7 +113,7 @@ public String description() { /** * Set the description property: Description of this operation. - * + * * @param description the description value to set. * @return the ResourceProviderOperationDisplay object itself. */ @@ -120,9 +124,55 @@ public ResourceProviderOperationDisplay withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProviderOperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProviderOperationDisplay if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceProviderOperationDisplay. + */ + public static ResourceProviderOperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProviderOperationDisplay deserializedResourceProviderOperationDisplay + = new ResourceProviderOperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedResourceProviderOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedResourceProviderOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedResourceProviderOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedResourceProviderOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProviderOperationDisplay; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationList.java index bdca1b7e5ebb..023b8106aa55 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ResourceProviderOperationList.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** Result of the request to list operations. */ +/** + * Result of the request to list operations. + */ @Fluent -public final class ResourceProviderOperationList { +public final class ResourceProviderOperationList implements JsonSerializable { /* * List of operations supported by this resource provider. */ - @JsonProperty(value = "value") private List value; /* * Link to the next page of results. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ResourceProviderOperationList class. */ + /** + * Creates an instance of ResourceProviderOperationList class. + */ public ResourceProviderOperationList() { } /** * Get the value property: List of operations supported by this resource provider. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: List of operations supported by this resource provider. - * + * * @param value the value value to set. * @return the ResourceProviderOperationList object itself. */ @@ -50,7 +56,7 @@ public ResourceProviderOperationList withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProviderOperationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProviderOperationList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceProviderOperationList. + */ + public static ResourceProviderOperationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProviderOperationList deserializedResourceProviderOperationList + = new ResourceProviderOperationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ResourceProviderOperationInner.fromJson(reader1)); + deserializedResourceProviderOperationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedResourceProviderOperationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProviderOperationList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java index a30a6af5a87d..434efa40134c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolReference.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Scaling plan reference to hostpool. */ +/** + * Scaling plan reference to hostpool. + */ @Fluent -public final class ScalingHostPoolReference { +public final class ScalingHostPoolReference implements JsonSerializable { /* * Arm path of referenced hostpool. */ - @JsonProperty(value = "hostPoolArmPath") private String hostPoolArmPath; /* * Is the scaling plan enabled for this hostpool. */ - @JsonProperty(value = "scalingPlanEnabled") private Boolean scalingPlanEnabled; - /** Creates an instance of ScalingHostPoolReference class. */ + /** + * Creates an instance of ScalingHostPoolReference class. + */ public ScalingHostPoolReference() { } /** * Get the hostPoolArmPath property: Arm path of referenced hostpool. - * + * * @return the hostPoolArmPath value. */ public String hostPoolArmPath() { @@ -37,7 +43,7 @@ public String hostPoolArmPath() { /** * Set the hostPoolArmPath property: Arm path of referenced hostpool. - * + * * @param hostPoolArmPath the hostPoolArmPath value to set. * @return the ScalingHostPoolReference object itself. */ @@ -48,7 +54,7 @@ public ScalingHostPoolReference withHostPoolArmPath(String hostPoolArmPath) { /** * Get the scalingPlanEnabled property: Is the scaling plan enabled for this hostpool. - * + * * @return the scalingPlanEnabled value. */ public Boolean scalingPlanEnabled() { @@ -57,7 +63,7 @@ public Boolean scalingPlanEnabled() { /** * Set the scalingPlanEnabled property: Is the scaling plan enabled for this hostpool. - * + * * @param scalingPlanEnabled the scalingPlanEnabled value to set. * @return the ScalingHostPoolReference object itself. */ @@ -68,9 +74,49 @@ public ScalingHostPoolReference withScalingPlanEnabled(Boolean scalingPlanEnable /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostPoolArmPath", this.hostPoolArmPath); + jsonWriter.writeBooleanField("scalingPlanEnabled", this.scalingPlanEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingHostPoolReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingHostPoolReference if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingHostPoolReference. + */ + public static ScalingHostPoolReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingHostPoolReference deserializedScalingHostPoolReference = new ScalingHostPoolReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostPoolArmPath".equals(fieldName)) { + deserializedScalingHostPoolReference.hostPoolArmPath = reader.getString(); + } else if ("scalingPlanEnabled".equals(fieldName)) { + deserializedScalingHostPoolReference.scalingPlanEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingHostPoolReference; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java index ebeb2bfaeef5..a0adf00e37b5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingHostPoolType.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** HostPool type for desktop. */ +/** + * HostPool type for desktop. + */ public final class ScalingHostPoolType extends ExpandableStringEnum { - /** Static value Pooled for ScalingHostPoolType. */ + /** + * Static value Pooled for ScalingHostPoolType. + */ public static final ScalingHostPoolType POOLED = fromString("Pooled"); /** * Creates a new instance of ScalingHostPoolType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ScalingHostPoolType() { /** * Creates or finds a ScalingHostPoolType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScalingHostPoolType. */ - @JsonCreator public static ScalingHostPoolType fromString(String name) { return fromString(name, ScalingHostPoolType.class); } /** * Gets known ScalingHostPoolType values. - * + * * @return known ScalingHostPoolType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java index 8077031ca64a..1c7e1041fdfc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlan.java @@ -11,39 +11,41 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of ScalingPlan. */ +/** + * An immutable client-side representation of ScalingPlan. + */ public interface ScalingPlan { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -52,16 +54,16 @@ public interface ScalingPlan { * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment * will not delete the resource if it is removed from the template since it is managed by another resource. - * + * * @return the managedBy value. */ String managedBy(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ String kind(); @@ -71,143 +73,147 @@ public interface ScalingPlan { * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * + * * @return the etag value. */ String etag(); /** * Gets the identity property: The identity property. - * + * * @return the identity value. */ ResourceModelWithAllowedPropertySetIdentity identity(); /** * Gets the sku property: The sku property. - * + * * @return the sku value. */ ResourceModelWithAllowedPropertySetSku sku(); /** * Gets the plan property: The plan property. - * + * * @return the plan value. */ ResourceModelWithAllowedPropertySetPlan plan(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of scaling plan. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the description property: Description of scaling plan. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: User friendly name of scaling plan. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the timeZone property: Timezone of the scaling plan. - * + * * @return the timeZone value. */ String timeZone(); /** * Gets the hostPoolType property: HostPool type for desktop. - * + * * @return the hostPoolType value. */ ScalingHostPoolType hostPoolType(); /** * Gets the exclusionTag property: Exclusion tag for scaling plan. - * + * * @return the exclusionTag value. */ String exclusionTag(); /** * Gets the schedules property: List of ScalingPlanPooledSchedule definitions. - * + * * @return the schedules value. */ List schedules(); /** * Gets the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @return the hostPoolReferences value. */ List hostPoolReferences(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner object. - * + * * @return the inner object. */ ScalingPlanInner innerModel(); - /** The entirety of the ScalingPlan definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithTimeZone, - DefinitionStages.WithCreate { + /** + * The entirety of the ScalingPlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithTimeZone, DefinitionStages.WithCreate { } - /** The ScalingPlan definition stages. */ + /** + * The ScalingPlan definition stages. + */ interface DefinitionStages { - /** The first stage of the ScalingPlan definition. */ + /** + * The first stage of the ScalingPlan definition. + */ interface Blank extends WithLocation { } - /** The stage of the ScalingPlan definition allowing to specify location. */ + /** + * The stage of the ScalingPlan definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -215,29 +221,33 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the ScalingPlan definition allowing to specify parent resource. */ + /** + * The stage of the ScalingPlan definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithTimeZone withExistingResourceGroup(String resourceGroupName); } - /** The stage of the ScalingPlan definition allowing to specify timeZone. */ + /** + * The stage of the ScalingPlan definition allowing to specify timeZone. + */ interface WithTimeZone { /** * Specifies the timeZone property: Timezone of the scaling plan.. - * + * * @param timeZone Timezone of the scaling plan. * @return the next definition stage. */ @@ -249,169 +259,185 @@ interface WithTimeZone { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithManagedBy, - DefinitionStages.WithKind, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithPlan, - DefinitionStages.WithDescription, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithHostPoolType, - DefinitionStages.WithExclusionTag, - DefinitionStages.WithSchedules, - DefinitionStages.WithHostPoolReferences { + extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, DefinitionStages.WithKind, + DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithPlan, + DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, DefinitionStages.WithHostPoolType, + DefinitionStages.WithExclusionTag, DefinitionStages.WithSchedules, DefinitionStages.WithHostPoolReferences { /** * Executes the create request. - * + * * @return the created resource. */ ScalingPlan create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ScalingPlan create(Context context); } - /** The stage of the ScalingPlan definition allowing to specify tags. */ + /** + * The stage of the ScalingPlan definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ScalingPlan definition allowing to specify managedBy. */ + /** + * The stage of the ScalingPlan definition allowing to specify managedBy. + */ interface WithManagedBy { /** * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete * mode deployment will not delete the resource if it is removed from the template since it is managed by * another resource.. - * + * * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will - * not delete the resource if it is removed from the template since it is managed by another resource. + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ WithCreate withManagedBy(String managedBy); } - /** The stage of the ScalingPlan definition allowing to specify kind. */ + /** + * The stage of the ScalingPlan definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider - * must validate and persist this value. + * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the ScalingPlan definition allowing to specify identity. */ + /** + * The stage of the ScalingPlan definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity property.. - * + * * @param identity The identity property. * @return the next definition stage. */ WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); } - /** The stage of the ScalingPlan definition allowing to specify sku. */ + /** + * The stage of the ScalingPlan definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku property.. - * + * * @param sku The sku property. * @return the next definition stage. */ WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); } - /** The stage of the ScalingPlan definition allowing to specify plan. */ + /** + * The stage of the ScalingPlan definition allowing to specify plan. + */ interface WithPlan { /** * Specifies the plan property: The plan property.. - * + * * @param plan The plan property. * @return the next definition stage. */ WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); } - /** The stage of the ScalingPlan definition allowing to specify description. */ + /** + * The stage of the ScalingPlan definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of scaling plan.. - * + * * @param description Description of scaling plan. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the ScalingPlan definition allowing to specify friendlyName. */ + /** + * The stage of the ScalingPlan definition allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: User friendly name of scaling plan.. - * + * * @param friendlyName User friendly name of scaling plan. * @return the next definition stage. */ WithCreate withFriendlyName(String friendlyName); } - /** The stage of the ScalingPlan definition allowing to specify hostPoolType. */ + /** + * The stage of the ScalingPlan definition allowing to specify hostPoolType. + */ interface WithHostPoolType { /** * Specifies the hostPoolType property: HostPool type for desktop.. - * + * * @param hostPoolType HostPool type for desktop. * @return the next definition stage. */ WithCreate withHostPoolType(ScalingHostPoolType hostPoolType); } - /** The stage of the ScalingPlan definition allowing to specify exclusionTag. */ + /** + * The stage of the ScalingPlan definition allowing to specify exclusionTag. + */ interface WithExclusionTag { /** * Specifies the exclusionTag property: Exclusion tag for scaling plan.. - * + * * @param exclusionTag Exclusion tag for scaling plan. * @return the next definition stage. */ WithCreate withExclusionTag(String exclusionTag); } - /** The stage of the ScalingPlan definition allowing to specify schedules. */ + /** + * The stage of the ScalingPlan definition allowing to specify schedules. + */ interface WithSchedules { /** * Specifies the schedules property: List of ScalingPlanPooledSchedule definitions.. - * + * * @param schedules List of ScalingPlanPooledSchedule definitions. * @return the next definition stage. */ WithCreate withSchedules(List schedules); } - /** The stage of the ScalingPlan definition allowing to specify hostPoolReferences. */ + /** + * The stage of the ScalingPlan definition allowing to specify hostPoolReferences. + */ interface WithHostPoolReferences { /** * Specifies the hostPoolReferences property: List of ScalingHostPoolReference definitions.. - * + * * @param hostPoolReferences List of ScalingHostPoolReference definitions. * @return the next definition stage. */ @@ -421,109 +447,122 @@ interface WithHostPoolReferences { /** * Begins update for the ScalingPlan resource. - * + * * @return the stage of resource update. */ ScalingPlan.Update update(); - /** The template for ScalingPlan update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithDescription, - UpdateStages.WithFriendlyName, - UpdateStages.WithTimeZone, - UpdateStages.WithExclusionTag, - UpdateStages.WithSchedules, - UpdateStages.WithHostPoolReferences { + /** + * The template for ScalingPlan update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, + UpdateStages.WithTimeZone, UpdateStages.WithExclusionTag, UpdateStages.WithSchedules, + UpdateStages.WithHostPoolReferences { /** * Executes the update request. - * + * * @return the updated resource. */ ScalingPlan apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ScalingPlan apply(Context context); } - /** The ScalingPlan update stages. */ + /** + * The ScalingPlan update stages. + */ interface UpdateStages { - /** The stage of the ScalingPlan update allowing to specify tags. */ + /** + * The stage of the ScalingPlan update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: tags to be updated. - * + * * @param tags tags to be updated. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the ScalingPlan update allowing to specify description. */ + /** + * The stage of the ScalingPlan update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of scaling plan.. - * + * * @param description Description of scaling plan. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the ScalingPlan update allowing to specify friendlyName. */ + /** + * The stage of the ScalingPlan update allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: User friendly name of scaling plan.. - * + * * @param friendlyName User friendly name of scaling plan. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } - /** The stage of the ScalingPlan update allowing to specify timeZone. */ + /** + * The stage of the ScalingPlan update allowing to specify timeZone. + */ interface WithTimeZone { /** * Specifies the timeZone property: Timezone of the scaling plan.. - * + * * @param timeZone Timezone of the scaling plan. * @return the next definition stage. */ Update withTimeZone(String timeZone); } - /** The stage of the ScalingPlan update allowing to specify exclusionTag. */ + /** + * The stage of the ScalingPlan update allowing to specify exclusionTag. + */ interface WithExclusionTag { /** * Specifies the exclusionTag property: Exclusion tag for scaling plan.. - * + * * @param exclusionTag Exclusion tag for scaling plan. * @return the next definition stage. */ Update withExclusionTag(String exclusionTag); } - /** The stage of the ScalingPlan update allowing to specify schedules. */ + /** + * The stage of the ScalingPlan update allowing to specify schedules. + */ interface WithSchedules { /** * Specifies the schedules property: List of ScalingSchedule definitions.. - * + * * @param schedules List of ScalingSchedule definitions. * @return the next definition stage. */ Update withSchedules(List schedules); } - /** The stage of the ScalingPlan update allowing to specify hostPoolReferences. */ + /** + * The stage of the ScalingPlan update allowing to specify hostPoolReferences. + */ interface WithHostPoolReferences { /** * Specifies the hostPoolReferences property: List of ScalingHostPoolReference definitions.. - * + * * @param hostPoolReferences List of ScalingHostPoolReference definitions. * @return the next definition stage. */ @@ -533,14 +572,14 @@ interface WithHostPoolReferences { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ScalingPlan refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java index b27ef7c0f7f9..94766566782e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ScalingPlanList - * - *

List of scaling plan definitions. + * + * List of scaling plan definitions. */ @Fluent -public final class ScalingPlanList { +public final class ScalingPlanList implements JsonSerializable { /* * List of scaling plan 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; - /** Creates an instance of ScalingPlanList class. */ + /** + * Creates an instance of ScalingPlanList class. + */ public ScalingPlanList() { } /** * Get the value property: List of scaling plan definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of scaling plan definitions. - * + * * @param value the value value to set. * @return the ScalingPlanList object itself. */ @@ -54,7 +58,7 @@ public ScalingPlanList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanList. + */ + public static ScalingPlanList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanList deserializedScalingPlanList = new ScalingPlanList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ScalingPlanInner.fromJson(reader1)); + deserializedScalingPlanList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedScalingPlanList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java index 381e4a076f8c..76138d328cca 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPatch.java @@ -5,35 +5,39 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Scaling plan properties that can be patched. */ +/** + * Scaling plan properties that can be patched. + */ @Fluent -public final class ScalingPlanPatch { +public final class ScalingPlanPatch implements JsonSerializable { /* * tags to be updated */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Detailed properties for scaling plan */ - @JsonProperty(value = "properties") private ScalingPlanPatchProperties innerProperties; - /** Creates an instance of ScalingPlanPatch class. */ + /** + * Creates an instance of ScalingPlanPatch class. + */ public ScalingPlanPatch() { } /** * Get the tags property: tags to be updated. - * + * * @return the tags value. */ public Map tags() { @@ -42,7 +46,7 @@ public Map tags() { /** * Set the tags property: tags to be updated. - * + * * @param tags the tags value to set. * @return the ScalingPlanPatch object itself. */ @@ -53,7 +57,7 @@ public ScalingPlanPatch withTags(Map tags) { /** * Get the innerProperties property: Detailed properties for scaling plan. - * + * * @return the innerProperties value. */ private ScalingPlanPatchProperties innerProperties() { @@ -62,7 +66,7 @@ private ScalingPlanPatchProperties innerProperties() { /** * Get the description property: Description of scaling plan. - * + * * @return the description value. */ public String description() { @@ -71,7 +75,7 @@ public String description() { /** * Set the description property: Description of scaling plan. - * + * * @param description the description value to set. * @return the ScalingPlanPatch object itself. */ @@ -85,7 +89,7 @@ public ScalingPlanPatch withDescription(String description) { /** * Get the friendlyName property: User friendly name of scaling plan. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -94,7 +98,7 @@ public String friendlyName() { /** * Set the friendlyName property: User friendly name of scaling plan. - * + * * @param friendlyName the friendlyName value to set. * @return the ScalingPlanPatch object itself. */ @@ -108,7 +112,7 @@ public ScalingPlanPatch withFriendlyName(String friendlyName) { /** * Get the timeZone property: Timezone of the scaling plan. - * + * * @return the timeZone value. */ public String timeZone() { @@ -117,7 +121,7 @@ public String timeZone() { /** * Set the timeZone property: Timezone of the scaling plan. - * + * * @param timeZone the timeZone value to set. * @return the ScalingPlanPatch object itself. */ @@ -131,7 +135,7 @@ public ScalingPlanPatch withTimeZone(String timeZone) { /** * Get the exclusionTag property: Exclusion tag for scaling plan. - * + * * @return the exclusionTag value. */ public String exclusionTag() { @@ -140,7 +144,7 @@ public String exclusionTag() { /** * Set the exclusionTag property: Exclusion tag for scaling plan. - * + * * @param exclusionTag the exclusionTag value to set. * @return the ScalingPlanPatch object itself. */ @@ -154,7 +158,7 @@ public ScalingPlanPatch withExclusionTag(String exclusionTag) { /** * Get the schedules property: List of ScalingSchedule definitions. - * + * * @return the schedules value. */ public List schedules() { @@ -163,7 +167,7 @@ public List schedules() { /** * Set the schedules property: List of ScalingSchedule definitions. - * + * * @param schedules the schedules value to set. * @return the ScalingPlanPatch object itself. */ @@ -177,7 +181,7 @@ public ScalingPlanPatch withSchedules(List schedules) { /** * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @return the hostPoolReferences value. */ public List hostPoolReferences() { @@ -186,7 +190,7 @@ public List hostPoolReferences() { /** * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions. - * + * * @param hostPoolReferences the hostPoolReferences value to set. * @return the ScalingPlanPatch object itself. */ @@ -200,7 +204,7 @@ public ScalingPlanPatch withHostPoolReferences(List ho /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -208,4 +212,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPatch. + */ + public static ScalingPlanPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPatch deserializedScalingPlanPatch = new ScalingPlanPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedScalingPlanPatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedScalingPlanPatch.innerProperties = ScalingPlanPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java index 7a899c03a48e..5db3c022ee7d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedule.java @@ -9,46 +9,48 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; import java.util.List; -/** An immutable client-side representation of ScalingPlanPersonalSchedule. */ +/** + * An immutable client-side representation of ScalingPlanPersonalSchedule. + */ public interface ScalingPlanPersonalSchedule { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ List daysOfWeek(); /** * Gets the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ Time rampUpStartTime(); @@ -56,7 +58,7 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms * in the hostpool. - * + * * @return the rampUpAutoStartHosts value. */ StartupBehavior rampUpAutoStartHosts(); @@ -65,14 +67,14 @@ public interface ScalingPlanPersonalSchedule { * Gets the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by * turning them on manually. - * + * * @return the rampUpStartVMOnConnect value. */ SetStartVMOnConnect rampUpStartVMOnConnect(); /** * Gets the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @return the rampUpActionOnDisconnect value. */ SessionHandlingOperation rampUpActionOnDisconnect(); @@ -80,14 +82,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnDisconnect value. */ Integer rampUpMinutesToWaitOnDisconnect(); /** * Gets the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @return the rampUpActionOnLogoff value. */ SessionHandlingOperation rampUpActionOnLogoff(); @@ -95,14 +97,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnLogoff value. */ Integer rampUpMinutesToWaitOnLogoff(); /** * Gets the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ Time peakStartTime(); @@ -110,14 +112,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @return the peakStartVMOnConnect value. */ SetStartVMOnConnect peakStartVMOnConnect(); /** * Gets the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @return the peakActionOnDisconnect value. */ SessionHandlingOperation peakActionOnDisconnect(); @@ -125,14 +127,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the peak period. - * + * * @return the peakMinutesToWaitOnDisconnect value. */ Integer peakMinutesToWaitOnDisconnect(); /** * Gets the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @return the peakActionOnLogoff value. */ SessionHandlingOperation peakActionOnLogoff(); @@ -140,14 +142,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @return the peakMinutesToWaitOnLogoff value. */ Integer peakMinutesToWaitOnLogoff(); /** * Gets the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ Time rampDownStartTime(); @@ -155,7 +157,7 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @return the rampDownStartVMOnConnect value. */ SetStartVMOnConnect rampDownStartVMOnConnect(); @@ -163,7 +165,7 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @return the rampDownActionOnDisconnect value. */ SessionHandlingOperation rampDownActionOnDisconnect(); @@ -171,14 +173,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnDisconnect value. */ Integer rampDownMinutesToWaitOnDisconnect(); /** * Gets the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @return the rampDownActionOnLogoff value. */ SessionHandlingOperation rampDownActionOnLogoff(); @@ -186,14 +188,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired * session handling action when a user logs off during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnLogoff value. */ Integer rampDownMinutesToWaitOnLogoff(); /** * Gets the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ Time offPeakStartTime(); @@ -201,7 +203,7 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @return the offPeakStartVMOnConnect value. */ SetStartVMOnConnect offPeakStartVMOnConnect(); @@ -209,7 +211,7 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @return the offPeakActionOnDisconnect value. */ SessionHandlingOperation offPeakActionOnDisconnect(); @@ -217,14 +219,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnDisconnect value. */ Integer offPeakMinutesToWaitOnDisconnect(); /** * Gets the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @return the offPeakActionOnLogoff value. */ SessionHandlingOperation offPeakActionOnLogoff(); @@ -232,14 +234,14 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnLogoff value. */ Integer offPeakMinutesToWaitOnLogoff(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); @@ -247,27 +249,35 @@ public interface ScalingPlanPersonalSchedule { /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner * object. - * + * * @return the inner object. */ ScalingPlanPersonalScheduleInner innerModel(); - /** The entirety of the ScalingPlanPersonalSchedule definition. */ + /** + * The entirety of the ScalingPlanPersonalSchedule definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The ScalingPlanPersonalSchedule definition stages. */ + /** + * The ScalingPlanPersonalSchedule definition stages. + */ interface DefinitionStages { - /** The first stage of the ScalingPlanPersonalSchedule definition. */ + /** + * The first stage of the ScalingPlanPersonalSchedule definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify parent resource. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, scalingPlanName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. @@ -279,105 +289,101 @@ interface WithParentResource { * The stage of the ScalingPlanPersonalSchedule definition which contains all the minimum required properties * for the resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithDaysOfWeek, - DefinitionStages.WithRampUpStartTime, - DefinitionStages.WithRampUpAutoStartHosts, - DefinitionStages.WithRampUpStartVMOnConnect, - DefinitionStages.WithRampUpActionOnDisconnect, - DefinitionStages.WithRampUpMinutesToWaitOnDisconnect, - DefinitionStages.WithRampUpActionOnLogoff, - DefinitionStages.WithRampUpMinutesToWaitOnLogoff, - DefinitionStages.WithPeakStartTime, - DefinitionStages.WithPeakStartVMOnConnect, - DefinitionStages.WithPeakActionOnDisconnect, - DefinitionStages.WithPeakMinutesToWaitOnDisconnect, - DefinitionStages.WithPeakActionOnLogoff, - DefinitionStages.WithPeakMinutesToWaitOnLogoff, - DefinitionStages.WithRampDownStartTime, - DefinitionStages.WithRampDownStartVMOnConnect, - DefinitionStages.WithRampDownActionOnDisconnect, - DefinitionStages.WithRampDownMinutesToWaitOnDisconnect, - DefinitionStages.WithRampDownActionOnLogoff, - DefinitionStages.WithRampDownMinutesToWaitOnLogoff, - DefinitionStages.WithOffPeakStartTime, - DefinitionStages.WithOffPeakStartVMOnConnect, - DefinitionStages.WithOffPeakActionOnDisconnect, - DefinitionStages.WithOffPeakMinutesToWaitOnDisconnect, - DefinitionStages.WithOffPeakActionOnLogoff, - DefinitionStages.WithOffPeakMinutesToWaitOnLogoff { + interface WithCreate extends DefinitionStages.WithDaysOfWeek, DefinitionStages.WithRampUpStartTime, + DefinitionStages.WithRampUpAutoStartHosts, DefinitionStages.WithRampUpStartVMOnConnect, + DefinitionStages.WithRampUpActionOnDisconnect, DefinitionStages.WithRampUpMinutesToWaitOnDisconnect, + DefinitionStages.WithRampUpActionOnLogoff, DefinitionStages.WithRampUpMinutesToWaitOnLogoff, + DefinitionStages.WithPeakStartTime, DefinitionStages.WithPeakStartVMOnConnect, + DefinitionStages.WithPeakActionOnDisconnect, DefinitionStages.WithPeakMinutesToWaitOnDisconnect, + DefinitionStages.WithPeakActionOnLogoff, DefinitionStages.WithPeakMinutesToWaitOnLogoff, + DefinitionStages.WithRampDownStartTime, DefinitionStages.WithRampDownStartVMOnConnect, + DefinitionStages.WithRampDownActionOnDisconnect, DefinitionStages.WithRampDownMinutesToWaitOnDisconnect, + DefinitionStages.WithRampDownActionOnLogoff, DefinitionStages.WithRampDownMinutesToWaitOnLogoff, + DefinitionStages.WithOffPeakStartTime, DefinitionStages.WithOffPeakStartVMOnConnect, + DefinitionStages.WithOffPeakActionOnDisconnect, DefinitionStages.WithOffPeakMinutesToWaitOnDisconnect, + DefinitionStages.WithOffPeakActionOnLogoff, DefinitionStages.WithOffPeakMinutesToWaitOnLogoff { /** * Executes the create request. - * + * * @return the created resource. */ ScalingPlanPersonalSchedule create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ScalingPlanPersonalSchedule create(Context context); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify daysOfWeek. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify daysOfWeek. + */ interface WithDaysOfWeek { /** * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. - * + * * @param daysOfWeek Set of days of the week on which this schedule is active. * @return the next definition stage. */ WithCreate withDaysOfWeek(List daysOfWeek); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartTime. + */ interface WithRampUpStartTime { /** * Specifies the rampUpStartTime property: Starting time for ramp up period.. - * + * * @param rampUpStartTime Starting time for ramp up period. * @return the next definition stage. */ WithCreate withRampUpStartTime(Time rampUpStartTime); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpAutoStartHosts. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpAutoStartHosts. + */ interface WithRampUpAutoStartHosts { /** * Specifies the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for * personal vms in the hostpool.. - * + * * @param rampUpAutoStartHosts The desired startup behavior during the ramp up period for personal vms in - * the hostpool. + * the hostpool. * @return the next definition stage. */ WithCreate withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpStartVMOnConnect. + */ interface WithRampUpStartVMOnConnect { /** * Specifies the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the ramp up phase. If this is disabled, session hosts must be turned on using * rampUpAutoStartHosts or by turning them on manually.. - * + * * @param rampUpStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or - * by turning them on manually. + * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by + * turning them on manually. * @return the next definition stage. */ WithCreate withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpActionOnDisconnect. + */ interface WithRampUpActionOnDisconnect { /** * Specifies the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the * ramp up period.. - * + * * @param rampUpActionOnDisconnect Action to be taken after a user disconnect during the ramp up period. * @return the next definition stage. */ @@ -391,69 +397,79 @@ interface WithRampUpMinutesToWaitOnDisconnect { /** * Specifies the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the * desired session handling action when a user disconnects during the ramp up period.. - * + * * @param rampUpMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired session - * handling action when a user disconnects during the ramp up period. + * handling action when a user disconnects during the ramp up period. * @return the next definition stage. */ WithCreate withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpActionOnLogoff. + */ interface WithRampUpActionOnLogoff { /** * Specifies the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up * period.. - * + * * @param rampUpActionOnLogoff Action to be taken after a logoff during the ramp up period. * @return the next definition stage. */ WithCreate withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampUpMinutesToWaitOnLogoff. + */ interface WithRampUpMinutesToWaitOnLogoff { /** * Specifies the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the ramp up period.. - * + * * @param rampUpMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the ramp up period. + * handling action when a user logs off during the ramp up period. * @return the next definition stage. */ WithCreate withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartTime. + */ interface WithPeakStartTime { /** * Specifies the peakStartTime property: Starting time for peak period.. - * + * * @param peakStartTime Starting time for peak period. * @return the next definition stage. */ WithCreate withPeakStartTime(Time peakStartTime); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakStartVMOnConnect. + */ interface WithPeakStartVMOnConnect { /** * Specifies the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the peak phase.. - * + * * @param peakStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during the - * peak phase. + * peak phase. * @return the next definition stage. */ WithCreate withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakActionOnDisconnect. + */ interface WithPeakActionOnDisconnect { /** * Specifies the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak * period.. - * + * * @param peakActionOnDisconnect Action to be taken after a user disconnect during the peak period. * @return the next definition stage. */ @@ -467,68 +483,78 @@ interface WithPeakMinutesToWaitOnDisconnect { /** * Specifies the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the * desired session handling action when a user disconnects during the peak period.. - * + * * @param peakMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired session - * handling action when a user disconnects during the peak period. + * handling action when a user disconnects during the peak period. * @return the next definition stage. */ WithCreate withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakActionOnLogoff. + */ interface WithPeakActionOnLogoff { /** * Specifies the peakActionOnLogoff property: Action to be taken after a logoff during the peak period.. - * + * * @param peakActionOnLogoff Action to be taken after a logoff during the peak period. * @return the next definition stage. */ WithCreate withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify peakMinutesToWaitOnLogoff. + */ interface WithPeakMinutesToWaitOnLogoff { /** * Specifies the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the peak period.. - * + * * @param peakMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the peak period. + * handling action when a user logs off during the peak period. * @return the next definition stage. */ WithCreate withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartTime. + */ interface WithRampDownStartTime { /** * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * + * * @param rampDownStartTime Starting time for ramp down period. * @return the next definition stage. */ WithCreate withRampDownStartTime(Time rampDownStartTime); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownStartVMOnConnect. + */ interface WithRampDownStartVMOnConnect { /** * Specifies the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the ramp down phase.. - * + * * @param rampDownStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the ramp down phase. + * the ramp down phase. * @return the next definition stage. */ WithCreate withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownActionOnDisconnect. + */ interface WithRampDownActionOnDisconnect { /** * Specifies the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the * ramp down period.. - * + * * @param rampDownActionOnDisconnect Action to be taken after a user disconnect during the ramp down period. * @return the next definition stage. */ @@ -543,20 +569,22 @@ interface WithRampDownMinutesToWaitOnDisconnect { /** * Specifies the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing * the desired session handling action when a user disconnects during the ramp down period.. - * + * * @param rampDownMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired - * session handling action when a user disconnects during the ramp down period. + * session handling action when a user disconnects during the ramp down period. * @return the next definition stage. */ WithCreate withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify rampDownActionOnLogoff. + */ interface WithRampDownActionOnLogoff { /** * Specifies the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down * period.. - * + * * @param rampDownActionOnLogoff Action to be taken after a logoff during the ramp down period. * @return the next definition stage. */ @@ -570,44 +598,50 @@ interface WithRampDownMinutesToWaitOnLogoff { /** * Specifies the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the ramp down period.. - * + * * @param rampDownMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the ramp down period. + * handling action when a user logs off during the ramp down period. * @return the next definition stage. */ WithCreate withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartTime. + */ interface WithOffPeakStartTime { /** * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * + * * @param offPeakStartTime Starting time for off-peak period. * @return the next definition stage. */ WithCreate withOffPeakStartTime(Time offPeakStartTime); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakStartVMOnConnect. + */ interface WithOffPeakStartVMOnConnect { /** * Specifies the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the off-peak phase.. - * + * * @param offPeakStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the off-peak phase. + * the off-peak phase. * @return the next definition stage. */ WithCreate withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakActionOnDisconnect. + */ interface WithOffPeakActionOnDisconnect { /** * Specifies the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the * off-peak period.. - * + * * @param offPeakActionOnDisconnect Action to be taken after a user disconnect during the off-peak period. * @return the next definition stage. */ @@ -621,34 +655,38 @@ interface WithOffPeakMinutesToWaitOnDisconnect { /** * Specifies the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing * the desired session handling action when a user disconnects during the off-peak period.. - * + * * @param offPeakMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired session - * handling action when a user disconnects during the off-peak period. + * handling action when a user disconnects during the off-peak period. * @return the next definition stage. */ WithCreate withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakActionOnLogoff. + */ interface WithOffPeakActionOnLogoff { /** * Specifies the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak * period.. - * + * * @param offPeakActionOnLogoff Action to be taken after a logoff during the off-peak period. * @return the next definition stage. */ WithCreate withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule definition allowing to specify offPeakMinutesToWaitOnLogoff. + */ interface WithOffPeakMinutesToWaitOnLogoff { /** * Specifies the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the off-peak period.. - * + * * @param offPeakMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the off-peak period. + * handling action when a user logs off during the off-peak period. * @return the next definition stage. */ WithCreate withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff); @@ -657,260 +695,284 @@ interface WithOffPeakMinutesToWaitOnLogoff { /** * Begins update for the ScalingPlanPersonalSchedule resource. - * + * * @return the stage of resource update. */ ScalingPlanPersonalSchedule.Update update(); - /** The template for ScalingPlanPersonalSchedule update. */ - interface Update - extends UpdateStages.WithDaysOfWeek, - UpdateStages.WithRampUpStartTime, - UpdateStages.WithRampUpAutoStartHosts, - UpdateStages.WithRampUpStartVMOnConnect, - UpdateStages.WithRampUpActionOnDisconnect, - UpdateStages.WithRampUpMinutesToWaitOnDisconnect, - UpdateStages.WithRampUpActionOnLogoff, - UpdateStages.WithRampUpMinutesToWaitOnLogoff, - UpdateStages.WithPeakStartTime, - UpdateStages.WithPeakStartVMOnConnect, - UpdateStages.WithPeakActionOnDisconnect, - UpdateStages.WithPeakMinutesToWaitOnDisconnect, - UpdateStages.WithPeakActionOnLogoff, - UpdateStages.WithPeakMinutesToWaitOnLogoff, - UpdateStages.WithRampDownStartTime, - UpdateStages.WithRampDownStartVMOnConnect, - UpdateStages.WithRampDownActionOnDisconnect, - UpdateStages.WithRampDownMinutesToWaitOnDisconnect, - UpdateStages.WithRampDownActionOnLogoff, - UpdateStages.WithRampDownMinutesToWaitOnLogoff, - UpdateStages.WithOffPeakStartTime, - UpdateStages.WithOffPeakStartVMOnConnect, - UpdateStages.WithOffPeakActionOnDisconnect, - UpdateStages.WithOffPeakMinutesToWaitOnDisconnect, - UpdateStages.WithOffPeakActionOnLogoff, - UpdateStages.WithOffPeakMinutesToWaitOnLogoff { + /** + * The template for ScalingPlanPersonalSchedule update. + */ + interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpStartTime, + UpdateStages.WithRampUpAutoStartHosts, UpdateStages.WithRampUpStartVMOnConnect, + UpdateStages.WithRampUpActionOnDisconnect, UpdateStages.WithRampUpMinutesToWaitOnDisconnect, + UpdateStages.WithRampUpActionOnLogoff, UpdateStages.WithRampUpMinutesToWaitOnLogoff, + UpdateStages.WithPeakStartTime, UpdateStages.WithPeakStartVMOnConnect, UpdateStages.WithPeakActionOnDisconnect, + UpdateStages.WithPeakMinutesToWaitOnDisconnect, UpdateStages.WithPeakActionOnLogoff, + UpdateStages.WithPeakMinutesToWaitOnLogoff, UpdateStages.WithRampDownStartTime, + UpdateStages.WithRampDownStartVMOnConnect, UpdateStages.WithRampDownActionOnDisconnect, + UpdateStages.WithRampDownMinutesToWaitOnDisconnect, UpdateStages.WithRampDownActionOnLogoff, + UpdateStages.WithRampDownMinutesToWaitOnLogoff, UpdateStages.WithOffPeakStartTime, + UpdateStages.WithOffPeakStartVMOnConnect, UpdateStages.WithOffPeakActionOnDisconnect, + UpdateStages.WithOffPeakMinutesToWaitOnDisconnect, UpdateStages.WithOffPeakActionOnLogoff, + UpdateStages.WithOffPeakMinutesToWaitOnLogoff { /** * Executes the update request. - * + * * @return the updated resource. */ ScalingPlanPersonalSchedule apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ScalingPlanPersonalSchedule apply(Context context); } - /** The ScalingPlanPersonalSchedule update stages. */ + /** + * The ScalingPlanPersonalSchedule update stages. + */ interface UpdateStages { - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify daysOfWeek. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify daysOfWeek. + */ interface WithDaysOfWeek { /** * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. - * + * * @param daysOfWeek Set of days of the week on which this schedule is active. * @return the next definition stage. */ Update withDaysOfWeek(List daysOfWeek); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpStartTime. + */ interface WithRampUpStartTime { /** * Specifies the rampUpStartTime property: Starting time for ramp up period.. - * + * * @param rampUpStartTime Starting time for ramp up period. * @return the next definition stage. */ Update withRampUpStartTime(Time rampUpStartTime); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpAutoStartHosts. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpAutoStartHosts. + */ interface WithRampUpAutoStartHosts { /** * Specifies the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for * personal vms in the hostpool.. - * + * * @param rampUpAutoStartHosts The desired startup behavior during the ramp up period for personal vms in - * the hostpool. + * the hostpool. * @return the next definition stage. */ Update withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpStartVMOnConnect. + */ interface WithRampUpStartVMOnConnect { /** * Specifies the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the ramp up phase. If this is disabled, session hosts must be turned on using * rampUpAutoStartHosts or by turning them on manually.. - * + * * @param rampUpStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or - * by turning them on manually. + * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by + * turning them on manually. * @return the next definition stage. */ Update withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpActionOnDisconnect. + */ interface WithRampUpActionOnDisconnect { /** * Specifies the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the * ramp up period.. - * + * * @param rampUpActionOnDisconnect Action to be taken after a user disconnect during the ramp up period. * @return the next definition stage. */ Update withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpMinutesToWaitOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpMinutesToWaitOnDisconnect. + */ interface WithRampUpMinutesToWaitOnDisconnect { /** * Specifies the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the * desired session handling action when a user disconnects during the ramp up period.. - * + * * @param rampUpMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired session - * handling action when a user disconnects during the ramp up period. + * handling action when a user disconnects during the ramp up period. * @return the next definition stage. */ Update withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpActionOnLogoff. + */ interface WithRampUpActionOnLogoff { /** * Specifies the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up * period.. - * + * * @param rampUpActionOnLogoff Action to be taken after a logoff during the ramp up period. * @return the next definition stage. */ Update withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampUpMinutesToWaitOnLogoff. + */ interface WithRampUpMinutesToWaitOnLogoff { /** * Specifies the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the ramp up period.. - * + * * @param rampUpMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the ramp up period. + * handling action when a user logs off during the ramp up period. * @return the next definition stage. */ Update withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify peakStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakStartTime. + */ interface WithPeakStartTime { /** * Specifies the peakStartTime property: Starting time for peak period.. - * + * * @param peakStartTime Starting time for peak period. * @return the next definition stage. */ Update withPeakStartTime(Time peakStartTime); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify peakStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakStartVMOnConnect. + */ interface WithPeakStartVMOnConnect { /** * Specifies the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the peak phase.. - * + * * @param peakStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during the - * peak phase. + * peak phase. * @return the next definition stage. */ Update withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify peakActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakActionOnDisconnect. + */ interface WithPeakActionOnDisconnect { /** * Specifies the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak * period.. - * + * * @param peakActionOnDisconnect Action to be taken after a user disconnect during the peak period. * @return the next definition stage. */ Update withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify peakMinutesToWaitOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakMinutesToWaitOnDisconnect. + */ interface WithPeakMinutesToWaitOnDisconnect { /** * Specifies the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the * desired session handling action when a user disconnects during the peak period.. - * + * * @param peakMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired session - * handling action when a user disconnects during the peak period. + * handling action when a user disconnects during the peak period. * @return the next definition stage. */ Update withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify peakActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakActionOnLogoff. + */ interface WithPeakActionOnLogoff { /** * Specifies the peakActionOnLogoff property: Action to be taken after a logoff during the peak period.. - * + * * @param peakActionOnLogoff Action to be taken after a logoff during the peak period. * @return the next definition stage. */ Update withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify peakMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify peakMinutesToWaitOnLogoff. + */ interface WithPeakMinutesToWaitOnLogoff { /** * Specifies the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the peak period.. - * + * * @param peakMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the peak period. + * handling action when a user logs off during the peak period. * @return the next definition stage. */ Update withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownStartTime. + */ interface WithRampDownStartTime { /** * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * + * * @param rampDownStartTime Starting time for ramp down period. * @return the next definition stage. */ Update withRampDownStartTime(Time rampDownStartTime); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownStartVMOnConnect. + */ interface WithRampDownStartVMOnConnect { /** * Specifies the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the ramp down phase.. - * + * * @param rampDownStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the ramp down phase. + * the ramp down phase. * @return the next definition stage. */ Update withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownActionOnDisconnect. + */ interface WithRampDownActionOnDisconnect { /** * Specifies the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the * ramp down period.. - * + * * @param rampDownActionOnDisconnect Action to be taken after a user disconnect during the ramp down period. * @return the next definition stage. */ @@ -924,108 +986,124 @@ interface WithRampDownMinutesToWaitOnDisconnect { /** * Specifies the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing * the desired session handling action when a user disconnects during the ramp down period.. - * + * * @param rampDownMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired - * session handling action when a user disconnects during the ramp down period. + * session handling action when a user disconnects during the ramp down period. * @return the next definition stage. */ Update withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownActionOnLogoff. + */ interface WithRampDownActionOnLogoff { /** * Specifies the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down * period.. - * + * * @param rampDownActionOnLogoff Action to be taken after a logoff during the ramp down period. * @return the next definition stage. */ Update withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify rampDownMinutesToWaitOnLogoff. + */ interface WithRampDownMinutesToWaitOnLogoff { /** * Specifies the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the ramp down period.. - * + * * @param rampDownMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the ramp down period. + * handling action when a user logs off during the ramp down period. * @return the next definition stage. */ Update withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakStartTime. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakStartTime. + */ interface WithOffPeakStartTime { /** * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * + * * @param offPeakStartTime Starting time for off-peak period. * @return the next definition stage. */ Update withOffPeakStartTime(Time offPeakStartTime); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakStartVMOnConnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakStartVMOnConnect. + */ interface WithOffPeakStartVMOnConnect { /** * Specifies the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the * hostpool during the off-peak phase.. - * + * * @param offPeakStartVMOnConnect The desired configuration of Start VM On Connect for the hostpool during - * the off-peak phase. + * the off-peak phase. * @return the next definition stage. */ Update withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakActionOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakActionOnDisconnect. + */ interface WithOffPeakActionOnDisconnect { /** * Specifies the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the * off-peak period.. - * + * * @param offPeakActionOnDisconnect Action to be taken after a user disconnect during the off-peak period. * @return the next definition stage. */ Update withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakMinutesToWaitOnDisconnect. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakMinutesToWaitOnDisconnect. + */ interface WithOffPeakMinutesToWaitOnDisconnect { /** * Specifies the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing * the desired session handling action when a user disconnects during the off-peak period.. - * + * * @param offPeakMinutesToWaitOnDisconnect The time in minutes to wait before performing the desired session - * handling action when a user disconnects during the off-peak period. + * handling action when a user disconnects during the off-peak period. * @return the next definition stage. */ Update withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakActionOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakActionOnLogoff. + */ interface WithOffPeakActionOnLogoff { /** * Specifies the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak * period.. - * + * * @param offPeakActionOnLogoff Action to be taken after a logoff during the off-peak period. * @return the next definition stage. */ Update withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff); } - /** The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakMinutesToWaitOnLogoff. */ + /** + * The stage of the ScalingPlanPersonalSchedule update allowing to specify offPeakMinutesToWaitOnLogoff. + */ interface WithOffPeakMinutesToWaitOnLogoff { /** * Specifies the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the * desired session handling action when a user logs off during the off-peak period.. - * + * * @param offPeakMinutesToWaitOnLogoff The time in minutes to wait before performing the desired session - * handling action when a user logs off during the off-peak period. + * handling action when a user logs off during the off-peak period. * @return the next definition stage. */ Update withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff); @@ -1034,14 +1112,14 @@ interface WithOffPeakMinutesToWaitOnLogoff { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ScalingPlanPersonalSchedule refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java index 80e3f211b2c4..21f5c39476a4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalScheduleList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ScalingPlanPersonalScheduleList - * - *

List of ScalingPlanPersonalSchedule definitions. + * + * List of ScalingPlanPersonalSchedule definitions. */ @Fluent -public final class ScalingPlanPersonalScheduleList { +public final class ScalingPlanPersonalScheduleList implements JsonSerializable { /* * List of ScalingPlanPersonalSchedule 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; - /** Creates an instance of ScalingPlanPersonalScheduleList class. */ + /** + * Creates an instance of ScalingPlanPersonalScheduleList class. + */ public ScalingPlanPersonalScheduleList() { } /** * Get the value property: List of ScalingPlanPersonalSchedule definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of ScalingPlanPersonalSchedule definitions. - * + * * @param value the value value to set. * @return the ScalingPlanPersonalScheduleList object itself. */ @@ -54,7 +58,7 @@ public ScalingPlanPersonalScheduleList withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPersonalScheduleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPersonalScheduleList if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPersonalScheduleList. + */ + public static ScalingPlanPersonalScheduleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPersonalScheduleList deserializedScalingPlanPersonalScheduleList + = new ScalingPlanPersonalScheduleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ScalingPlanPersonalScheduleInner.fromJson(reader1)); + deserializedScalingPlanPersonalScheduleList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedScalingPlanPersonalScheduleList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPersonalScheduleList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java index 1cac9608a949..3fcce4e285df 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedulePatch.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ScalingPlanPersonalSchedule properties that can be patched. */ +/** + * ScalingPlanPersonalSchedule properties that can be patched. + */ @Fluent -public final class ScalingPlanPersonalSchedulePatch { +public final class ScalingPlanPersonalSchedulePatch implements JsonSerializable { /* * Detailed properties for ScalingPlanPersonalSchedule */ - @JsonProperty(value = "properties") private ScalingPlanPersonalScheduleProperties innerProperties; - /** Creates an instance of ScalingPlanPersonalSchedulePatch class. */ + /** + * Creates an instance of ScalingPlanPersonalSchedulePatch class. + */ public ScalingPlanPersonalSchedulePatch() { } /** * Get the innerProperties property: Detailed properties for ScalingPlanPersonalSchedule. - * + * * @return the innerProperties value. */ private ScalingPlanPersonalScheduleProperties innerProperties() { @@ -33,7 +40,7 @@ private ScalingPlanPersonalScheduleProperties innerProperties() { /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -42,7 +49,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -56,7 +63,7 @@ public ScalingPlanPersonalSchedulePatch withDaysOfWeek(List daysOfWee /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -65,7 +72,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -80,7 +87,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpStartTime(Time rampUpStartTime /** * Get the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in * the hostpool. - * + * * @return the rampUpAutoStartHosts value. */ public StartupBehavior rampUpAutoStartHosts() { @@ -90,7 +97,7 @@ public StartupBehavior rampUpAutoStartHosts() { /** * Set the rampUpAutoStartHosts property: The desired startup behavior during the ramp up period for personal vms in * the hostpool. - * + * * @param rampUpAutoStartHosts the rampUpAutoStartHosts value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -106,7 +113,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpAutoStartHosts(StartupBehavior * Get the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning * them on manually. - * + * * @return the rampUpStartVMOnConnect value. */ public SetStartVMOnConnect rampUpStartVMOnConnect() { @@ -117,7 +124,7 @@ public SetStartVMOnConnect rampUpStartVMOnConnect() { * Set the rampUpStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the ramp up phase. If this is disabled, session hosts must be turned on using rampUpAutoStartHosts or by turning * them on manually. - * + * * @param rampUpStartVMOnConnect the rampUpStartVMOnConnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -131,7 +138,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpStartVMOnConnect(SetStartVMOnC /** * Get the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @return the rampUpActionOnDisconnect value. */ public SessionHandlingOperation rampUpActionOnDisconnect() { @@ -140,12 +147,12 @@ public SessionHandlingOperation rampUpActionOnDisconnect() { /** * Set the rampUpActionOnDisconnect property: Action to be taken after a user disconnect during the ramp up period. - * + * * @param rampUpActionOnDisconnect the rampUpActionOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withRampUpActionOnDisconnect( - SessionHandlingOperation rampUpActionOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withRampUpActionOnDisconnect(SessionHandlingOperation rampUpActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -156,7 +163,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpActionOnDisconnect( /** * Get the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnDisconnect value. */ public Integer rampUpMinutesToWaitOnDisconnect() { @@ -166,12 +173,12 @@ public Integer rampUpMinutesToWaitOnDisconnect() { /** * Set the rampUpMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp up period. - * + * * @param rampUpMinutesToWaitOnDisconnect the rampUpMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withRampUpMinutesToWaitOnDisconnect( - Integer rampUpMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withRampUpMinutesToWaitOnDisconnect(Integer rampUpMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -181,7 +188,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpMinutesToWaitOnDisconnect( /** * Get the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @return the rampUpActionOnLogoff value. */ public SessionHandlingOperation rampUpActionOnLogoff() { @@ -190,7 +197,7 @@ public SessionHandlingOperation rampUpActionOnLogoff() { /** * Set the rampUpActionOnLogoff property: Action to be taken after a logoff during the ramp up period. - * + * * @param rampUpActionOnLogoff the rampUpActionOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -205,7 +212,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpActionOnLogoff(SessionHandling /** * Get the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @return the rampUpMinutesToWaitOnLogoff value. */ public Integer rampUpMinutesToWaitOnLogoff() { @@ -215,7 +222,7 @@ public Integer rampUpMinutesToWaitOnLogoff() { /** * Set the rampUpMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp up period. - * + * * @param rampUpMinutesToWaitOnLogoff the rampUpMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -229,7 +236,7 @@ public ScalingPlanPersonalSchedulePatch withRampUpMinutesToWaitOnLogoff(Integer /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -238,7 +245,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -253,7 +260,7 @@ public ScalingPlanPersonalSchedulePatch withPeakStartTime(Time peakStartTime) { /** * Get the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @return the peakStartVMOnConnect value. */ public SetStartVMOnConnect peakStartVMOnConnect() { @@ -263,7 +270,7 @@ public SetStartVMOnConnect peakStartVMOnConnect() { /** * Set the peakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool during * the peak phase. - * + * * @param peakStartVMOnConnect the peakStartVMOnConnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -277,7 +284,7 @@ public ScalingPlanPersonalSchedulePatch withPeakStartVMOnConnect(SetStartVMOnCon /** * Get the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @return the peakActionOnDisconnect value. */ public SessionHandlingOperation peakActionOnDisconnect() { @@ -286,12 +293,12 @@ public SessionHandlingOperation peakActionOnDisconnect() { /** * Set the peakActionOnDisconnect property: Action to be taken after a user disconnect during the peak period. - * + * * @param peakActionOnDisconnect the peakActionOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withPeakActionOnDisconnect( - SessionHandlingOperation peakActionOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -302,7 +309,7 @@ public ScalingPlanPersonalSchedulePatch withPeakActionOnDisconnect( /** * Get the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session * handling action when a user disconnects during the peak period. - * + * * @return the peakMinutesToWaitOnDisconnect value. */ public Integer peakMinutesToWaitOnDisconnect() { @@ -312,7 +319,7 @@ public Integer peakMinutesToWaitOnDisconnect() { /** * Set the peakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired session * handling action when a user disconnects during the peak period. - * + * * @param peakMinutesToWaitOnDisconnect the peakMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -326,7 +333,7 @@ public ScalingPlanPersonalSchedulePatch withPeakMinutesToWaitOnDisconnect(Intege /** * Get the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @return the peakActionOnLogoff value. */ public SessionHandlingOperation peakActionOnLogoff() { @@ -335,7 +342,7 @@ public SessionHandlingOperation peakActionOnLogoff() { /** * Set the peakActionOnLogoff property: Action to be taken after a logoff during the peak period. - * + * * @param peakActionOnLogoff the peakActionOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -350,7 +357,7 @@ public ScalingPlanPersonalSchedulePatch withPeakActionOnLogoff(SessionHandlingOp /** * Get the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @return the peakMinutesToWaitOnLogoff value. */ public Integer peakMinutesToWaitOnLogoff() { @@ -360,7 +367,7 @@ public Integer peakMinutesToWaitOnLogoff() { /** * Set the peakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the peak period. - * + * * @param peakMinutesToWaitOnLogoff the peakMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -374,7 +381,7 @@ public ScalingPlanPersonalSchedulePatch withPeakMinutesToWaitOnLogoff(Integer pe /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -383,7 +390,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -398,7 +405,7 @@ public ScalingPlanPersonalSchedulePatch withRampDownStartTime(Time rampDownStart /** * Get the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @return the rampDownStartVMOnConnect value. */ public SetStartVMOnConnect rampDownStartVMOnConnect() { @@ -408,7 +415,7 @@ public SetStartVMOnConnect rampDownStartVMOnConnect() { /** * Set the rampDownStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the ramp down phase. - * + * * @param rampDownStartVMOnConnect the rampDownStartVMOnConnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -423,7 +430,7 @@ public ScalingPlanPersonalSchedulePatch withRampDownStartVMOnConnect(SetStartVMO /** * Get the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @return the rampDownActionOnDisconnect value. */ public SessionHandlingOperation rampDownActionOnDisconnect() { @@ -433,12 +440,12 @@ public SessionHandlingOperation rampDownActionOnDisconnect() { /** * Set the rampDownActionOnDisconnect property: Action to be taken after a user disconnect during the ramp down * period. - * + * * @param rampDownActionOnDisconnect the rampDownActionOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withRampDownActionOnDisconnect( - SessionHandlingOperation rampDownActionOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withRampDownActionOnDisconnect(SessionHandlingOperation rampDownActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -449,7 +456,7 @@ public ScalingPlanPersonalSchedulePatch withRampDownActionOnDisconnect( /** * Get the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnDisconnect value. */ public Integer rampDownMinutesToWaitOnDisconnect() { @@ -459,12 +466,12 @@ public Integer rampDownMinutesToWaitOnDisconnect() { /** * Set the rampDownMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the ramp down period. - * + * * @param rampDownMinutesToWaitOnDisconnect the rampDownMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withRampDownMinutesToWaitOnDisconnect( - Integer rampDownMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withRampDownMinutesToWaitOnDisconnect(Integer rampDownMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -474,7 +481,7 @@ public ScalingPlanPersonalSchedulePatch withRampDownMinutesToWaitOnDisconnect( /** * Get the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @return the rampDownActionOnLogoff value. */ public SessionHandlingOperation rampDownActionOnLogoff() { @@ -483,12 +490,12 @@ public SessionHandlingOperation rampDownActionOnLogoff() { /** * Set the rampDownActionOnLogoff property: Action to be taken after a logoff during the ramp down period. - * + * * @param rampDownActionOnLogoff the rampDownActionOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withRampDownActionOnLogoff( - SessionHandlingOperation rampDownActionOnLogoff) { + public ScalingPlanPersonalSchedulePatch + withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -499,7 +506,7 @@ public ScalingPlanPersonalSchedulePatch withRampDownActionOnLogoff( /** * Get the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp down period. - * + * * @return the rampDownMinutesToWaitOnLogoff value. */ public Integer rampDownMinutesToWaitOnLogoff() { @@ -509,7 +516,7 @@ public Integer rampDownMinutesToWaitOnLogoff() { /** * Set the rampDownMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the ramp down period. - * + * * @param rampDownMinutesToWaitOnLogoff the rampDownMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -523,7 +530,7 @@ public ScalingPlanPersonalSchedulePatch withRampDownMinutesToWaitOnLogoff(Intege /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -532,7 +539,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -547,7 +554,7 @@ public ScalingPlanPersonalSchedulePatch withOffPeakStartTime(Time offPeakStartTi /** * Get the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @return the offPeakStartVMOnConnect value. */ public SetStartVMOnConnect offPeakStartVMOnConnect() { @@ -557,7 +564,7 @@ public SetStartVMOnConnect offPeakStartVMOnConnect() { /** * Set the offPeakStartVMOnConnect property: The desired configuration of Start VM On Connect for the hostpool * during the off-peak phase. - * + * * @param offPeakStartVMOnConnect the offPeakStartVMOnConnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -572,7 +579,7 @@ public ScalingPlanPersonalSchedulePatch withOffPeakStartVMOnConnect(SetStartVMOn /** * Get the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @return the offPeakActionOnDisconnect value. */ public SessionHandlingOperation offPeakActionOnDisconnect() { @@ -582,12 +589,12 @@ public SessionHandlingOperation offPeakActionOnDisconnect() { /** * Set the offPeakActionOnDisconnect property: Action to be taken after a user disconnect during the off-peak * period. - * + * * @param offPeakActionOnDisconnect the offPeakActionOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withOffPeakActionOnDisconnect( - SessionHandlingOperation offPeakActionOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withOffPeakActionOnDisconnect(SessionHandlingOperation offPeakActionOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -598,7 +605,7 @@ public ScalingPlanPersonalSchedulePatch withOffPeakActionOnDisconnect( /** * Get the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnDisconnect value. */ public Integer offPeakMinutesToWaitOnDisconnect() { @@ -608,12 +615,12 @@ public Integer offPeakMinutesToWaitOnDisconnect() { /** * Set the offPeakMinutesToWaitOnDisconnect property: The time in minutes to wait before performing the desired * session handling action when a user disconnects during the off-peak period. - * + * * @param offPeakMinutesToWaitOnDisconnect the offPeakMinutesToWaitOnDisconnect value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ - public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnDisconnect( - Integer offPeakMinutesToWaitOnDisconnect) { + public ScalingPlanPersonalSchedulePatch + withOffPeakMinutesToWaitOnDisconnect(Integer offPeakMinutesToWaitOnDisconnect) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPersonalScheduleProperties(); } @@ -623,7 +630,7 @@ public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnDisconnect( /** * Get the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @return the offPeakActionOnLogoff value. */ public SessionHandlingOperation offPeakActionOnLogoff() { @@ -632,7 +639,7 @@ public SessionHandlingOperation offPeakActionOnLogoff() { /** * Set the offPeakActionOnLogoff property: Action to be taken after a logoff during the off-peak period. - * + * * @param offPeakActionOnLogoff the offPeakActionOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -647,7 +654,7 @@ public ScalingPlanPersonalSchedulePatch withOffPeakActionOnLogoff(SessionHandlin /** * Get the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @return the offPeakMinutesToWaitOnLogoff value. */ public Integer offPeakMinutesToWaitOnLogoff() { @@ -657,7 +664,7 @@ public Integer offPeakMinutesToWaitOnLogoff() { /** * Set the offPeakMinutesToWaitOnLogoff property: The time in minutes to wait before performing the desired session * handling action when a user logs off during the off-peak period. - * + * * @param offPeakMinutesToWaitOnLogoff the offPeakMinutesToWaitOnLogoff value to set. * @return the ScalingPlanPersonalSchedulePatch object itself. */ @@ -671,7 +678,7 @@ public ScalingPlanPersonalSchedulePatch withOffPeakMinutesToWaitOnLogoff(Integer /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -679,4 +686,42 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPersonalSchedulePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPersonalSchedulePatch if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPersonalSchedulePatch. + */ + public static ScalingPlanPersonalSchedulePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPersonalSchedulePatch deserializedScalingPlanPersonalSchedulePatch + = new ScalingPlanPersonalSchedulePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedScalingPlanPersonalSchedulePatch.innerProperties + = ScalingPlanPersonalScheduleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPersonalSchedulePatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java index 5c8b0790049a..5d529134a8a8 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPersonalSchedules.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ScalingPlanPersonalSchedules. */ +/** + * Resource collection API of ScalingPlanPersonalSchedules. + */ public interface ScalingPlanPersonalSchedules { /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -22,12 +24,12 @@ public interface ScalingPlanPersonalSchedules { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a ScalingPlanPersonalSchedule along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context); /** * Get a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -40,7 +42,7 @@ Response getWithResponse( /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -50,12 +52,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -67,7 +69,7 @@ Response deleteWithResponse( /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +81,7 @@ Response deleteWithResponse( /** * List ScalingPlanPersonalSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -91,17 +93,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * Get a ScalingPlanPersonalSchedule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,7 +109,7 @@ PagedIterable list( /** * Get a ScalingPlanPersonalSchedule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +121,7 @@ PagedIterable list( /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,7 +131,7 @@ PagedIterable list( /** * Remove a ScalingPlanPersonalSchedule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,7 +143,7 @@ PagedIterable list( /** * Begins definition for a new ScalingPlanPersonalSchedule resource. - * + * * @param name resource name. * @return the first stage of the new ScalingPlanPersonalSchedule definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java index 9217dd0d945f..3d39aa051a9b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedule.java @@ -9,158 +9,160 @@ import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; import java.util.List; -/** An immutable client-side representation of ScalingPlanPooledSchedule. */ +/** + * An immutable client-side representation of ScalingPlanPooledSchedule. + */ public interface ScalingPlanPooledSchedule { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ List daysOfWeek(); /** * Gets the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ Time rampUpStartTime(); /** * Gets the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @return the rampUpLoadBalancingAlgorithm value. */ SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm(); /** * Gets the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @return the rampUpMinimumHostsPct value. */ Integer rampUpMinimumHostsPct(); /** * Gets the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @return the rampUpCapacityThresholdPct value. */ Integer rampUpCapacityThresholdPct(); /** * Gets the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ Time peakStartTime(); /** * Gets the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @return the peakLoadBalancingAlgorithm value. */ SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm(); /** * Gets the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ Time rampDownStartTime(); /** * Gets the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @return the rampDownLoadBalancingAlgorithm value. */ SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm(); /** * Gets the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @return the rampDownMinimumHostsPct value. */ Integer rampDownMinimumHostsPct(); /** * Gets the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @return the rampDownCapacityThresholdPct value. */ Integer rampDownCapacityThresholdPct(); /** * Gets the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @return the rampDownForceLogoffUsers value. */ Boolean rampDownForceLogoffUsers(); /** * Gets the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @return the rampDownStopHostsWhen value. */ StopHostsWhen rampDownStopHostsWhen(); /** * Gets the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @return the rampDownWaitTimeMinutes value. */ Integer rampDownWaitTimeMinutes(); /** * Gets the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @return the rampDownNotificationMessage value. */ String rampDownNotificationMessage(); /** * Gets the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ Time offPeakStartTime(); /** * Gets the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @return the offPeakLoadBalancingAlgorithm value. */ SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); @@ -168,27 +170,35 @@ public interface ScalingPlanPooledSchedule { /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner * object. - * + * * @return the inner object. */ ScalingPlanPooledScheduleInner innerModel(); - /** The entirety of the ScalingPlanPooledSchedule definition. */ + /** + * The entirety of the ScalingPlanPooledSchedule definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The ScalingPlanPooledSchedule definition stages. */ + /** + * The ScalingPlanPooledSchedule definition stages. + */ interface DefinitionStages { - /** The first stage of the ScalingPlanPooledSchedule definition. */ + /** + * The first stage of the ScalingPlanPooledSchedule definition. + */ interface Blank extends WithParentResource { } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify parent resource. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, scalingPlanName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @return the next definition stage. @@ -200,459 +210,513 @@ interface WithParentResource { * The stage of the ScalingPlanPooledSchedule definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithDaysOfWeek, - DefinitionStages.WithRampUpStartTime, - DefinitionStages.WithRampUpLoadBalancingAlgorithm, - DefinitionStages.WithRampUpMinimumHostsPct, - DefinitionStages.WithRampUpCapacityThresholdPct, - DefinitionStages.WithPeakStartTime, - DefinitionStages.WithPeakLoadBalancingAlgorithm, - DefinitionStages.WithRampDownStartTime, - DefinitionStages.WithRampDownLoadBalancingAlgorithm, - DefinitionStages.WithRampDownMinimumHostsPct, - DefinitionStages.WithRampDownCapacityThresholdPct, - DefinitionStages.WithRampDownForceLogoffUsers, - DefinitionStages.WithRampDownStopHostsWhen, - DefinitionStages.WithRampDownWaitTimeMinutes, - DefinitionStages.WithRampDownNotificationMessage, - DefinitionStages.WithOffPeakStartTime, - DefinitionStages.WithOffPeakLoadBalancingAlgorithm { + interface WithCreate extends DefinitionStages.WithDaysOfWeek, DefinitionStages.WithRampUpStartTime, + DefinitionStages.WithRampUpLoadBalancingAlgorithm, DefinitionStages.WithRampUpMinimumHostsPct, + DefinitionStages.WithRampUpCapacityThresholdPct, DefinitionStages.WithPeakStartTime, + DefinitionStages.WithPeakLoadBalancingAlgorithm, DefinitionStages.WithRampDownStartTime, + DefinitionStages.WithRampDownLoadBalancingAlgorithm, DefinitionStages.WithRampDownMinimumHostsPct, + DefinitionStages.WithRampDownCapacityThresholdPct, DefinitionStages.WithRampDownForceLogoffUsers, + DefinitionStages.WithRampDownStopHostsWhen, DefinitionStages.WithRampDownWaitTimeMinutes, + DefinitionStages.WithRampDownNotificationMessage, DefinitionStages.WithOffPeakStartTime, + DefinitionStages.WithOffPeakLoadBalancingAlgorithm { /** * Executes the create request. - * + * * @return the created resource. */ ScalingPlanPooledSchedule create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ScalingPlanPooledSchedule create(Context context); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify daysOfWeek. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify daysOfWeek. + */ interface WithDaysOfWeek { /** * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. - * + * * @param daysOfWeek Set of days of the week on which this schedule is active. * @return the next definition stage. */ WithCreate withDaysOfWeek(List daysOfWeek); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpStartTime. + */ interface WithRampUpStartTime { /** * Specifies the rampUpStartTime property: Starting time for ramp up period.. - * + * * @param rampUpStartTime Starting time for ramp up period. * @return the next definition stage. */ WithCreate withRampUpStartTime(Time rampUpStartTime); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpLoadBalancingAlgorithm. + */ interface WithRampUpLoadBalancingAlgorithm { /** * Specifies the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period.. - * + * * @param rampUpLoadBalancingAlgorithm Load balancing algorithm for ramp up period. * @return the next definition stage. */ WithCreate withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpMinimumHostsPct. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpMinimumHostsPct. + */ interface WithRampUpMinimumHostsPct { /** * Specifies the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period.. - * + * * @param rampUpMinimumHostsPct Minimum host percentage for ramp up period. * @return the next definition stage. */ WithCreate withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpCapacityThresholdPct. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampUpCapacityThresholdPct. + */ interface WithRampUpCapacityThresholdPct { /** * Specifies the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.. - * + * * @param rampUpCapacityThresholdPct Capacity threshold for ramp up period. * @return the next definition stage. */ WithCreate withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify peakStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakStartTime. + */ interface WithPeakStartTime { /** * Specifies the peakStartTime property: Starting time for peak period.. - * + * * @param peakStartTime Starting time for peak period. * @return the next definition stage. */ WithCreate withPeakStartTime(Time peakStartTime); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify peakLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify peakLoadBalancingAlgorithm. + */ interface WithPeakLoadBalancingAlgorithm { /** * Specifies the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period.. - * + * * @param peakLoadBalancingAlgorithm Load balancing algorithm for peak period. * @return the next definition stage. */ WithCreate withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStartTime. + */ interface WithRampDownStartTime { /** * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * + * * @param rampDownStartTime Starting time for ramp down period. * @return the next definition stage. */ WithCreate withRampDownStartTime(Time rampDownStartTime); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownLoadBalancingAlgorithm. + */ interface WithRampDownLoadBalancingAlgorithm { /** * Specifies the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period.. - * + * * @param rampDownLoadBalancingAlgorithm Load balancing algorithm for ramp down period. * @return the next definition stage. */ - WithCreate withRampDownLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); + WithCreate + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownMinimumHostsPct. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownMinimumHostsPct. + */ interface WithRampDownMinimumHostsPct { /** * Specifies the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period.. - * + * * @param rampDownMinimumHostsPct Minimum host percentage for ramp down period. * @return the next definition stage. */ WithCreate withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownCapacityThresholdPct. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownCapacityThresholdPct. + */ interface WithRampDownCapacityThresholdPct { /** * Specifies the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.. - * + * * @param rampDownCapacityThresholdPct Capacity threshold for ramp down period. * @return the next definition stage. */ WithCreate withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownForceLogoffUsers. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownForceLogoffUsers. + */ interface WithRampDownForceLogoffUsers { /** * Specifies the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts.. - * + * * @param rampDownForceLogoffUsers Should users be logged off forcefully from hosts. * @return the next definition stage. */ WithCreate withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStopHostsWhen. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownStopHostsWhen. + */ interface WithRampDownStopHostsWhen { /** * Specifies the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period.. - * + * * @param rampDownStopHostsWhen Specifies when to stop hosts during ramp down period. * @return the next definition stage. */ WithCreate withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownWaitTimeMinutes. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownWaitTimeMinutes. + */ interface WithRampDownWaitTimeMinutes { /** * Specifies the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down * period.. - * + * * @param rampDownWaitTimeMinutes Number of minutes to wait to stop hosts during ramp down period. * @return the next definition stage. */ WithCreate withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownNotificationMessage. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify rampDownNotificationMessage. + */ interface WithRampDownNotificationMessage { /** * Specifies the rampDownNotificationMessage property: Notification message for users during ramp down * period.. - * + * * @param rampDownNotificationMessage Notification message for users during ramp down period. * @return the next definition stage. */ WithCreate withRampDownNotificationMessage(String rampDownNotificationMessage); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakStartTime. + */ interface WithOffPeakStartTime { /** * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * + * * @param offPeakStartTime Starting time for off-peak period. * @return the next definition stage. */ WithCreate withOffPeakStartTime(Time offPeakStartTime); } - /** The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule definition allowing to specify offPeakLoadBalancingAlgorithm. + */ interface WithOffPeakLoadBalancingAlgorithm { /** * Specifies the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.. - * + * * @param offPeakLoadBalancingAlgorithm Load balancing algorithm for off-peak period. * @return the next definition stage. */ - WithCreate withOffPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm); + WithCreate + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm); } } /** * Begins update for the ScalingPlanPooledSchedule resource. - * + * * @return the stage of resource update. */ ScalingPlanPooledSchedule.Update update(); - /** The template for ScalingPlanPooledSchedule update. */ - interface Update - extends UpdateStages.WithDaysOfWeek, - UpdateStages.WithRampUpStartTime, - UpdateStages.WithRampUpLoadBalancingAlgorithm, - UpdateStages.WithRampUpMinimumHostsPct, - UpdateStages.WithRampUpCapacityThresholdPct, - UpdateStages.WithPeakStartTime, - UpdateStages.WithPeakLoadBalancingAlgorithm, - UpdateStages.WithRampDownStartTime, - UpdateStages.WithRampDownLoadBalancingAlgorithm, - UpdateStages.WithRampDownMinimumHostsPct, - UpdateStages.WithRampDownCapacityThresholdPct, - UpdateStages.WithRampDownForceLogoffUsers, - UpdateStages.WithRampDownStopHostsWhen, - UpdateStages.WithRampDownWaitTimeMinutes, - UpdateStages.WithRampDownNotificationMessage, - UpdateStages.WithOffPeakStartTime, - UpdateStages.WithOffPeakLoadBalancingAlgorithm { + /** + * The template for ScalingPlanPooledSchedule update. + */ + interface Update extends UpdateStages.WithDaysOfWeek, UpdateStages.WithRampUpStartTime, + UpdateStages.WithRampUpLoadBalancingAlgorithm, UpdateStages.WithRampUpMinimumHostsPct, + UpdateStages.WithRampUpCapacityThresholdPct, UpdateStages.WithPeakStartTime, + UpdateStages.WithPeakLoadBalancingAlgorithm, UpdateStages.WithRampDownStartTime, + UpdateStages.WithRampDownLoadBalancingAlgorithm, UpdateStages.WithRampDownMinimumHostsPct, + UpdateStages.WithRampDownCapacityThresholdPct, UpdateStages.WithRampDownForceLogoffUsers, + UpdateStages.WithRampDownStopHostsWhen, UpdateStages.WithRampDownWaitTimeMinutes, + UpdateStages.WithRampDownNotificationMessage, UpdateStages.WithOffPeakStartTime, + UpdateStages.WithOffPeakLoadBalancingAlgorithm { /** * Executes the update request. - * + * * @return the updated resource. */ ScalingPlanPooledSchedule apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ScalingPlanPooledSchedule apply(Context context); } - /** The ScalingPlanPooledSchedule update stages. */ + /** + * The ScalingPlanPooledSchedule update stages. + */ interface UpdateStages { - /** The stage of the ScalingPlanPooledSchedule update allowing to specify daysOfWeek. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify daysOfWeek. + */ interface WithDaysOfWeek { /** * Specifies the daysOfWeek property: Set of days of the week on which this schedule is active.. - * + * * @param daysOfWeek Set of days of the week on which this schedule is active. * @return the next definition stage. */ Update withDaysOfWeek(List daysOfWeek); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpStartTime. + */ interface WithRampUpStartTime { /** * Specifies the rampUpStartTime property: Starting time for ramp up period.. - * + * * @param rampUpStartTime Starting time for ramp up period. * @return the next definition stage. */ Update withRampUpStartTime(Time rampUpStartTime); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpLoadBalancingAlgorithm. + */ interface WithRampUpLoadBalancingAlgorithm { /** * Specifies the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period.. - * + * * @param rampUpLoadBalancingAlgorithm Load balancing algorithm for ramp up period. * @return the next definition stage. */ Update withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpMinimumHostsPct. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpMinimumHostsPct. + */ interface WithRampUpMinimumHostsPct { /** * Specifies the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period.. - * + * * @param rampUpMinimumHostsPct Minimum host percentage for ramp up period. * @return the next definition stage. */ Update withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpCapacityThresholdPct. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampUpCapacityThresholdPct. + */ interface WithRampUpCapacityThresholdPct { /** * Specifies the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.. - * + * * @param rampUpCapacityThresholdPct Capacity threshold for ramp up period. * @return the next definition stage. */ Update withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify peakStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify peakStartTime. + */ interface WithPeakStartTime { /** * Specifies the peakStartTime property: Starting time for peak period.. - * + * * @param peakStartTime Starting time for peak period. * @return the next definition stage. */ Update withPeakStartTime(Time peakStartTime); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify peakLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify peakLoadBalancingAlgorithm. + */ interface WithPeakLoadBalancingAlgorithm { /** * Specifies the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period.. - * + * * @param peakLoadBalancingAlgorithm Load balancing algorithm for peak period. * @return the next definition stage. */ Update withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownStartTime. + */ interface WithRampDownStartTime { /** * Specifies the rampDownStartTime property: Starting time for ramp down period.. - * + * * @param rampDownStartTime Starting time for ramp down period. * @return the next definition stage. */ Update withRampDownStartTime(Time rampDownStartTime); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownLoadBalancingAlgorithm. + */ interface WithRampDownLoadBalancingAlgorithm { /** * Specifies the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period.. - * + * * @param rampDownLoadBalancingAlgorithm Load balancing algorithm for ramp down period. * @return the next definition stage. */ Update withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownMinimumHostsPct. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownMinimumHostsPct. + */ interface WithRampDownMinimumHostsPct { /** * Specifies the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period.. - * + * * @param rampDownMinimumHostsPct Minimum host percentage for ramp down period. * @return the next definition stage. */ Update withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownCapacityThresholdPct. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownCapacityThresholdPct. + */ interface WithRampDownCapacityThresholdPct { /** * Specifies the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.. - * + * * @param rampDownCapacityThresholdPct Capacity threshold for ramp down period. * @return the next definition stage. */ Update withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownForceLogoffUsers. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownForceLogoffUsers. + */ interface WithRampDownForceLogoffUsers { /** * Specifies the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts.. - * + * * @param rampDownForceLogoffUsers Should users be logged off forcefully from hosts. * @return the next definition stage. */ Update withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownStopHostsWhen. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownStopHostsWhen. + */ interface WithRampDownStopHostsWhen { /** * Specifies the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period.. - * + * * @param rampDownStopHostsWhen Specifies when to stop hosts during ramp down period. * @return the next definition stage. */ Update withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownWaitTimeMinutes. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownWaitTimeMinutes. + */ interface WithRampDownWaitTimeMinutes { /** * Specifies the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down * period.. - * + * * @param rampDownWaitTimeMinutes Number of minutes to wait to stop hosts during ramp down period. * @return the next definition stage. */ Update withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownNotificationMessage. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify rampDownNotificationMessage. + */ interface WithRampDownNotificationMessage { /** * Specifies the rampDownNotificationMessage property: Notification message for users during ramp down * period.. - * + * * @param rampDownNotificationMessage Notification message for users during ramp down period. * @return the next definition stage. */ Update withRampDownNotificationMessage(String rampDownNotificationMessage); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify offPeakStartTime. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify offPeakStartTime. + */ interface WithOffPeakStartTime { /** * Specifies the offPeakStartTime property: Starting time for off-peak period.. - * + * * @param offPeakStartTime Starting time for off-peak period. * @return the next definition stage. */ Update withOffPeakStartTime(Time offPeakStartTime); } - /** The stage of the ScalingPlanPooledSchedule update allowing to specify offPeakLoadBalancingAlgorithm. */ + /** + * The stage of the ScalingPlanPooledSchedule update allowing to specify offPeakLoadBalancingAlgorithm. + */ interface WithOffPeakLoadBalancingAlgorithm { /** * Specifies the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.. - * + * * @param offPeakLoadBalancingAlgorithm Load balancing algorithm for off-peak period. * @return the next definition stage. */ @@ -662,14 +726,14 @@ interface WithOffPeakLoadBalancingAlgorithm { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ScalingPlanPooledSchedule refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java index ef6ffd32c6f8..7395266343a5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledScheduleList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * ScalingPlanPooledScheduleList - * - *

List of ScalingPlanPooledSchedule definitions. + * + * List of ScalingPlanPooledSchedule definitions. */ @Fluent -public final class ScalingPlanPooledScheduleList { +public final class ScalingPlanPooledScheduleList implements JsonSerializable { /* * List of ScalingPlanPooledSchedule 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; - /** Creates an instance of ScalingPlanPooledScheduleList class. */ + /** + * Creates an instance of ScalingPlanPooledScheduleList class. + */ public ScalingPlanPooledScheduleList() { } /** * Get the value property: List of ScalingPlanPooledSchedule definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of ScalingPlanPooledSchedule definitions. - * + * * @param value the value value to set. * @return the ScalingPlanPooledScheduleList object itself. */ @@ -54,7 +58,7 @@ public ScalingPlanPooledScheduleList withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPooledScheduleList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPooledScheduleList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingPlanPooledScheduleList. + */ + public static ScalingPlanPooledScheduleList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPooledScheduleList deserializedScalingPlanPooledScheduleList + = new ScalingPlanPooledScheduleList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ScalingPlanPooledScheduleInner.fromJson(reader1)); + deserializedScalingPlanPooledScheduleList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedScalingPlanPooledScheduleList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPooledScheduleList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java index ac5373c62d05..6bdc14b780b1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedulePatch.java @@ -6,35 +6,101 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPooledScheduleProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** ScalingPlanPooledSchedule properties that can be patched. */ +/** + * ScalingPlanPooledSchedule properties that can be patched. + */ @Fluent public final class ScalingPlanPooledSchedulePatch extends ProxyResource { /* * Detailed properties for ScalingPlanPooledSchedule */ - @JsonProperty(value = "properties") private ScalingPlanPooledScheduleProperties innerProperties; - /** Creates an instance of ScalingPlanPooledSchedulePatch class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ScalingPlanPooledSchedulePatch class. + */ public ScalingPlanPooledSchedulePatch() { } /** * Get the innerProperties property: Detailed properties for ScalingPlanPooledSchedule. - * + * * @return the innerProperties value. */ private ScalingPlanPooledScheduleProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -43,7 +109,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -57,7 +123,7 @@ public ScalingPlanPooledSchedulePatch withDaysOfWeek(List daysOfWeek) /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -66,7 +132,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -80,7 +146,7 @@ public ScalingPlanPooledSchedulePatch withRampUpStartTime(Time rampUpStartTime) /** * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @return the rampUpLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { @@ -89,12 +155,12 @@ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { /** * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ - public ScalingPlanPooledSchedulePatch withRampUpLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + public ScalingPlanPooledSchedulePatch + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -104,7 +170,7 @@ public ScalingPlanPooledSchedulePatch withRampUpLoadBalancingAlgorithm( /** * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @return the rampUpMinimumHostsPct value. */ public Integer rampUpMinimumHostsPct() { @@ -113,7 +179,7 @@ public Integer rampUpMinimumHostsPct() { /** * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -127,7 +193,7 @@ public ScalingPlanPooledSchedulePatch withRampUpMinimumHostsPct(Integer rampUpMi /** * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @return the rampUpCapacityThresholdPct value. */ public Integer rampUpCapacityThresholdPct() { @@ -136,7 +202,7 @@ public Integer rampUpCapacityThresholdPct() { /** * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -150,7 +216,7 @@ public ScalingPlanPooledSchedulePatch withRampUpCapacityThresholdPct(Integer ram /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -159,7 +225,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -173,7 +239,7 @@ public ScalingPlanPooledSchedulePatch withPeakStartTime(Time peakStartTime) { /** * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @return the peakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { @@ -182,12 +248,12 @@ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { /** * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ - public ScalingPlanPooledSchedulePatch withPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + public ScalingPlanPooledSchedulePatch + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -197,7 +263,7 @@ public ScalingPlanPooledSchedulePatch withPeakLoadBalancingAlgorithm( /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -206,7 +272,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -220,7 +286,7 @@ public ScalingPlanPooledSchedulePatch withRampDownStartTime(Time rampDownStartTi /** * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @return the rampDownLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { @@ -229,12 +295,12 @@ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { /** * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ - public ScalingPlanPooledSchedulePatch withRampDownLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + public ScalingPlanPooledSchedulePatch + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -244,7 +310,7 @@ public ScalingPlanPooledSchedulePatch withRampDownLoadBalancingAlgorithm( /** * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @return the rampDownMinimumHostsPct value. */ public Integer rampDownMinimumHostsPct() { @@ -253,7 +319,7 @@ public Integer rampDownMinimumHostsPct() { /** * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -267,7 +333,7 @@ public ScalingPlanPooledSchedulePatch withRampDownMinimumHostsPct(Integer rampDo /** * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @return the rampDownCapacityThresholdPct value. */ public Integer rampDownCapacityThresholdPct() { @@ -276,7 +342,7 @@ public Integer rampDownCapacityThresholdPct() { /** * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -290,7 +356,7 @@ public ScalingPlanPooledSchedulePatch withRampDownCapacityThresholdPct(Integer r /** * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @return the rampDownForceLogoffUsers value. */ public Boolean rampDownForceLogoffUsers() { @@ -299,7 +365,7 @@ public Boolean rampDownForceLogoffUsers() { /** * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -313,7 +379,7 @@ public ScalingPlanPooledSchedulePatch withRampDownForceLogoffUsers(Boolean rampD /** * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @return the rampDownStopHostsWhen value. */ public StopHostsWhen rampDownStopHostsWhen() { @@ -322,7 +388,7 @@ public StopHostsWhen rampDownStopHostsWhen() { /** * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -336,7 +402,7 @@ public ScalingPlanPooledSchedulePatch withRampDownStopHostsWhen(StopHostsWhen ra /** * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @return the rampDownWaitTimeMinutes value. */ public Integer rampDownWaitTimeMinutes() { @@ -345,7 +411,7 @@ public Integer rampDownWaitTimeMinutes() { /** * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -359,7 +425,7 @@ public ScalingPlanPooledSchedulePatch withRampDownWaitTimeMinutes(Integer rampDo /** * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @return the rampDownNotificationMessage value. */ public String rampDownNotificationMessage() { @@ -368,7 +434,7 @@ public String rampDownNotificationMessage() { /** * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -382,7 +448,7 @@ public ScalingPlanPooledSchedulePatch withRampDownNotificationMessage(String ram /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -391,7 +457,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ @@ -405,7 +471,7 @@ public ScalingPlanPooledSchedulePatch withOffPeakStartTime(Time offPeakStartTime /** * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @return the offPeakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { @@ -414,12 +480,12 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { /** * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. * @return the ScalingPlanPooledSchedulePatch object itself. */ - public ScalingPlanPooledSchedulePatch withOffPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + public ScalingPlanPooledSchedulePatch + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { if (this.innerProperties() == null) { this.innerProperties = new ScalingPlanPooledScheduleProperties(); } @@ -429,7 +495,7 @@ public ScalingPlanPooledSchedulePatch withOffPeakLoadBalancingAlgorithm( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -437,4 +503,51 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingPlanPooledSchedulePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingPlanPooledSchedulePatch if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScalingPlanPooledSchedulePatch. + */ + public static ScalingPlanPooledSchedulePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingPlanPooledSchedulePatch deserializedScalingPlanPooledSchedulePatch + = new ScalingPlanPooledSchedulePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatch.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatch.innerProperties + = ScalingPlanPooledScheduleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedScalingPlanPooledSchedulePatch.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingPlanPooledSchedulePatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java index 282d38e9b4b5..47a01b94e020 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlanPooledSchedules.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ScalingPlanPooledSchedules. */ +/** + * Resource collection API of ScalingPlanPooledSchedules. + */ public interface ScalingPlanPooledSchedules { /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -22,12 +24,12 @@ public interface ScalingPlanPooledSchedules { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a ScalingPlanPooledSchedule along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response getWithResponse(String resourceGroupName, String scalingPlanName, + String scalingPlanScheduleName, Context context); /** * Get a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -40,7 +42,7 @@ Response getWithResponse( /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -50,12 +52,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context); + Response deleteWithResponse(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, + Context context); /** * Remove a ScalingPlanPooledSchedule. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param scalingPlanScheduleName The name of the ScalingPlanSchedule. @@ -67,7 +69,7 @@ Response deleteWithResponse( /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +81,7 @@ Response deleteWithResponse( /** * List ScalingPlanPooledSchedules. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param pageSize Number of items per page. @@ -91,17 +93,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanPooledScheduleList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String scalingPlanName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String scalingPlanName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * Get a ScalingPlanPooledSchedule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,7 +109,7 @@ PagedIterable list( /** * Get a ScalingPlanPooledSchedule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +121,7 @@ PagedIterable list( /** * Remove a ScalingPlanPooledSchedule. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,7 +131,7 @@ PagedIterable list( /** * Remove a ScalingPlanPooledSchedule. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,7 +143,7 @@ PagedIterable list( /** * Begins definition for a new ScalingPlanPooledSchedule resource. - * + * * @param name resource name. * @return the first stage of the new ScalingPlanPooledSchedule definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java index efce89a0a941..c7be030bdd61 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingPlans.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ScalingPlans. */ +/** + * Resource collection API of ScalingPlans. + */ public interface ScalingPlans { /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -21,12 +23,12 @@ public interface ScalingPlans { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a scaling plan along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String scalingPlanName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String scalingPlanName, + Context context); /** * Get a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -38,7 +40,7 @@ Response getByResourceGroupWithResponse( /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @param context The context to associate with this operation. @@ -51,7 +53,7 @@ Response getByResourceGroupWithResponse( /** * Remove a scaling plan. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scalingPlanName The name of the scaling plan. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -62,7 +64,7 @@ Response getByResourceGroupWithResponse( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -73,7 +75,7 @@ Response getByResourceGroupWithResponse( /** * List scaling plans. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -84,12 +86,12 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** * List scaling plans in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedIterable}. @@ -98,7 +100,7 @@ PagedIterable listByResourceGroup( /** * List scaling plans in subscription. - * + * * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. * @param initialSkip Initial number of items to skip. @@ -112,7 +114,7 @@ PagedIterable listByResourceGroup( /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +126,7 @@ PagedIterable listByResourceGroup( /** * List scaling plan associated with hostpool. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param hostPoolName The name of the host pool within the specified resource group. * @param pageSize Number of items per page. @@ -136,17 +138,12 @@ PagedIterable listByResourceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return scalingPlanList as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); /** * Get a scaling plan. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -157,7 +154,7 @@ PagedIterable listByHostPool( /** * Get a scaling plan. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -169,7 +166,7 @@ PagedIterable listByHostPool( /** * Remove a scaling plan. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -179,7 +176,7 @@ PagedIterable listByHostPool( /** * Remove a scaling plan. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -191,7 +188,7 @@ PagedIterable listByHostPool( /** * Begins definition for a new ScalingPlan resource. - * + * * @param name resource name. * @return the first stage of the new ScalingPlan definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java index dcf2877f4783..e1ea509a4f64 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingSchedule.java @@ -5,127 +5,117 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** A ScalingPlanPooledSchedule. */ +/** + * A ScalingPlanPooledSchedule. + */ @Fluent -public final class ScalingSchedule { +public final class ScalingSchedule implements JsonSerializable { /* * Name of the ScalingPlanPooledSchedule. */ - @JsonProperty(value = "name") private String name; /* * Set of days of the week on which this schedule is active. */ - @JsonProperty(value = "daysOfWeek") private List daysOfWeek; /* * Starting time for ramp up period. */ - @JsonProperty(value = "rampUpStartTime") private Time rampUpStartTime; /* * Load balancing algorithm for ramp up period. */ - @JsonProperty(value = "rampUpLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm; /* * Minimum host percentage for ramp up period. */ - @JsonProperty(value = "rampUpMinimumHostsPct") private Integer rampUpMinimumHostsPct; /* * Capacity threshold for ramp up period. */ - @JsonProperty(value = "rampUpCapacityThresholdPct") private Integer rampUpCapacityThresholdPct; /* * Starting time for peak period. */ - @JsonProperty(value = "peakStartTime") private Time peakStartTime; /* * Load balancing algorithm for peak period. */ - @JsonProperty(value = "peakLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm; /* * Starting time for ramp down period. */ - @JsonProperty(value = "rampDownStartTime") private Time rampDownStartTime; /* * Load balancing algorithm for ramp down period. */ - @JsonProperty(value = "rampDownLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm; /* * Minimum host percentage for ramp down period. */ - @JsonProperty(value = "rampDownMinimumHostsPct") private Integer rampDownMinimumHostsPct; /* * Capacity threshold for ramp down period. */ - @JsonProperty(value = "rampDownCapacityThresholdPct") private Integer rampDownCapacityThresholdPct; /* * Should users be logged off forcefully from hosts. */ - @JsonProperty(value = "rampDownForceLogoffUsers") private Boolean rampDownForceLogoffUsers; /* * Specifies when to stop hosts during ramp down period. */ - @JsonProperty(value = "rampDownStopHostsWhen") private StopHostsWhen rampDownStopHostsWhen; /* * Number of minutes to wait to stop hosts during ramp down period. */ - @JsonProperty(value = "rampDownWaitTimeMinutes") private Integer rampDownWaitTimeMinutes; /* * Notification message for users during ramp down period. */ - @JsonProperty(value = "rampDownNotificationMessage") private String rampDownNotificationMessage; /* * Starting time for off-peak period. */ - @JsonProperty(value = "offPeakStartTime") private Time offPeakStartTime; /* * Load balancing algorithm for off-peak period. */ - @JsonProperty(value = "offPeakLoadBalancingAlgorithm") private SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm; - /** Creates an instance of ScalingSchedule class. */ + /** + * Creates an instance of ScalingSchedule class. + */ public ScalingSchedule() { } /** * Get the name property: Name of the ScalingPlanPooledSchedule. - * + * * @return the name value. */ public String name() { @@ -134,7 +124,7 @@ public String name() { /** * Set the name property: Name of the ScalingPlanPooledSchedule. - * + * * @param name the name value to set. * @return the ScalingSchedule object itself. */ @@ -145,7 +135,7 @@ public ScalingSchedule withName(String name) { /** * Get the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -154,7 +144,7 @@ public List daysOfWeek() { /** * Set the daysOfWeek property: Set of days of the week on which this schedule is active. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the ScalingSchedule object itself. */ @@ -165,7 +155,7 @@ public ScalingSchedule withDaysOfWeek(List daysOf /** * Get the rampUpStartTime property: Starting time for ramp up period. - * + * * @return the rampUpStartTime value. */ public Time rampUpStartTime() { @@ -174,7 +164,7 @@ public Time rampUpStartTime() { /** * Set the rampUpStartTime property: Starting time for ramp up period. - * + * * @param rampUpStartTime the rampUpStartTime value to set. * @return the ScalingSchedule object itself. */ @@ -185,7 +175,7 @@ public ScalingSchedule withRampUpStartTime(Time rampUpStartTime) { /** * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @return the rampUpLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { @@ -194,19 +184,19 @@ public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() { /** * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period. - * + * * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set. * @return the ScalingSchedule object itself. */ - public ScalingSchedule withRampUpLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { + public ScalingSchedule + withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) { this.rampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm; return this; } /** * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @return the rampUpMinimumHostsPct value. */ public Integer rampUpMinimumHostsPct() { @@ -215,7 +205,7 @@ public Integer rampUpMinimumHostsPct() { /** * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period. - * + * * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set. * @return the ScalingSchedule object itself. */ @@ -226,7 +216,7 @@ public ScalingSchedule withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) /** * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @return the rampUpCapacityThresholdPct value. */ public Integer rampUpCapacityThresholdPct() { @@ -235,7 +225,7 @@ public Integer rampUpCapacityThresholdPct() { /** * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period. - * + * * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set. * @return the ScalingSchedule object itself. */ @@ -246,7 +236,7 @@ public ScalingSchedule withRampUpCapacityThresholdPct(Integer rampUpCapacityThre /** * Get the peakStartTime property: Starting time for peak period. - * + * * @return the peakStartTime value. */ public Time peakStartTime() { @@ -255,7 +245,7 @@ public Time peakStartTime() { /** * Set the peakStartTime property: Starting time for peak period. - * + * * @param peakStartTime the peakStartTime value to set. * @return the ScalingSchedule object itself. */ @@ -266,7 +256,7 @@ public ScalingSchedule withPeakStartTime(Time peakStartTime) { /** * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @return the peakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { @@ -275,19 +265,19 @@ public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() { /** * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period. - * + * * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set. * @return the ScalingSchedule object itself. */ - public ScalingSchedule withPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { + public ScalingSchedule + withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) { this.peakLoadBalancingAlgorithm = peakLoadBalancingAlgorithm; return this; } /** * Get the rampDownStartTime property: Starting time for ramp down period. - * + * * @return the rampDownStartTime value. */ public Time rampDownStartTime() { @@ -296,7 +286,7 @@ public Time rampDownStartTime() { /** * Set the rampDownStartTime property: Starting time for ramp down period. - * + * * @param rampDownStartTime the rampDownStartTime value to set. * @return the ScalingSchedule object itself. */ @@ -307,7 +297,7 @@ public ScalingSchedule withRampDownStartTime(Time rampDownStartTime) { /** * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @return the rampDownLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { @@ -316,19 +306,19 @@ public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() { /** * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period. - * + * * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set. * @return the ScalingSchedule object itself. */ - public ScalingSchedule withRampDownLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { + public ScalingSchedule + withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) { this.rampDownLoadBalancingAlgorithm = rampDownLoadBalancingAlgorithm; return this; } /** * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @return the rampDownMinimumHostsPct value. */ public Integer rampDownMinimumHostsPct() { @@ -337,7 +327,7 @@ public Integer rampDownMinimumHostsPct() { /** * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period. - * + * * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set. * @return the ScalingSchedule object itself. */ @@ -348,7 +338,7 @@ public ScalingSchedule withRampDownMinimumHostsPct(Integer rampDownMinimumHostsP /** * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @return the rampDownCapacityThresholdPct value. */ public Integer rampDownCapacityThresholdPct() { @@ -357,7 +347,7 @@ public Integer rampDownCapacityThresholdPct() { /** * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period. - * + * * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set. * @return the ScalingSchedule object itself. */ @@ -368,7 +358,7 @@ public ScalingSchedule withRampDownCapacityThresholdPct(Integer rampDownCapacity /** * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @return the rampDownForceLogoffUsers value. */ public Boolean rampDownForceLogoffUsers() { @@ -377,7 +367,7 @@ public Boolean rampDownForceLogoffUsers() { /** * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts. - * + * * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set. * @return the ScalingSchedule object itself. */ @@ -388,7 +378,7 @@ public ScalingSchedule withRampDownForceLogoffUsers(Boolean rampDownForceLogoffU /** * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @return the rampDownStopHostsWhen value. */ public StopHostsWhen rampDownStopHostsWhen() { @@ -397,7 +387,7 @@ public StopHostsWhen rampDownStopHostsWhen() { /** * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period. - * + * * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set. * @return the ScalingSchedule object itself. */ @@ -408,7 +398,7 @@ public ScalingSchedule withRampDownStopHostsWhen(StopHostsWhen rampDownStopHosts /** * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @return the rampDownWaitTimeMinutes value. */ public Integer rampDownWaitTimeMinutes() { @@ -417,7 +407,7 @@ public Integer rampDownWaitTimeMinutes() { /** * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period. - * + * * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set. * @return the ScalingSchedule object itself. */ @@ -428,7 +418,7 @@ public ScalingSchedule withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinut /** * Get the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @return the rampDownNotificationMessage value. */ public String rampDownNotificationMessage() { @@ -437,7 +427,7 @@ public String rampDownNotificationMessage() { /** * Set the rampDownNotificationMessage property: Notification message for users during ramp down period. - * + * * @param rampDownNotificationMessage the rampDownNotificationMessage value to set. * @return the ScalingSchedule object itself. */ @@ -448,7 +438,7 @@ public ScalingSchedule withRampDownNotificationMessage(String rampDownNotificati /** * Get the offPeakStartTime property: Starting time for off-peak period. - * + * * @return the offPeakStartTime value. */ public Time offPeakStartTime() { @@ -457,7 +447,7 @@ public Time offPeakStartTime() { /** * Set the offPeakStartTime property: Starting time for off-peak period. - * + * * @param offPeakStartTime the offPeakStartTime value to set. * @return the ScalingSchedule object itself. */ @@ -468,7 +458,7 @@ public ScalingSchedule withOffPeakStartTime(Time offPeakStartTime) { /** * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @return the offPeakLoadBalancingAlgorithm value. */ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { @@ -477,19 +467,19 @@ public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() { /** * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period. - * + * * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set. * @return the ScalingSchedule object itself. */ - public ScalingSchedule withOffPeakLoadBalancingAlgorithm( - SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { + public ScalingSchedule + withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) { this.offPeakLoadBalancingAlgorithm = offPeakLoadBalancingAlgorithm; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -506,4 +496,103 @@ public void validate() { offPeakStartTime().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("rampUpStartTime", this.rampUpStartTime); + jsonWriter.writeStringField("rampUpLoadBalancingAlgorithm", + this.rampUpLoadBalancingAlgorithm == null ? null : this.rampUpLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampUpMinimumHostsPct", this.rampUpMinimumHostsPct); + jsonWriter.writeNumberField("rampUpCapacityThresholdPct", this.rampUpCapacityThresholdPct); + jsonWriter.writeJsonField("peakStartTime", this.peakStartTime); + jsonWriter.writeStringField("peakLoadBalancingAlgorithm", + this.peakLoadBalancingAlgorithm == null ? null : this.peakLoadBalancingAlgorithm.toString()); + jsonWriter.writeJsonField("rampDownStartTime", this.rampDownStartTime); + jsonWriter.writeStringField("rampDownLoadBalancingAlgorithm", + this.rampDownLoadBalancingAlgorithm == null ? null : this.rampDownLoadBalancingAlgorithm.toString()); + jsonWriter.writeNumberField("rampDownMinimumHostsPct", this.rampDownMinimumHostsPct); + jsonWriter.writeNumberField("rampDownCapacityThresholdPct", this.rampDownCapacityThresholdPct); + jsonWriter.writeBooleanField("rampDownForceLogoffUsers", this.rampDownForceLogoffUsers); + jsonWriter.writeStringField("rampDownStopHostsWhen", + this.rampDownStopHostsWhen == null ? null : this.rampDownStopHostsWhen.toString()); + jsonWriter.writeNumberField("rampDownWaitTimeMinutes", this.rampDownWaitTimeMinutes); + jsonWriter.writeStringField("rampDownNotificationMessage", this.rampDownNotificationMessage); + jsonWriter.writeJsonField("offPeakStartTime", this.offPeakStartTime); + jsonWriter.writeStringField("offPeakLoadBalancingAlgorithm", + this.offPeakLoadBalancingAlgorithm == null ? null : this.offPeakLoadBalancingAlgorithm.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingSchedule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingSchedule. + */ + public static ScalingSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingSchedule deserializedScalingSchedule = new ScalingSchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedScalingSchedule.name = reader.getString(); + } else if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek + = reader.readArray(reader1 -> ScalingScheduleDaysOfWeekItem.fromString(reader1.getString())); + deserializedScalingSchedule.daysOfWeek = daysOfWeek; + } else if ("rampUpStartTime".equals(fieldName)) { + deserializedScalingSchedule.rampUpStartTime = Time.fromJson(reader); + } else if ("rampUpLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingSchedule.rampUpLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampUpMinimumHostsPct".equals(fieldName)) { + deserializedScalingSchedule.rampUpMinimumHostsPct = reader.getNullable(JsonReader::getInt); + } else if ("rampUpCapacityThresholdPct".equals(fieldName)) { + deserializedScalingSchedule.rampUpCapacityThresholdPct = reader.getNullable(JsonReader::getInt); + } else if ("peakStartTime".equals(fieldName)) { + deserializedScalingSchedule.peakStartTime = Time.fromJson(reader); + } else if ("peakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingSchedule.peakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownStartTime".equals(fieldName)) { + deserializedScalingSchedule.rampDownStartTime = Time.fromJson(reader); + } else if ("rampDownLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingSchedule.rampDownLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else if ("rampDownMinimumHostsPct".equals(fieldName)) { + deserializedScalingSchedule.rampDownMinimumHostsPct = reader.getNullable(JsonReader::getInt); + } else if ("rampDownCapacityThresholdPct".equals(fieldName)) { + deserializedScalingSchedule.rampDownCapacityThresholdPct = reader.getNullable(JsonReader::getInt); + } else if ("rampDownForceLogoffUsers".equals(fieldName)) { + deserializedScalingSchedule.rampDownForceLogoffUsers = reader.getNullable(JsonReader::getBoolean); + } else if ("rampDownStopHostsWhen".equals(fieldName)) { + deserializedScalingSchedule.rampDownStopHostsWhen = StopHostsWhen.fromString(reader.getString()); + } else if ("rampDownWaitTimeMinutes".equals(fieldName)) { + deserializedScalingSchedule.rampDownWaitTimeMinutes = reader.getNullable(JsonReader::getInt); + } else if ("rampDownNotificationMessage".equals(fieldName)) { + deserializedScalingSchedule.rampDownNotificationMessage = reader.getString(); + } else if ("offPeakStartTime".equals(fieldName)) { + deserializedScalingSchedule.offPeakStartTime = Time.fromJson(reader); + } else if ("offPeakLoadBalancingAlgorithm".equals(fieldName)) { + deserializedScalingSchedule.offPeakLoadBalancingAlgorithm + = SessionHostLoadBalancingAlgorithm.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingSchedule; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java index cac2d85a606c..cd565b865f5b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ScalingScheduleDaysOfWeekItem.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ScalingScheduleDaysOfWeekItem. */ +/** + * Defines values for ScalingScheduleDaysOfWeekItem. + */ public final class ScalingScheduleDaysOfWeekItem extends ExpandableStringEnum { - /** Static value Sunday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Sunday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem SUNDAY = fromString("Sunday"); - /** Static value Monday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Monday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem MONDAY = fromString("Monday"); - /** Static value Tuesday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Tuesday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem TUESDAY = fromString("Tuesday"); - /** Static value Wednesday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Wednesday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem WEDNESDAY = fromString("Wednesday"); - /** Static value Thursday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Thursday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem THURSDAY = fromString("Thursday"); - /** Static value Friday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Friday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem FRIDAY = fromString("Friday"); - /** Static value Saturday for ScalingScheduleDaysOfWeekItem. */ + /** + * Static value Saturday for ScalingScheduleDaysOfWeekItem. + */ public static final ScalingScheduleDaysOfWeekItem SATURDAY = fromString("Saturday"); /** * Creates a new instance of ScalingScheduleDaysOfWeekItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public ScalingScheduleDaysOfWeekItem() { /** * Creates or finds a ScalingScheduleDaysOfWeekItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding ScalingScheduleDaysOfWeekItem. */ - @JsonCreator public static ScalingScheduleDaysOfWeekItem fromString(String name) { return fromString(name, ScalingScheduleDaysOfWeekItem.class); } /** * Gets known ScalingScheduleDaysOfWeekItem values. - * + * * @return known ScalingScheduleDaysOfWeekItem values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java index 83d0d8e3b8bf..0f7f4120dc1e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SendMessage.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Represents message sent to a UserSession. */ +/** + * Represents message sent to a UserSession. + */ @Fluent -public final class SendMessage { +public final class SendMessage implements JsonSerializable { /* * Title of message. */ - @JsonProperty(value = "messageTitle") private String messageTitle; /* * Body of message. */ - @JsonProperty(value = "messageBody") private String messageBody; - /** Creates an instance of SendMessage class. */ + /** + * Creates an instance of SendMessage class. + */ public SendMessage() { } /** * Get the messageTitle property: Title of message. - * + * * @return the messageTitle value. */ public String messageTitle() { @@ -37,7 +43,7 @@ public String messageTitle() { /** * Set the messageTitle property: Title of message. - * + * * @param messageTitle the messageTitle value to set. * @return the SendMessage object itself. */ @@ -48,7 +54,7 @@ public SendMessage withMessageTitle(String messageTitle) { /** * Get the messageBody property: Body of message. - * + * * @return the messageBody value. */ public String messageBody() { @@ -57,7 +63,7 @@ public String messageBody() { /** * Set the messageBody property: Body of message. - * + * * @param messageBody the messageBody value to set. * @return the SendMessage object itself. */ @@ -68,9 +74,48 @@ public SendMessage withMessageBody(String messageBody) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("messageTitle", this.messageTitle); + jsonWriter.writeStringField("messageBody", this.messageBody); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SendMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SendMessage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SendMessage. + */ + public static SendMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SendMessage deserializedSendMessage = new SendMessage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("messageTitle".equals(fieldName)) { + deserializedSendMessage.messageTitle = reader.getString(); + } else if ("messageBody".equals(fieldName)) { + deserializedSendMessage.messageBody = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSendMessage; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java index 83dc76eef9db..47d9c7b98be9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/ServiceSpecification.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Service specification payload. */ +/** + * Service specification payload. + */ @Fluent -public final class ServiceSpecification { +public final class ServiceSpecification implements JsonSerializable { /* * Specifications of the Log for Azure Monitoring */ - @JsonProperty(value = "logSpecifications") private List logSpecifications; - /** Creates an instance of ServiceSpecification class. */ + /** + * Creates an instance of ServiceSpecification class. + */ public ServiceSpecification() { } /** * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. - * + * * @return the logSpecifications value. */ public List logSpecifications() { @@ -32,7 +39,7 @@ public List logSpecifications() { /** * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. - * + * * @param logSpecifications the logSpecifications value to set. * @return the ServiceSpecification object itself. */ @@ -43,7 +50,7 @@ public ServiceSpecification withLogSpecifications(List logSpec /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,43 @@ public void validate() { logSpecifications().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); + deserializedServiceSpecification.logSpecifications = logSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java index 17002258a15b..695c0931897e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHandlingOperation.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Action to be taken after a user disconnect during the ramp up period. */ +/** + * Action to be taken after a user disconnect during the ramp up period. + */ public final class SessionHandlingOperation extends ExpandableStringEnum { - /** Static value None for SessionHandlingOperation. */ + /** + * Static value None for SessionHandlingOperation. + */ public static final SessionHandlingOperation NONE = fromString("None"); - /** Static value Deallocate for SessionHandlingOperation. */ + /** + * Static value Deallocate for SessionHandlingOperation. + */ public static final SessionHandlingOperation DEALLOCATE = fromString("Deallocate"); - /** Static value Hibernate for SessionHandlingOperation. */ + /** + * Static value Hibernate for SessionHandlingOperation. + */ public static final SessionHandlingOperation HIBERNATE = fromString("Hibernate"); /** * Creates a new instance of SessionHandlingOperation value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public SessionHandlingOperation() { /** * Creates or finds a SessionHandlingOperation from its string representation. - * + * * @param name a name to look for. * @return the corresponding SessionHandlingOperation. */ - @JsonCreator public static SessionHandlingOperation fromString(String name) { return fromString(name, SessionHandlingOperation.class); } /** * Gets known SessionHandlingOperation values. - * + * * @return known SessionHandlingOperation values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java index 7dcc7ec093a1..4a0f98935261 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHost.java @@ -9,158 +9,160 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of SessionHost. */ +/** + * An immutable client-side representation of SessionHost. + */ public interface SessionHost { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of SessionHost. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the lastHeartBeat property: Last heart beat from SessionHost. - * + * * @return the lastHeartBeat value. */ OffsetDateTime lastHeartBeat(); /** * Gets the sessions property: Number of sessions on SessionHost. - * + * * @return the sessions value. */ Integer sessions(); /** * Gets the agentVersion property: Version of agent on SessionHost. - * + * * @return the agentVersion value. */ String agentVersion(); /** * Gets the allowNewSession property: Allow a new session. - * + * * @return the allowNewSession value. */ Boolean allowNewSession(); /** * Gets the virtualMachineId property: Virtual Machine Id of SessionHost's underlying virtual machine. - * + * * @return the virtualMachineId value. */ String virtualMachineId(); /** * Gets the resourceId property: Resource Id of SessionHost's underlying virtual machine. - * + * * @return the resourceId value. */ String resourceId(); /** * Gets the assignedUser property: User assigned to SessionHost. - * + * * @return the assignedUser value. */ String assignedUser(); /** * Gets the friendlyName property: Friendly name of SessionHost. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the status property: Status for a SessionHost. - * + * * @return the status value. */ Status status(); /** * Gets the statusTimestamp property: The timestamp of the status. - * + * * @return the statusTimestamp value. */ OffsetDateTime statusTimestamp(); /** * Gets the osVersion property: The version of the OS on the session host. - * + * * @return the osVersion value. */ String osVersion(); /** * Gets the sxSStackVersion property: The version of the side by side stack on the session host. - * + * * @return the sxSStackVersion value. */ String sxSStackVersion(); /** * Gets the updateState property: Update state of a SessionHost. - * + * * @return the updateState value. */ UpdateState updateState(); /** * Gets the lastUpdateTime property: The timestamp of the last update. - * + * * @return the lastUpdateTime value. */ OffsetDateTime lastUpdateTime(); /** * Gets the updateErrorMessage property: The error message. - * + * * @return the updateErrorMessage value. */ String updateErrorMessage(); /** * Gets the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports. - * + * * @return the sessionHostHealthCheckResults value. */ List sessionHostHealthCheckResults(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner object. - * + * * @return the inner object. */ SessionHostInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java index 4d5a713f129e..88562c131658 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostComponentUpdateType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of maintenance for session host components. */ +/** + * The type of maintenance for session host components. + */ public final class SessionHostComponentUpdateType extends ExpandableStringEnum { - /** Static value Default for SessionHostComponentUpdateType. */ + /** + * Static value Default for SessionHostComponentUpdateType. + */ public static final SessionHostComponentUpdateType DEFAULT = fromString("Default"); - /** Static value Scheduled for SessionHostComponentUpdateType. */ + /** + * Static value Scheduled for SessionHostComponentUpdateType. + */ public static final SessionHostComponentUpdateType SCHEDULED = fromString("Scheduled"); /** * Creates a new instance of SessionHostComponentUpdateType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SessionHostComponentUpdateType() { /** * Creates or finds a SessionHostComponentUpdateType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SessionHostComponentUpdateType. */ - @JsonCreator public static SessionHostComponentUpdateType fromString(String name) { return fromString(name, SessionHostComponentUpdateType.class); } /** * Gets known SessionHostComponentUpdateType values. - * + * * @return known SessionHostComponentUpdateType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java index a230bae92728..1e23bd693ee1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckFailureDetails.java @@ -5,37 +5,44 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -/** Contains details on the failure. */ +/** + * Contains details on the failure. + */ @Immutable -public final class SessionHostHealthCheckFailureDetails { +public final class SessionHostHealthCheckFailureDetails + implements JsonSerializable { /* * Failure message: hints on what is wrong and how to recover. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * Error code corresponding for the failure. */ - @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) private Integer errorCode; /* * The timestamp of the last update. */ - @JsonProperty(value = "lastHealthCheckDateTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastHealthCheckDateTime; - /** Creates an instance of SessionHostHealthCheckFailureDetails class. */ + /** + * Creates an instance of SessionHostHealthCheckFailureDetails class. + */ public SessionHostHealthCheckFailureDetails() { } /** * Get the message property: Failure message: hints on what is wrong and how to recover. - * + * * @return the message value. */ public String message() { @@ -44,7 +51,7 @@ public String message() { /** * Get the errorCode property: Error code corresponding for the failure. - * + * * @return the errorCode value. */ public Integer errorCode() { @@ -53,7 +60,7 @@ public Integer errorCode() { /** * Get the lastHealthCheckDateTime property: The timestamp of the last update. - * + * * @return the lastHealthCheckDateTime value. */ public OffsetDateTime lastHealthCheckDateTime() { @@ -62,9 +69,50 @@ public OffsetDateTime lastHealthCheckDateTime() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostHealthCheckFailureDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostHealthCheckFailureDetails if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionHostHealthCheckFailureDetails. + */ + public static SessionHostHealthCheckFailureDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostHealthCheckFailureDetails deserializedSessionHostHealthCheckFailureDetails + = new SessionHostHealthCheckFailureDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedSessionHostHealthCheckFailureDetails.message = reader.getString(); + } else if ("errorCode".equals(fieldName)) { + deserializedSessionHostHealthCheckFailureDetails.errorCode = reader.getNullable(JsonReader::getInt); + } else if ("lastHealthCheckDateTime".equals(fieldName)) { + deserializedSessionHostHealthCheckFailureDetails.lastHealthCheckDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostHealthCheckFailureDetails; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java index ffbb3359e9f4..c11b503d6b77 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostHealthCheckReport.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The report for session host information. */ +/** + * The report for session host information. + */ @Immutable -public final class SessionHostHealthCheckReport { +public final class SessionHostHealthCheckReport implements JsonSerializable { /* * Represents the name of the health check operation performed. */ - @JsonProperty(value = "healthCheckName", access = JsonProperty.Access.WRITE_ONLY) private HealthCheckName healthCheckName; /* * Represents the Health state of the health check we performed. */ - @JsonProperty(value = "healthCheckResult", access = JsonProperty.Access.WRITE_ONLY) private HealthCheckResult healthCheckResult; /* * Additional detailed information on the failure. */ - @JsonProperty(value = "additionalFailureDetails", access = JsonProperty.Access.WRITE_ONLY) private SessionHostHealthCheckFailureDetails additionalFailureDetails; - /** Creates an instance of SessionHostHealthCheckReport class. */ + /** + * Creates an instance of SessionHostHealthCheckReport class. + */ public SessionHostHealthCheckReport() { } /** * Get the healthCheckName property: Represents the name of the health check operation performed. - * + * * @return the healthCheckName value. */ public HealthCheckName healthCheckName() { @@ -43,7 +48,7 @@ public HealthCheckName healthCheckName() { /** * Get the healthCheckResult property: Represents the Health state of the health check we performed. - * + * * @return the healthCheckResult value. */ public HealthCheckResult healthCheckResult() { @@ -52,7 +57,7 @@ public HealthCheckResult healthCheckResult() { /** * Get the additionalFailureDetails property: Additional detailed information on the failure. - * + * * @return the additionalFailureDetails value. */ public SessionHostHealthCheckFailureDetails additionalFailureDetails() { @@ -61,7 +66,7 @@ public SessionHostHealthCheckFailureDetails additionalFailureDetails() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -69,4 +74,46 @@ public void validate() { additionalFailureDetails().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostHealthCheckReport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostHealthCheckReport if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionHostHealthCheckReport. + */ + public static SessionHostHealthCheckReport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostHealthCheckReport deserializedSessionHostHealthCheckReport = new SessionHostHealthCheckReport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("healthCheckName".equals(fieldName)) { + deserializedSessionHostHealthCheckReport.healthCheckName + = HealthCheckName.fromString(reader.getString()); + } else if ("healthCheckResult".equals(fieldName)) { + deserializedSessionHostHealthCheckReport.healthCheckResult + = HealthCheckResult.fromString(reader.getString()); + } else if ("additionalFailureDetails".equals(fieldName)) { + deserializedSessionHostHealthCheckReport.additionalFailureDetails + = SessionHostHealthCheckFailureDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostHealthCheckReport; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java index 98ee565fd7b3..a69f2f8c8c9a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * SessionHostList - * - *

List of SessionHost definitions. + * + * List of SessionHost definitions. */ @Fluent -public final class SessionHostList { +public final class SessionHostList implements JsonSerializable { /* * List of SessionHost 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; - /** Creates an instance of SessionHostList class. */ + /** + * Creates an instance of SessionHostList class. + */ public SessionHostList() { } /** * Get the value property: List of SessionHost definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of SessionHost definitions. - * + * * @param value the value value to set. * @return the SessionHostList object itself. */ @@ -54,7 +58,7 @@ public SessionHostList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SessionHostList. + */ + public static SessionHostList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostList deserializedSessionHostList = new SessionHostList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SessionHostInner.fromJson(reader1)); + deserializedSessionHostList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSessionHostList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostLoadBalancingAlgorithm.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostLoadBalancingAlgorithm.java index bc274fcd51dd..b3252be013fb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostLoadBalancingAlgorithm.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostLoadBalancingAlgorithm.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Load balancing algorithm for ramp up period. */ +/** + * Load balancing algorithm for ramp up period. + */ public final class SessionHostLoadBalancingAlgorithm extends ExpandableStringEnum { - /** Static value BreadthFirst for SessionHostLoadBalancingAlgorithm. */ + /** + * Static value BreadthFirst for SessionHostLoadBalancingAlgorithm. + */ public static final SessionHostLoadBalancingAlgorithm BREADTH_FIRST = fromString("BreadthFirst"); - /** Static value DepthFirst for SessionHostLoadBalancingAlgorithm. */ + /** + * Static value DepthFirst for SessionHostLoadBalancingAlgorithm. + */ public static final SessionHostLoadBalancingAlgorithm DEPTH_FIRST = fromString("DepthFirst"); /** * Creates a new instance of SessionHostLoadBalancingAlgorithm value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public SessionHostLoadBalancingAlgorithm() { /** * Creates or finds a SessionHostLoadBalancingAlgorithm from its string representation. - * + * * @param name a name to look for. * @return the corresponding SessionHostLoadBalancingAlgorithm. */ - @JsonCreator public static SessionHostLoadBalancingAlgorithm fromString(String name) { return fromString(name, SessionHostLoadBalancingAlgorithm.class); } /** * Gets known SessionHostLoadBalancingAlgorithm values. - * + * * @return known SessionHostLoadBalancingAlgorithm values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java index 50376b094467..0e6249f61b2c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHostPatch.java @@ -6,34 +6,100 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostPatchProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** SessionHost properties that can be patched. */ +/** + * SessionHost properties that can be patched. + */ @Fluent public final class SessionHostPatch extends ProxyResource { /* * Detailed properties for SessionHost */ - @JsonProperty(value = "properties") private SessionHostPatchProperties innerProperties; - /** Creates an instance of SessionHostPatch class. */ + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SessionHostPatch class. + */ public SessionHostPatch() { } /** * Get the innerProperties property: Detailed properties for SessionHost. - * + * * @return the innerProperties value. */ private SessionHostPatchProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the allowNewSession property: Allow a new session. - * + * * @return the allowNewSession value. */ public Boolean allowNewSession() { @@ -42,7 +108,7 @@ public Boolean allowNewSession() { /** * Set the allowNewSession property: Allow a new session. - * + * * @param allowNewSession the allowNewSession value to set. * @return the SessionHostPatch object itself. */ @@ -56,7 +122,7 @@ public SessionHostPatch withAllowNewSession(Boolean allowNewSession) { /** * Get the assignedUser property: User assigned to SessionHost. - * + * * @return the assignedUser value. */ public String assignedUser() { @@ -65,7 +131,7 @@ public String assignedUser() { /** * Set the assignedUser property: User assigned to SessionHost. - * + * * @param assignedUser the assignedUser value to set. * @return the SessionHostPatch object itself. */ @@ -79,7 +145,7 @@ public SessionHostPatch withAssignedUser(String assignedUser) { /** * Get the friendlyName property: Friendly name of SessionHost. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -88,7 +154,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of SessionHost. - * + * * @param friendlyName the friendlyName value to set. * @return the SessionHostPatch object itself. */ @@ -102,7 +168,7 @@ public SessionHostPatch withFriendlyName(String friendlyName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -110,4 +176,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionHostPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionHostPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SessionHostPatch. + */ + public static SessionHostPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionHostPatch deserializedSessionHostPatch = new SessionHostPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSessionHostPatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSessionHostPatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSessionHostPatch.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSessionHostPatch.innerProperties = SessionHostPatchProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSessionHostPatch.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionHostPatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java index ca698cfc8556..c952a771f113 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionHosts.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of SessionHosts. */ +/** + * Resource collection API of SessionHosts. + */ public interface SessionHosts { /** * 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. @@ -22,12 +24,12 @@ public interface SessionHosts { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a session host along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Context context); /** * 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. @@ -40,7 +42,7 @@ Response getWithResponse( /** * 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. @@ -51,12 +53,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, Boolean force, Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, Context context); /** * 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. @@ -68,7 +70,7 @@ Response deleteWithResponse( /** * 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. @@ -80,17 +82,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a SessionHost definition along with {@link Response}. */ - Response updateWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Boolean force, - SessionHostPatch sessionHost, - Context context); + Response updateWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + Boolean force, SessionHostPatch sessionHost, Context context); /** * 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. @@ -103,7 +100,7 @@ Response updateWithResponse( /** * 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. @@ -115,7 +112,7 @@ Response updateWithResponse( /** * 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 pageSize Number of items per page. @@ -127,11 +124,6 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return sessionHostList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String hostPoolName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java index 9968941080de..f36167f9ec4d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SessionState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** State of user session. */ +/** + * State of user session. + */ public final class SessionState extends ExpandableStringEnum { - /** Static value Unknown for SessionState. */ + /** + * Static value Unknown for SessionState. + */ public static final SessionState UNKNOWN = fromString("Unknown"); - /** Static value Active for SessionState. */ + /** + * Static value Active for SessionState. + */ public static final SessionState ACTIVE = fromString("Active"); - /** Static value Disconnected for SessionState. */ + /** + * Static value Disconnected for SessionState. + */ public static final SessionState DISCONNECTED = fromString("Disconnected"); - /** Static value Pending for SessionState. */ + /** + * Static value Pending for SessionState. + */ public static final SessionState PENDING = fromString("Pending"); - /** Static value LogOff for SessionState. */ + /** + * Static value LogOff for SessionState. + */ public static final SessionState LOG_OFF = fromString("LogOff"); - /** Static value UserProfileDiskMounted for SessionState. */ + /** + * Static value UserProfileDiskMounted for SessionState. + */ public static final SessionState USER_PROFILE_DISK_MOUNTED = fromString("UserProfileDiskMounted"); /** * Creates a new instance of SessionState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public SessionState() { /** * 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); } /** * Gets known SessionState values. - * + * * @return known SessionState values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java index fc399b48546e..5244dc3b2519 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SetStartVMOnConnect.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * session hosts must be turned on using rampUpAutoStartHosts or by turning them on manually. */ public final class SetStartVMOnConnect extends ExpandableStringEnum { - /** Static value Enable for SetStartVMOnConnect. */ + /** + * Static value Enable for SetStartVMOnConnect. + */ public static final SetStartVMOnConnect ENABLE = fromString("Enable"); - /** Static value Disable for SetStartVMOnConnect. */ + /** + * Static value Disable for SetStartVMOnConnect. + */ public static final SetStartVMOnConnect DISABLE = fromString("Disable"); /** * Creates a new instance of SetStartVMOnConnect value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +33,17 @@ public SetStartVMOnConnect() { /** * Creates or finds a SetStartVMOnConnect from its string representation. - * + * * @param name a name to look for. * @return the corresponding SetStartVMOnConnect. */ - @JsonCreator public static SetStartVMOnConnect fromString(String name) { return fromString(name, SetStartVMOnConnect.class); } /** * Gets known SetStartVMOnConnect values. - * + * * @return known SetStartVMOnConnect values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java index f16cc2cafcf6..e01d4ee168b5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Sku.java @@ -6,51 +6,54 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource model definition representing SKU. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource model definition representing SKU. + */ @Fluent -public class Sku { +public class Sku implements JsonSerializable { /* - * The name of the SKU. Ex - P3. It is typically a letter+number code + * The name of the SKU. E.g. P3. It is typically a letter+number code */ - @JsonProperty(value = "name", required = true) private String name; /* * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is * not required on a PUT. */ - @JsonProperty(value = "tier") private SkuTier tier; /* * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone * code. */ - @JsonProperty(value = "size") private String size; /* * If the service has different generations of hardware, for the same SKU, then that can be captured here. */ - @JsonProperty(value = "family") private String family; /* * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible * for the resource this may be omitted. */ - @JsonProperty(value = "capacity") private Integer capacity; - /** Creates an instance of Sku class. */ + /** + * Creates an instance of Sku class. + */ public Sku() { } /** - * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * Get the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * * @return the name value. */ public String name() { @@ -58,8 +61,8 @@ public String name() { } /** - * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * + * Set the name property: The name of the SKU. E.g. P3. It is typically a letter+number code. + * * @param name the name value to set. * @return the Sku object itself. */ @@ -71,7 +74,7 @@ public Sku withName(String name) { /** * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @return the tier value. */ public SkuTier tier() { @@ -81,7 +84,7 @@ public SkuTier tier() { /** * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more * than one tier, but is not required on a PUT. - * + * * @param tier the tier value to set. * @return the Sku object itself. */ @@ -93,7 +96,7 @@ public Sku withTier(SkuTier tier) { /** * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this * would be the standalone code. - * + * * @return the size value. */ public String size() { @@ -103,7 +106,7 @@ public String size() { /** * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this * would be the standalone code. - * + * * @param size the size value to set. * @return the Sku object itself. */ @@ -115,7 +118,7 @@ public Sku withSize(String size) { /** * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be * captured here. - * + * * @return the family value. */ public String family() { @@ -125,7 +128,7 @@ public String family() { /** * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be * captured here. - * + * * @param family the family value to set. * @return the Sku object itself. */ @@ -137,7 +140,7 @@ public Sku withFamily(String family) { /** * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If * scale out/in is not possible for the resource this may be omitted. - * + * * @return the capacity value. */ public Integer capacity() { @@ -147,7 +150,7 @@ public Integer capacity() { /** * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If * scale out/in is not possible for the resource this may be omitted. - * + * * @param capacity the capacity value to set. * @return the Sku object itself. */ @@ -158,15 +161,63 @@ public Sku withCapacity(Integer capacity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); } } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("size", this.size); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeNumberField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else if ("size".equals(fieldName)) { + deserializedSku.size = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedSku.family = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedSku.capacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java index b65dbcdc83eb..0e5bbade00b4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SkuTier.java @@ -4,27 +4,34 @@ package com.azure.resourcemanager.desktopvirtualization.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not * required on a PUT. */ public enum SkuTier { - /** Enum value Free. */ + /** + * Enum value Free. + */ FREE("Free"), - /** Enum value Basic. */ + /** + * Enum value Basic. + */ BASIC("Basic"), - /** Enum value Standard. */ + /** + * Enum value Standard. + */ STANDARD("Standard"), - /** Enum value Premium. */ + /** + * Enum value Premium. + */ PREMIUM("Premium"); - /** The actual serialized value for a SkuTier instance. */ + /** + * The actual serialized value for a SkuTier instance. + */ private final String value; SkuTier(String value) { @@ -33,11 +40,10 @@ public enum SkuTier { /** * Parses a serialized value to a SkuTier instance. - * + * * @param value the serialized value to parse. * @return the parsed SkuTier object, or null if unable to parse. */ - @JsonCreator public static SkuTier fromString(String value) { if (value == null) { return null; @@ -51,8 +57,9 @@ public static SkuTier fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java index 68ffd472b759..46749d1f1900 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/SsoSecretType.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of single sign on Secret Type. */ +/** + * The type of single sign on Secret Type. + */ public final class SsoSecretType extends ExpandableStringEnum { - /** Static value SharedKey for SsoSecretType. */ + /** + * Static value SharedKey for SsoSecretType. + */ public static final SsoSecretType SHARED_KEY = fromString("SharedKey"); - /** Static value Certificate for SsoSecretType. */ + /** + * Static value Certificate for SsoSecretType. + */ public static final SsoSecretType CERTIFICATE = fromString("Certificate"); - /** Static value SharedKeyInKeyVault for SsoSecretType. */ + /** + * Static value SharedKeyInKeyVault for SsoSecretType. + */ public static final SsoSecretType SHARED_KEY_IN_KEY_VAULT = fromString("SharedKeyInKeyVault"); - /** Static value CertificateInKeyVault for SsoSecretType. */ + /** + * Static value CertificateInKeyVault for SsoSecretType. + */ public static final SsoSecretType CERTIFICATE_IN_KEY_VAULT = fromString("CertificateInKeyVault"); /** * Creates a new instance of SsoSecretType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public SsoSecretType() { /** * Creates or finds a SsoSecretType from its string representation. - * + * * @param name a name to look for. * @return the corresponding SsoSecretType. */ - @JsonCreator public static SsoSecretType fromString(String name) { return fromString(name, SsoSecretType.class); } /** * Gets known SsoSecretType values. - * + * * @return known SsoSecretType values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java index 45098dfda0be..6e181ef87e65 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItem.java @@ -4,69 +4,79 @@ package com.azure.resourcemanager.desktopvirtualization.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; -/** An immutable client-side representation of StartMenuItem. */ +/** + * An immutable client-side representation of StartMenuItem. + */ public interface StartMenuItem { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the appAlias property: Alias of StartMenuItem. - * + * * @return the appAlias value. */ String appAlias(); /** * Gets the filePath property: Path to the file of StartMenuItem. - * + * * @return the filePath value. */ String filePath(); /** * Gets the commandLineArguments property: Command line arguments for StartMenuItem. - * + * * @return the commandLineArguments value. */ String commandLineArguments(); /** * Gets the iconPath property: Path to the icon. - * + * * @return the iconPath value. */ String iconPath(); /** * Gets the iconIndex property: Index of the icon. - * + * * @return the iconIndex value. */ Integer iconIndex(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner object. - * + * * @return the inner object. */ StartMenuItemInner innerModel(); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java index 16872bbd23db..0b60ad2e0cf3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItemList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * StartMenuItemList - * - *

List of StartMenuItem definitions. + * + * List of StartMenuItem definitions. */ @Fluent -public final class StartMenuItemList { +public final class StartMenuItemList implements JsonSerializable { /* * List of StartMenuItem 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; - /** Creates an instance of StartMenuItemList class. */ + /** + * Creates an instance of StartMenuItemList class. + */ public StartMenuItemList() { } /** * Get the value property: List of StartMenuItem definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of StartMenuItem definitions. - * + * * @param value the value value to set. * @return the StartMenuItemList object itself. */ @@ -54,7 +58,7 @@ public StartMenuItemList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StartMenuItemList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StartMenuItemList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StartMenuItemList. + */ + public static StartMenuItemList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StartMenuItemList deserializedStartMenuItemList = new StartMenuItemList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> StartMenuItemInner.fromJson(reader1)); + deserializedStartMenuItemList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStartMenuItemList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStartMenuItemList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java index 8d9977a8b98d..6a93a98e939f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartMenuItems.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of StartMenuItems. */ +/** + * Resource collection API of StartMenuItems. + */ public interface StartMenuItems { /** * 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. @@ -23,7 +25,7 @@ public interface StartMenuItems { /** * 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 pageSize Number of items per page. @@ -35,11 +37,6 @@ public interface StartMenuItems { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return startMenuItemList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String applicationGroupName, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String applicationGroupName, Integer pageSize, + Boolean isDescending, Integer initialSkip, Context context); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java index a26cd2b0b57f..fc1290bb8cbc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StartupBehavior.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The desired startup behavior during the ramp up period for personal vms in the hostpool. */ +/** + * The desired startup behavior during the ramp up period for personal vms in the hostpool. + */ public final class StartupBehavior extends ExpandableStringEnum { - /** Static value None for StartupBehavior. */ + /** + * Static value None for StartupBehavior. + */ public static final StartupBehavior NONE = fromString("None"); - /** Static value WithAssignedUser for StartupBehavior. */ + /** + * Static value WithAssignedUser for StartupBehavior. + */ public static final StartupBehavior WITH_ASSIGNED_USER = fromString("WithAssignedUser"); - /** Static value All for StartupBehavior. */ + /** + * Static value All for StartupBehavior. + */ public static final StartupBehavior ALL = fromString("All"); /** * Creates a new instance of StartupBehavior value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public StartupBehavior() { /** * Creates or finds a StartupBehavior from its string representation. - * + * * @param name a name to look for. * @return the corresponding StartupBehavior. */ - @JsonCreator public static StartupBehavior fromString(String name) { return fromString(name, StartupBehavior.class); } /** * Gets known StartupBehavior values. - * + * * @return known StartupBehavior values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java index db11425a6d49..8445394a6070 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Status.java @@ -5,50 +5,75 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Status for a SessionHost. */ +/** + * Status for a SessionHost. + */ public final class Status extends ExpandableStringEnum { - /** Static value Available for Status. */ + /** + * Static value Available for Status. + */ public static final Status AVAILABLE = fromString("Available"); - /** Static value Unavailable for Status. */ + /** + * Static value Unavailable for Status. + */ public static final Status UNAVAILABLE = fromString("Unavailable"); - /** Static value Shutdown for Status. */ + /** + * Static value Shutdown for Status. + */ public static final Status SHUTDOWN = fromString("Shutdown"); - /** Static value Disconnected for Status. */ + /** + * Static value Disconnected for Status. + */ public static final Status DISCONNECTED = fromString("Disconnected"); - /** Static value Upgrading for Status. */ + /** + * Static value Upgrading for Status. + */ public static final Status UPGRADING = fromString("Upgrading"); - /** Static value UpgradeFailed for Status. */ + /** + * Static value UpgradeFailed for Status. + */ public static final Status UPGRADE_FAILED = fromString("UpgradeFailed"); - /** Static value NoHeartbeat for Status. */ + /** + * Static value NoHeartbeat for Status. + */ public static final Status NO_HEARTBEAT = fromString("NoHeartbeat"); - /** Static value NotJoinedToDomain for Status. */ + /** + * Static value NotJoinedToDomain for Status. + */ public static final Status NOT_JOINED_TO_DOMAIN = fromString("NotJoinedToDomain"); - /** Static value DomainTrustRelationshipLost for Status. */ + /** + * Static value DomainTrustRelationshipLost for Status. + */ public static final Status DOMAIN_TRUST_RELATIONSHIP_LOST = fromString("DomainTrustRelationshipLost"); - /** Static value SxSStackListenerNotReady for Status. */ + /** + * Static value SxSStackListenerNotReady for Status. + */ public static final Status SX_SSTACK_LISTENER_NOT_READY = fromString("SxSStackListenerNotReady"); - /** Static value FSLogixNotHealthy for Status. */ + /** + * Static value FSLogixNotHealthy for Status. + */ public static final Status FSLOGIX_NOT_HEALTHY = fromString("FSLogixNotHealthy"); - /** Static value NeedsAssistance for Status. */ + /** + * Static value NeedsAssistance for Status. + */ public static final Status NEEDS_ASSISTANCE = fromString("NeedsAssistance"); /** * Creates a new instance of Status value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -57,18 +82,17 @@ public Status() { /** * 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); } /** * Gets known Status values. - * + * * @return known Status values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java index d053925b9797..8ae21b0b2d4c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/StopHostsWhen.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Specifies when to stop hosts during ramp down period. */ +/** + * Specifies when to stop hosts during ramp down period. + */ public final class StopHostsWhen extends ExpandableStringEnum { - /** Static value ZeroSessions for StopHostsWhen. */ + /** + * Static value ZeroSessions for StopHostsWhen. + */ public static final StopHostsWhen ZERO_SESSIONS = fromString("ZeroSessions"); - /** Static value ZeroActiveSessions for StopHostsWhen. */ + /** + * Static value ZeroActiveSessions for StopHostsWhen. + */ public static final StopHostsWhen ZERO_ACTIVE_SESSIONS = fromString("ZeroActiveSessions"); /** * Creates a new instance of StopHostsWhen value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public StopHostsWhen() { /** * Creates or finds a StopHostsWhen from its string representation. - * + * * @param name a name to look for. * @return the corresponding StopHostsWhen. */ - @JsonCreator public static StopHostsWhen fromString(String name) { return fromString(name, StopHostsWhen.class); } /** * Gets known StopHostsWhen values. - * + * * @return known StopHostsWhen values. */ public static Collection values() { diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java index 8e06cf5d8cfc..3dc11fc674e2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Time.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The time for a scaling action to occur. */ +/** + * The time for a scaling action to occur. + */ @Fluent -public final class Time { +public final class Time implements JsonSerializable

List of UserSession definitions. + * + * List of UserSession definitions. */ @Fluent -public final class UserSessionList { +public final class UserSessionList implements JsonSerializable { /* * List of UserSession 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; - /** Creates an instance of UserSessionList class. */ + /** + * Creates an instance of UserSessionList class. + */ public UserSessionList() { } /** * Get the value property: List of UserSession definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of UserSession definitions. - * + * * @param value the value value to set. * @return the UserSessionList object itself. */ @@ -54,7 +58,7 @@ public UserSessionList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserSessionList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserSessionList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserSessionList. + */ + public static UserSessionList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserSessionList deserializedUserSessionList = new UserSessionList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UserSessionInner.fromJson(reader1)); + deserializedUserSessionList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUserSessionList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserSessionList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java index 035c3aca7b26..15f117fcaa2e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/UserSessions.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of UserSessions. */ +/** + * Resource collection API of UserSessions. + */ public interface UserSessions { /** * 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. @@ -24,7 +26,7 @@ public interface UserSessions { /** * 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. @@ -37,18 +39,12 @@ public interface UserSessions { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return userSessionList as paginated response with {@link PagedIterable}. */ - PagedIterable listByHostPool( - String resourceGroupName, - String hostPoolName, - String filter, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable listByHostPool(String resourceGroupName, String hostPoolName, String filter, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * 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. @@ -59,12 +55,12 @@ PagedIterable listByHostPool( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a userSession along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context); + Response getWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context); /** * 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. @@ -78,7 +74,7 @@ Response getWithResponse( /** * 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. @@ -90,17 +86,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - Boolean force, - Context context); + Response deleteWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Boolean force, Context context); /** * 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. @@ -113,7 +104,7 @@ Response deleteWithResponse( /** * 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. @@ -126,7 +117,7 @@ Response deleteWithResponse( /** * 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. @@ -139,18 +130,12 @@ Response deleteWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return userSessionList as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - Integer pageSize, - Boolean isDescending, - Integer initialSkip, - Context context); + PagedIterable list(String resourceGroupName, String hostPoolName, String sessionHostname, + Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); /** * 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. @@ -161,12 +146,12 @@ PagedIterable list( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response disconnectWithResponse( - String resourceGroupName, String hostPoolName, String sessionHostname, String userSessionId, Context context); + Response disconnectWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, Context context); /** * 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. @@ -179,7 +164,7 @@ Response disconnectWithResponse( /** * 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. @@ -191,17 +176,12 @@ Response disconnectWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response sendMessageWithResponse( - String resourceGroupName, - String hostPoolName, - String sessionHostname, - String userSessionId, - SendMessage sendMessage, - Context context); + Response sendMessageWithResponse(String resourceGroupName, String hostPoolName, String sessionHostname, + String userSessionId, SendMessage sendMessage, Context context); /** * 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. diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java index ed77248a8288..e90a7727bd35 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspace.java @@ -11,39 +11,41 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of Workspace. */ +/** + * An immutable client-side representation of Workspace. + */ public interface Workspace { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -52,16 +54,16 @@ public interface Workspace { * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment * will not delete the resource if it is removed from the template since it is managed by another resource. - * + * * @return the managedBy value. */ String managedBy(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of - * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ String kind(); @@ -71,70 +73,70 @@ public interface Workspace { * provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from * the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), * If-None-Match (section 14.26), and If-Range (section 14.27) header fields. - * + * * @return the etag value. */ String etag(); /** * Gets the identity property: The identity property. - * + * * @return the identity value. */ ResourceModelWithAllowedPropertySetIdentity identity(); /** * Gets the sku property: The sku property. - * + * * @return the sku value. */ ResourceModelWithAllowedPropertySetSku sku(); /** * Gets the plan property: The plan property. - * + * * @return the plan value. */ ResourceModelWithAllowedPropertySetPlan plan(); /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. - * + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ SystemData systemData(); /** * Gets the objectId property: ObjectId of Workspace. (internal use). - * + * * @return the objectId value. */ String objectId(); /** * Gets the description property: Description of Workspace. - * + * * @return the description value. */ String description(); /** * Gets the friendlyName property: Friendly name of Workspace. - * + * * @return the friendlyName value. */ String friendlyName(); /** * Gets the applicationGroupReferences property: List of applicationGroup resource Ids. - * + * * @return the applicationGroupReferences value. */ List applicationGroupReferences(); /** * Gets the cloudPcResource property: Is cloud pc resource. - * + * * @return the cloudPcResource value. */ Boolean cloudPcResource(); @@ -142,7 +144,7 @@ public interface Workspace { /** * Gets the publicNetworkAccess property: Enabled allows this resource to be accessed from both public and private * networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @return the publicNetworkAccess value. */ PublicNetworkAccess publicNetworkAccess(); @@ -150,58 +152,63 @@ public interface Workspace { /** * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified * resource. - * + * * @return the privateEndpointConnections value. */ List privateEndpointConnections(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceInner object. - * + * * @return the inner object. */ WorkspaceInner innerModel(); - /** The entirety of the Workspace definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the Workspace definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Workspace definition stages. */ + /** + * The Workspace definition stages. + */ interface DefinitionStages { - /** The first stage of the Workspace definition. */ + /** + * The first stage of the Workspace definition. + */ interface Blank extends WithLocation { } - /** The stage of the Workspace definition allowing to specify location. */ + /** + * The stage of the Workspace definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -209,18 +216,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Workspace definition allowing to specify parent resource. */ + /** + * The stage of the Workspace definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -231,149 +240,162 @@ interface WithResourceGroup { * The stage of the Workspace definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithManagedBy, - DefinitionStages.WithKind, - DefinitionStages.WithIdentity, - DefinitionStages.WithSku, - DefinitionStages.WithPlan, - DefinitionStages.WithDescription, - DefinitionStages.WithFriendlyName, - DefinitionStages.WithApplicationGroupReferences, - DefinitionStages.WithPublicNetworkAccess { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithManagedBy, + DefinitionStages.WithKind, DefinitionStages.WithIdentity, DefinitionStages.WithSku, + DefinitionStages.WithPlan, DefinitionStages.WithDescription, DefinitionStages.WithFriendlyName, + DefinitionStages.WithApplicationGroupReferences, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. - * + * * @return the created resource. */ Workspace create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Workspace create(Context context); } - /** The stage of the Workspace definition allowing to specify tags. */ + /** + * The stage of the Workspace definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the Workspace definition allowing to specify managedBy. */ + /** + * The stage of the Workspace definition allowing to specify managedBy. + */ interface WithManagedBy { /** * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete * mode deployment will not delete the resource if it is removed from the template since it is managed by * another resource.. - * + * * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if - * this resource is managed by another Azure resource. If this is present, complete mode deployment will - * not delete the resource if it is removed from the template since it is managed by another resource. + * this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ WithCreate withManagedBy(String managedBy); } - /** The stage of the Workspace definition allowing to specify kind. */ + /** + * The stage of the Workspace definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for - * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the + * resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider - * must validate and persist this value. + * same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * @return the next definition stage. */ WithCreate withKind(String kind); } - /** The stage of the Workspace definition allowing to specify identity. */ + /** + * The stage of the Workspace definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The identity property.. - * + * * @param identity The identity property. * @return the next definition stage. */ WithCreate withIdentity(ResourceModelWithAllowedPropertySetIdentity identity); } - /** The stage of the Workspace definition allowing to specify sku. */ + /** + * The stage of the Workspace definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku property.. - * + * * @param sku The sku property. * @return the next definition stage. */ WithCreate withSku(ResourceModelWithAllowedPropertySetSku sku); } - /** The stage of the Workspace definition allowing to specify plan. */ + /** + * The stage of the Workspace definition allowing to specify plan. + */ interface WithPlan { /** * Specifies the plan property: The plan property.. - * + * * @param plan The plan property. * @return the next definition stage. */ WithCreate withPlan(ResourceModelWithAllowedPropertySetPlan plan); } - /** The stage of the Workspace definition allowing to specify description. */ + /** + * The stage of the Workspace definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of Workspace.. - * + * * @param description Description of Workspace. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the Workspace definition allowing to specify friendlyName. */ + /** + * The stage of the Workspace definition allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of Workspace.. - * + * * @param friendlyName Friendly name of Workspace. * @return the next definition stage. */ WithCreate withFriendlyName(String friendlyName); } - /** The stage of the Workspace definition allowing to specify applicationGroupReferences. */ + /** + * The stage of the Workspace definition allowing to specify applicationGroupReferences. + */ interface WithApplicationGroupReferences { /** * Specifies the applicationGroupReferences property: List of applicationGroup resource Ids.. - * + * * @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 publicNetworkAccess. */ + /** + * The stage of the Workspace definition allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Enabled allows this resource to be accessed from both public * and private networks, Disabled allows this resource to only be accessed via private endpoints. - * + * * @param publicNetworkAccess Enabled allows this resource to be accessed from both public and private - * networks, Disabled allows this resource to only be accessed via private endpoints. + * networks, Disabled allows this resource to only be accessed via private endpoints. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); @@ -382,86 +404,96 @@ interface WithPublicNetworkAccess { /** * Begins update for the Workspace resource. - * + * * @return the stage of resource update. */ Workspace.Update update(); - /** The template for Workspace update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithDescription, - UpdateStages.WithFriendlyName, - UpdateStages.WithApplicationGroupReferences, - UpdateStages.WithPublicNetworkAccess { + /** + * The template for Workspace update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithFriendlyName, + UpdateStages.WithApplicationGroupReferences, UpdateStages.WithPublicNetworkAccess { /** * Executes the update request. - * + * * @return the updated resource. */ Workspace apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Workspace apply(Context context); } - /** The Workspace update stages. */ + /** + * The Workspace update stages. + */ interface UpdateStages { - /** The stage of the Workspace update allowing to specify tags. */ + /** + * The stage of the Workspace update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: tags to be updated. - * + * * @param tags tags to be updated. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Workspace update allowing to specify description. */ + /** + * The stage of the Workspace update allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: Description of Workspace.. - * + * * @param description Description of Workspace. * @return the next definition stage. */ Update withDescription(String description); } - /** The stage of the Workspace update allowing to specify friendlyName. */ + /** + * The stage of the Workspace update allowing to specify friendlyName. + */ interface WithFriendlyName { /** * Specifies the friendlyName property: Friendly name of Workspace.. - * + * * @param friendlyName Friendly name of Workspace. * @return the next definition stage. */ Update withFriendlyName(String friendlyName); } - /** The stage of the Workspace update allowing to specify applicationGroupReferences. */ + /** + * The stage of the Workspace update allowing to specify applicationGroupReferences. + */ interface WithApplicationGroupReferences { /** * Specifies the applicationGroupReferences property: List of applicationGroup links.. - * + * * @param applicationGroupReferences List of applicationGroup links. * @return the next definition stage. */ Update withApplicationGroupReferences(List applicationGroupReferences); } - /** The stage of the Workspace update allowing to specify publicNetworkAccess. */ + /** + * The stage of the Workspace update allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Enabled to allow this resource to be access from the public * network. - * + * * @param publicNetworkAccess Enabled to allow this resource to be access from the public network. * @return the next definition stage. */ @@ -471,14 +503,14 @@ interface WithPublicNetworkAccess { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Workspace refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java index 318ca2db9a64..cca1d1c61fc7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspaceList.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspaceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * WorkspaceList - * - *

List of Workspace definitions. + * + * List of Workspace definitions. */ @Fluent -public final class WorkspaceList { +public final class WorkspaceList implements JsonSerializable { /* * List of Workspace 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; - /** Creates an instance of WorkspaceList class. */ + /** + * Creates an instance of WorkspaceList class. + */ public WorkspaceList() { } /** * Get the value property: List of Workspace definitions. - * + * * @return the value value. */ public List value() { @@ -43,7 +47,7 @@ public List value() { /** * Set the value property: List of Workspace definitions. - * + * * @param value the value value to set. * @return the WorkspaceList object itself. */ @@ -54,7 +58,7 @@ public WorkspaceList withValue(List value) { /** * Get the nextLink property: Link to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -63,7 +67,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -71,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspaceList. + */ + public static WorkspaceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceList deserializedWorkspaceList = new WorkspaceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> WorkspaceInner.fromJson(reader1)); + deserializedWorkspaceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceList; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java index a2c2849e2ee5..f7e3f2dbdadd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/WorkspacePatch.java @@ -5,35 +5,39 @@ package com.azure.resourcemanager.desktopvirtualization.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.desktopvirtualization.fluent.models.WorkspacePatchProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** Workspace properties that can be patched. */ +/** + * Workspace properties that can be patched. + */ @Fluent -public final class WorkspacePatch { +public final class WorkspacePatch implements JsonSerializable { /* * tags to be updated */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Detailed properties for Workspace */ - @JsonProperty(value = "properties") private WorkspacePatchProperties innerProperties; - /** Creates an instance of WorkspacePatch class. */ + /** + * Creates an instance of WorkspacePatch class. + */ public WorkspacePatch() { } /** * Get the tags property: tags to be updated. - * + * * @return the tags value. */ public Map tags() { @@ -42,7 +46,7 @@ public Map tags() { /** * Set the tags property: tags to be updated. - * + * * @param tags the tags value to set. * @return the WorkspacePatch object itself. */ @@ -53,7 +57,7 @@ public WorkspacePatch withTags(Map tags) { /** * Get the innerProperties property: Detailed properties for Workspace. - * + * * @return the innerProperties value. */ private WorkspacePatchProperties innerProperties() { @@ -62,7 +66,7 @@ private WorkspacePatchProperties innerProperties() { /** * Get the description property: Description of Workspace. - * + * * @return the description value. */ public String description() { @@ -71,7 +75,7 @@ public String description() { /** * Set the description property: Description of Workspace. - * + * * @param description the description value to set. * @return the WorkspacePatch object itself. */ @@ -85,7 +89,7 @@ public WorkspacePatch withDescription(String description) { /** * Get the friendlyName property: Friendly name of Workspace. - * + * * @return the friendlyName value. */ public String friendlyName() { @@ -94,7 +98,7 @@ public String friendlyName() { /** * Set the friendlyName property: Friendly name of Workspace. - * + * * @param friendlyName the friendlyName value to set. * @return the WorkspacePatch object itself. */ @@ -108,7 +112,7 @@ public WorkspacePatch withFriendlyName(String friendlyName) { /** * Get the applicationGroupReferences property: List of applicationGroup links. - * + * * @return the applicationGroupReferences value. */ public List applicationGroupReferences() { @@ -117,7 +121,7 @@ public List applicationGroupReferences() { /** * Set the applicationGroupReferences property: List of applicationGroup links. - * + * * @param applicationGroupReferences the applicationGroupReferences value to set. * @return the WorkspacePatch object itself. */ @@ -131,7 +135,7 @@ public WorkspacePatch withApplicationGroupReferences(List applicationGro /** * Get the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -140,7 +144,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Enabled to allow this resource to be access from the public network. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the WorkspacePatch object itself. */ @@ -154,7 +158,7 @@ public WorkspacePatch withPublicNetworkAccess(PublicNetworkAccess publicNetworkA /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -162,4 +166,44 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspacePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspacePatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkspacePatch. + */ + public static WorkspacePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspacePatch deserializedWorkspacePatch = new WorkspacePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWorkspacePatch.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedWorkspacePatch.innerProperties = WorkspacePatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspacePatch; + }); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java index be4529a32ef8..c584e21924b3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/Workspaces.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Workspaces. */ +/** + * Resource collection API of Workspaces. + */ public interface Workspaces { /** * Get a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -25,7 +27,7 @@ public interface Workspaces { /** * 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. @@ -37,7 +39,7 @@ public interface Workspaces { /** * Remove a workspace. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param context The context to associate with this operation. @@ -50,7 +52,7 @@ public interface Workspaces { /** * 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. @@ -61,7 +63,7 @@ public interface Workspaces { /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -72,7 +74,7 @@ public interface Workspaces { /** * List workspaces. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param pageSize Number of items per page. * @param isDescending Indicates whether the collection is descending. @@ -83,12 +85,12 @@ public interface Workspaces { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup( - String resourceGroupName, Integer pageSize, Boolean isDescending, Integer initialSkip, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Integer pageSize, Boolean isDescending, + Integer initialSkip, Context context); /** * List workspaces in subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return workspaceList as paginated response with {@link PagedIterable}. @@ -97,7 +99,7 @@ PagedIterable listByResourceGroup( /** * List workspaces in subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -108,7 +110,7 @@ PagedIterable listByResourceGroup( /** * Get a workspace. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -119,7 +121,7 @@ PagedIterable listByResourceGroup( /** * Get a workspace. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,7 +133,7 @@ PagedIterable listByResourceGroup( /** * Remove a workspace. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -141,7 +143,7 @@ PagedIterable listByResourceGroup( /** * Remove a workspace. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,7 +155,7 @@ PagedIterable listByResourceGroup( /** * Begins definition for a new Workspace resource. - * + * * @param name resource name. * @return the first stage of the new Workspace definition. */ diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java index e101adf77c19..ac9ee1c6643f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for DesktopVirtualizationApiClient. null. */ +/** + * Package containing the data models for DesktopVirtualizationApiClient. + * null. + */ package com.azure.resourcemanager.desktopvirtualization.models; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java index 50766baf55a6..5240260090e6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for DesktopVirtualizationApiClient. null. */ +/** + * Package containing the classes for DesktopVirtualizationApiClient. + * null. + */ package com.azure.resourcemanager.desktopvirtualization; diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java index b9d12db35dc5..773a509bdbcc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.desktopvirtualization { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.desktopvirtualization; exports com.azure.resourcemanager.desktopvirtualization.fluent; exports com.azure.resourcemanager.desktopvirtualization.fluent.models; exports com.azure.resourcemanager.desktopvirtualization.models; - - opens com.azure.resourcemanager.desktopvirtualization.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.desktopvirtualization.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.desktopvirtualization.fluent.models to com.azure.core; + opens com.azure.resourcemanager.desktopvirtualization.models to com.azure.core; +} \ No newline at end of file diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json new file mode 100644 index 000000000000..9a28264fba22 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackageInfoesClientImpl$AppAttachPackageInfoesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.AppAttachPackagesClientImpl$AppAttachPackagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationGroupsClientImpl$ApplicationGroupsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.DesktopsClientImpl$DesktopsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.HostPoolsClientImpl$HostPoolsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.MsixImagesClientImpl$MsixImagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.MsixPackagesClientImpl$MsixPackagesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPersonalSchedulesClientImpl$ScalingPlanPersonalSchedulesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPooledSchedulesClientImpl$ScalingPlanPooledSchedulesService"],["com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlansClientImpl$ScalingPlansService"],["com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostsClientImpl$SessionHostsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsClientImpl$StartMenuItemsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.UserSessionsClientImpl$UserSessionsService"],["com.azure.resourcemanager.desktopvirtualization.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/reflect-config.json b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-desktopvirtualization/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a1bce7f731b4 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageCreateOrUpdateSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageProperties; +import com.azure.resourcemanager.desktopvirtualization.models.FailHealthCheckOnStagingFailure; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for AppAttachPackage CreateOrUpdate. + */ +public final class AppAttachPackageCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Create.json + */ + /** + * Sample code: AppAttachPackage_Create. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .define("msixpackagefullname") + .withRegion("southcentralus") + .withExistingResourceGroup("resourceGroup1") + .withProperties(new AppAttachPackageProperties() + .withImage(new AppAttachPackageInfoProperties().withPackageAlias("msixpackagealias") + .withImagePath("imagepath") + .withPackageName("MsixPackageName") + .withPackageFamilyName("MsixPackage_FamilyName") + .withPackageFullName("MsixPackage_FullName") + .withDisplayName("displayname") + .withPackageRelativePath("packagerelativepath") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies( + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixPackage_Dependency_Name") + .withPublisher("MsixPackage_Dependency_Publisher") + .withMinVersion("packageDep_version"))) + .withVersion("packageversion") + .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("AppId") + .withDescription("PackageApplicationDescription") + .withAppUserModelId("AppUserModelId") + .withFriendlyName("FriendlyName") + .withIconImageName("Iconimagename") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withCertificateName("certName") + .withCertificateExpiry(OffsetDateTime.parse("2023-01-02T17:18:19.1234567Z"))) + .withHostPoolReferences(Arrays.asList()) + .withKeyVaultUrl("fakeTokenPlaceholder") + .withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure.NEEDS_ASSISTANCE)) + .create(); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java new file mode 100644 index 000000000000..1c087fd0f165 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for AppAttachPackage Delete. + */ +public final class AppAttachPackageDeleteSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Delete.json + */ + /** + * Sample code: AppAttachPackage_Delete. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .deleteByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java new file mode 100644 index 000000000000..04138ee9f7e6 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for AppAttachPackage GetByResourceGroup. + */ +public final class AppAttachPackageGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Get.json + */ + /** + * Sample code: AppAttachPackage_Get. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .getByResourceGroupWithResponse("resourceGroup1", "packagefullname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java new file mode 100644 index 000000000000..30b1b44b54fa --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoImportMethodSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; + +/** + * Samples for AppAttachPackageInfo ImportMethod. + */ +public final class AppAttachPackageInfoImportMethodSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackageInfo_Import_Post.json + */ + /** + * Sample code: AppAttachPackageInfo_Import. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageInfoImport( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackageInfoes() + .importMethod("resourceGroup1", "hostpool1", new ImportPackageInfoRequest().withPath("imagepath") + .withPackageArchitecture(AppAttachPackageArchitectures.X64), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java new file mode 100644 index 000000000000..0089bf840aaa --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for AppAttachPackage ListByResourceGroup. + */ +public final class AppAttachPackageListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_ListByResourceGroup.json + */ + /** + * Sample code: AppAttachPackage_ListByResourceGroup. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageListByResourceGroup( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages() + .listByResourceGroup("resourceGroup1", "HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java new file mode 100644 index 000000000000..0ba5afc9609d --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for AppAttachPackage List. + */ +public final class AppAttachPackageListSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_ListBySubscription.json + */ + /** + * Sample code: AppAttachPackage_ListBySubscription. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void appAttachPackageListBySubscription( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.appAttachPackages().list("HostPoolName eq 'hostpool1'", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java new file mode 100644 index 000000000000..e6f5a1519383 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackage; + +/** + * Samples for AppAttachPackage Update. + */ +public final class AppAttachPackageUpdateSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * AppAttachPackage_Update.json + */ + /** + * Sample code: AppAttachPackage_Update. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void + appAttachPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + AppAttachPackage resource = manager.appAttachPackages() + .getByResourceGroupWithResponse("resourceGroup1", "msixpackagefullname", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java index bb8172264487..be04ad430b6d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsCreateOrUpdateSamples.java @@ -8,20 +8,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for ApplicationGroups CreateOrUpdate. */ +/** + * Samples for ApplicationGroups CreateOrUpdate. + */ public final class ApplicationGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Create.json */ /** * Sample code: ApplicationGroup_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() + public static void + applicationGroupCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() .define("applicationGroup1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java index 60108384f45c..bcddf5f4d684 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ApplicationGroups Delete. */ +/** + * Samples for ApplicationGroups Delete. + */ public final class ApplicationGroupsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Delete.json */ /** * Sample code: ApplicationGroup_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() + public static void + applicationGroupDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() .deleteByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java index bf74645cc6ac..986d5090fc97 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ApplicationGroups GetByResourceGroup. */ +/** + * Samples for ApplicationGroups GetByResourceGroup. + */ public final class ApplicationGroupsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Get.json */ /** * Sample code: ApplicationGroup_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() + public static void + applicationGroupGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applicationGroups() .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java index f4860929fe98..abfd82da909d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListByResourceGroupSamples.java @@ -4,26 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ApplicationGroups ListByResourceGroup. */ +/** + * Samples for ApplicationGroups ListByResourceGroup. + */ public final class ApplicationGroupsListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_ListByResourceGroup.json */ /** * Sample code: ApplicationGroup_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void applicationGroupListByResourceGroup( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applicationGroups() - .listByResourceGroup( - "resourceGroup1", - "applicationGroupType eq 'RailApplication'", - 10, - true, - 0, + manager.applicationGroups() + .listByResourceGroup("resourceGroup1", "applicationGroupType eq 'RailApplication'", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java index 4be0ec5be229..5bf5c1d9115c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ApplicationGroups List. */ +/** + * Samples for ApplicationGroups List. + */ public final class ApplicationGroupsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListBySubscription.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_ListBySubscription.json */ /** * Sample code: ApplicationGroup_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + applicationGroupList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.applicationGroups().list("applicationGroupType eq 'RailApplication'", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java index d947de84a414..05ad41db48d4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsUpdateSamples.java @@ -8,25 +8,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for ApplicationGroups Update. */ +/** + * Samples for ApplicationGroups Update. + */ public final class ApplicationGroupsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ApplicationGroup_Update.json */ /** * Sample code: ApplicationGroups_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGroupsUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ApplicationGroup resource = - manager - .applicationGroups() - .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + applicationGroupsUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ApplicationGroup resource = manager.applicationGroups() + .getByResourceGroupWithResponse("resourceGroup1", "applicationGroup1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withDescription("des1") .withFriendlyName("friendly") diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java index 9cb6306bac21..93fdf75a6592 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateSamples.java @@ -6,20 +6,23 @@ import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; -/** Samples for Applications CreateOrUpdate. */ +/** + * Samples for Applications CreateOrUpdate. + */ public final class ApplicationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Create.json */ /** * Sample code: Application_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() + public static void + applicationCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() .define("application1") .withExistingApplicationGroup("resourceGroup1", "applicationGroup1") .withCommandLineSetting(CommandLineSetting.ALLOW) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java index a08d501719e0..e7e9d7fd56db 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Applications Delete. */ +/** + * Samples for Applications Delete. + */ public final class ApplicationsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Delete.json */ /** * Sample code: Application_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() - .deleteWithResponse( - "resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); + public static void + applicationDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() + .deleteWithResponse("resourceGroup1", "applicationGroup1", "application1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java index a5e9be9340d2..fd3e84450ff0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Applications Get. */ +/** + * Samples for Applications Get. + */ public final class ApplicationsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Get.json */ /** * Sample code: Application_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() + public static void + applicationGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java index 0acf2a3e579d..5764e1d1a02d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Applications List. */ +/** + * Samples for Applications List. + */ public final class ApplicationsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_List.json */ /** * Sample code: Applications_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationsList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .applications() + public static void + applicationsList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.applications() .list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java index ad21688194c5..3509d341b5a7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsUpdateSamples.java @@ -8,26 +8,26 @@ import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -/** Samples for Applications Update. */ +/** + * Samples for Applications Update. + */ public final class ApplicationsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Application_Update.json */ /** * Sample code: Application_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void applicationUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - Application resource = - manager - .applications() - .getWithResponse( - "resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + applicationUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + Application resource = manager.applications() + .getWithResponse("resourceGroup1", "applicationGroup1", "application1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withDescription("des1") .withFriendlyName("friendly") .withFilePath("path") diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java index 6ee3076ede97..b8ea7ace50f4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Desktops Get. */ +/** + * Samples for Desktops Get. + */ public final class DesktopsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Desktop_Get.json */ /** * Sample code: Desktop_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void desktopGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .desktops() + public static void + desktopGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops() .getWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java index 76dd322caec7..c8e4a9f1f56a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Desktops List. */ +/** + * Samples for Desktops List. + */ public final class DesktopsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Desktop_List.json */ /** * Sample code: Desktop_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void desktopList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + desktopList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.desktops().list("resourceGroup1", "applicationGroup1", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java index fd3ce680eb4d..86b873b54f5c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateSamples.java @@ -6,24 +6,24 @@ import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; -/** Samples for Desktops Update. */ +/** + * Samples for Desktops Update. + */ public final class DesktopsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Desktop_Update.json */ /** * Sample code: Desktop_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void desktopUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .desktops() - .updateWithResponse( - "resourceGroup1", - "applicationGroup1", - "SessionDesktop", + public static void + desktopUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.desktops() + .updateWithResponse("resourceGroup1", "applicationGroup1", "SessionDesktop", new DesktopPatch().withDescription("des1").withFriendlyName("friendly"), com.azure.core.util.Context.NONE); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java index aebcc181e4f4..92e2274f950f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsCreateOrUpdateSamples.java @@ -20,20 +20,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for HostPools CreateOrUpdate. */ +/** + * Samples for HostPools CreateOrUpdate. + */ public final class HostPoolsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Create.json */ /** * Sample code: HostPool_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .hostPools() + public static void + hostPoolCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() .define("hostPool1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") @@ -46,8 +49,7 @@ public static void hostPoolCreate( .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) .withMaxSessionLimit(999999) .withRegistrationInfo( - new RegistrationInfoInner() - .withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) + new RegistrationInfoInner().withExpirationTime(OffsetDateTime.parse("2020-10-01T14:01:54.9571247Z")) .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) .withVmTemplate("{json:json}") .withSsoadfsAuthority("https://adfs") @@ -55,16 +57,12 @@ public static void hostPoolCreate( .withSsoClientSecretKeyVaultPath("https://keyvault/secret") .withSsoSecretType(SsoSecretType.SHARED_KEY) .withStartVMOnConnect(false) - .withAgentUpdate( - new AgentUpdateProperties() - .withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays - .asList( - new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withAgentUpdate(new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("Alaskan Standard Time") + .withMaintenanceWindows( + Arrays.asList(new MaintenanceWindowProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) .create(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java index 777aaa57fb5d..4f715a4b0e13 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for HostPools Delete. */ +/** + * Samples for HostPools Delete. + */ public final class HostPoolsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Delete.json */ /** * Sample code: HostPool_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + hostPoolDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().deleteWithResponse("resourceGroup1", "hostPool1", true, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java index 8ab5ce0650e0..d5fbf08f314f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for HostPools GetByResourceGroup. */ +/** + * Samples for HostPools GetByResourceGroup. + */ public final class HostPoolsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Get.json */ /** * Sample code: HostPool_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .hostPools() + public static void + hostPoolGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java index 8f8a1916a901..7078672c1e08 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListByResourceGroupSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for HostPools ListByResourceGroup. */ +/** + * Samples for HostPools ListByResourceGroup. + */ public final class HostPoolsListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_ListByResourceGroup.json */ /** * Sample code: HostPool_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void hostPoolListByResourceGroup( diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java new file mode 100644 index 000000000000..e3dae94497c5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListRegistrationTokensSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +/** + * Samples for HostPools ListRegistrationTokens. + */ +public final class HostPoolsListRegistrationTokensSamples { + /* + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPools_ListRegistrationToken_Post.json + */ + /** + * Sample code: HostPools_ListRegistrationToken_Post. + * + * @param manager Entry point to DesktopVirtualizationManager. + */ + public static void hostPoolsListRegistrationTokenPost( + com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.hostPools() + .listRegistrationTokensWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java index e4edb9ceea55..79349b1cd366 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for HostPools List. */ +/** + * Samples for HostPools List. + */ public final class HostPoolsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_List.json */ /** * Sample code: HostPool_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + hostPoolList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.hostPools().list(10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java index 516b1e4c3329..dc80a34d7d4d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsRetrieveRegistrationTokenSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for HostPools RetrieveRegistrationToken. */ +/** + * Samples for HostPools RetrieveRegistrationToken. + */ public final class HostPoolsRetrieveRegistrationTokenSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPools_RetrieveRegistrationToken_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPools_RetrieveRegistrationToken_Post.json */ /** * Sample code: HostPools_RetrieveRegistrationToken_Post. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void hostPoolsRetrieveRegistrationTokenPost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .hostPools() + manager.hostPools() .retrieveRegistrationTokenWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java index 171045fcfb64..6105b07b4e12 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsUpdateSamples.java @@ -19,25 +19,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for HostPools Update. */ +/** + * Samples for HostPools Update. + */ public final class HostPoolsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * HostPool_Update.json */ /** * Sample code: HostPool_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void hostPoolUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - HostPool resource = - manager - .hostPools() - .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + hostPoolUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + HostPool resource = manager.hostPools() + .getByResourceGroupWithResponse("resourceGroup1", "hostPool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withFriendlyName("friendly") .withDescription("des1") @@ -45,8 +46,7 @@ public static void hostPoolUpdate( .withPersonalDesktopAssignmentType(PersonalDesktopAssignmentType.AUTOMATIC) .withLoadBalancerType(LoadBalancerType.BREADTH_FIRST) .withRegistrationInfo( - new RegistrationInfoPatch() - .withExpirationTime(OffsetDateTime.parse("2020-10-01T15:01:54.9571247Z")) + new RegistrationInfoPatch().withExpirationTime(OffsetDateTime.parse("2020-10-01T15:01:54.9571247Z")) .withRegistrationTokenOperation(RegistrationTokenOperation.UPDATE)) .withVmTemplate("{json:json}") .withSsoadfsAuthority("https://adfs") @@ -55,15 +55,12 @@ public static void hostPoolUpdate( .withSsoSecretType(SsoSecretType.SHARED_KEY) .withStartVMOnConnect(false) .withAgentUpdate( - new AgentUpdatePatchProperties() - .withType(SessionHostComponentUpdateType.SCHEDULED) + new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.SCHEDULED) .withUseSessionHostLocalTime(false) .withMaintenanceWindowTimeZone("Alaskan Standard Time") - .withMaintenanceWindows( - Arrays - .asList( - new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), - new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) + .withMaintenanceWindows(Arrays.asList( + new MaintenanceWindowPatchProperties().withHour(7).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowPatchProperties().withHour(8).withDayOfWeek(DayOfWeek.SATURDAY)))) .apply(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java index 08e32074dcc8..3544d107f149 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandSamples.java @@ -6,24 +6,24 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; -/** Samples for MsixImages Expand. */ +/** + * Samples for MsixImages Expand. + */ public final class MsixImagesExpandSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixImage_Expand_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixImage_Expand_Post.json */ /** * Sample code: MsixImage_Expand. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void msixImageExpand( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixImages() - .expand( - "resourceGroup1", - "hostpool1", - new MsixImageUri().withUri("imagepath"), + public static void + msixImageExpand(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixImages() + .expand("resourceGroup1", "hostpool1", new MsixImageUri().withUri("imagepath"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java index 7eb05104702e..b02f5b7793c1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateSamples.java @@ -9,20 +9,23 @@ import java.time.OffsetDateTime; import java.util.Arrays; -/** Samples for MsixPackages CreateOrUpdate. */ +/** + * Samples for MsixPackages CreateOrUpdate. + */ public final class MsixPackagesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Create.json */ /** * Sample code: MSIXPackage_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixPackages() + public static void + mSIXPackageCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() .define("msixpackagefullname") .withExistingHostPool("resourceGroup1", "hostpool1") .withImagePath("imagepath") @@ -33,25 +36,18 @@ public static void mSIXPackageCreate( .withIsRegularRegistration(false) .withIsActive(false) .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("MsixTest_Dependency_Name") - .withPublisher("PublishedName") - .withMinVersion("version"))) + Arrays.asList(new MsixPackageDependencies().withDependencyName("MsixTest_Dependency_Name") + .withPublisher("PublishedName") + .withMinVersion("version"))) .withVersion("version") .withLastUpdated(OffsetDateTime.parse("2008-09-22T14:01:54.9571247Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("ApplicationId") - .withDescription("application-desc") - .withAppUserModelId("AppUserModelId") - .withFriendlyName("friendlyname") - .withIconImageName("Apptile") - .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) - .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("ApplicationId") + .withDescription("application-desc") + .withAppUserModelId("AppUserModelId") + .withFriendlyName("friendlyname") + .withIconImageName("Apptile") + .withRawIcon("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()) + .withRawPng("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo".getBytes()))) .create(); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java index 3535f5d6c93d..881b5a1157ea 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for MsixPackages Delete. */ +/** + * Samples for MsixPackages Delete. + */ public final class MsixPackagesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Delete.json */ /** * Sample code: MSIXPackage_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixPackages() + public static void + mSIXPackageDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() .deleteWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java index d74c26d6d288..ce2d85bdb212 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for MsixPackages Get. */ +/** + * Samples for MsixPackages Get. + */ public final class MsixPackagesGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Get.json */ /** * Sample code: MSIXPackage_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .msixPackages() + public static void + mSIXPackageGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.msixPackages() .getWithResponse("resourceGroup1", "hostpool1", "packagefullname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java index f45e7e5ede6c..5f583f059ebd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for MsixPackages List. */ +/** + * Samples for MsixPackages List. + */ public final class MsixPackagesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_List.json */ /** * Sample code: MSIXPackage_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + mSIXPackageList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.msixPackages().list("resourceGroup1", "hostpool1", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java index 671bd72e6eb4..90f41c06f317 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesUpdateSamples.java @@ -6,23 +6,25 @@ import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -/** Samples for MsixPackages Update. */ +/** + * Samples for MsixPackages Update. + */ public final class MsixPackagesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * MsixPackage_Update.json */ /** * Sample code: MSIXPackage_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void mSIXPackageUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - MsixPackage resource = - manager - .msixPackages() - .getWithResponse("resourceGroup1", "hostpool1", "msixpackagefullname", com.azure.core.util.Context.NONE) - .getValue(); + public static void + mSIXPackageUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + MsixPackage resource = manager.msixPackages() + .getWithResponse("resourceGroup1", "hostpool1", "msixpackagefullname", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withIsActive(true).withIsRegularRegistration(false).withDisplayName("displayname").apply(); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java index 28b0226815cc..a9fe01ad7f4d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/OperationDescription_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * OperationDescription_List.json */ /** * Sample code: OperationDescription_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void operationDescriptionList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + operationDescriptionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java index e32cfef70403..b1b20270ef8b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateEndpointConnections DeleteByHostPool. */ +/** + * Samples for PrivateEndpointConnections DeleteByHostPool. + */ public final class PrivateEndpointConnectionsDeleteByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_DeleteByHostPool.json */ /** * Sample code: PrivateEndpointConnection_DeleteByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionDeleteByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .deleteByHostPoolWithResponse( - "resourceGroup1", - "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .deleteByHostPoolWithResponse("resourceGroup1", "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java index 69f4b8e0ed9e..9fac940cea4e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateEndpointConnections DeleteByWorkspace. */ +/** + * Samples for PrivateEndpointConnections DeleteByWorkspace. + */ public final class PrivateEndpointConnectionsDeleteByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_DeleteByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_DeleteByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionDeleteByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .deleteByWorkspaceWithResponse( - "resourceGroup1", - "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .deleteByWorkspaceWithResponse("resourceGroup1", "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java index e48da89af70a..4fd084c7b32f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateEndpointConnections GetByHostPool. */ +/** + * Samples for PrivateEndpointConnections GetByHostPool. + */ public final class PrivateEndpointConnectionsGetByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_GetByHostPool.json */ /** * Sample code: PrivateEndpointConnection_GetByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionGetByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .getByHostPoolWithResponse( - "resourceGroup1", - "hostPool1", - "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + manager.privateEndpointConnections() + .getByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java index 8f3e3d4ff540..64e51e6ad4e5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateEndpointConnections GetByWorkspace. */ +/** + * Samples for PrivateEndpointConnections GetByWorkspace. + */ public final class PrivateEndpointConnectionsGetByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_GetByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_GetByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionGetByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .getByWorkspaceWithResponse( - "resourceGroup1", - "workspace1", - "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .getByWorkspaceWithResponse("resourceGroup1", "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java index 58ed915c64e5..7bb9e7b03d2d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateEndpointConnections ListByHostPool. */ +/** + * Samples for PrivateEndpointConnections ListByHostPool. + */ public final class PrivateEndpointConnectionsListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_ListByHostPool.json */ /** * Sample code: PrivateEndpointConnection_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java index 271e032f9c9a..0bc4856731dc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateEndpointConnections ListByWorkspace. */ +/** + * Samples for PrivateEndpointConnections ListByWorkspace. + */ public final class PrivateEndpointConnectionsListByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_ListByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_ListByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionListByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .listByWorkspace("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java index 309d8ccbcd6a..53f8cf5621f3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolSamples.java @@ -8,30 +8,29 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections UpdateByHostPool. */ +/** + * Samples for PrivateEndpointConnections UpdateByHostPool. + */ public final class PrivateEndpointConnectionsUpdateByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_UpdateByHostPool.json */ /** * Sample code: PrivateEndpointConnection_UpdateByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionUpdateByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .updateByHostPoolWithResponse( - "resourceGroup1", - "hostPool1", + manager.privateEndpointConnections() + .updateByHostPoolWithResponse("resourceGroup1", "hostPool1", "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java index 7e351104dba2..23c1a2cba738 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceSamples.java @@ -8,30 +8,29 @@ import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections UpdateByWorkspace. */ +/** + * Samples for PrivateEndpointConnections UpdateByWorkspace. + */ public final class PrivateEndpointConnectionsUpdateByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateEndpointConnection_UpdateByWorkspace.json */ /** * Sample code: PrivateEndpointConnection_UpdateByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateEndpointConnectionUpdateByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateEndpointConnections() - .updateByWorkspaceWithResponse( - "resourceGroup1", - "workspace1", + manager.privateEndpointConnections() + .updateByWorkspaceWithResponse("resourceGroup1", "workspace1", "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", - new PrivateEndpointConnection() - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("Approved by admin@consoto.com") - .withActionsRequired("None")), + new PrivateEndpointConnection().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin@consoto.com") + .withActionsRequired("None")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java index b7d07c4ea030..0cad3a2d630a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateLinkResources ListByHostPool. */ +/** + * Samples for PrivateLinkResources ListByHostPool. + */ public final class PrivateLinkResourcesListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateLinkResources_ListByHostPool.json */ /** * Sample code: PrivateLinkResources_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateLinkResourcesListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateLinkResources() + manager.privateLinkResources() .listByHostPool("resourceGroup1", "hostPool1", null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java index 8dc18d338f9c..8e6d2426b07a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for PrivateLinkResources ListByWorkspace. */ +/** + * Samples for PrivateLinkResources ListByWorkspace. + */ public final class PrivateLinkResourcesListByWorkspaceSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByWorkspace.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * PrivateLinkResources_ListByWorkspace.json */ /** * Sample code: PrivateLinkResources_ListByWorkspace. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void privateLinkResourcesListByWorkspace( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .privateLinkResources() + manager.privateLinkResources() .listByWorkspace("resourceGroup1", "workspace1", null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java index 237dee12c609..35bb9cc43793 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateSamples.java @@ -11,26 +11,27 @@ import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; -/** Samples for ScalingPlanPersonalSchedules Create. */ +/** + * Samples for ScalingPlanPersonalSchedules Create. + */ public final class ScalingPlanPersonalSchedulesCreateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Create.json */ /** * Sample code: ScalingPlanPersonalSchedules_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesCreate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() + manager.scalingPlanPersonalSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) .withRampUpAutoStartHosts(StartupBehavior.ALL) .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java index 0c88ba2659ba..6b83c8622964 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlanPersonalSchedules Delete. */ +/** + * Samples for ScalingPlanPersonalSchedules Delete. + */ public final class ScalingPlanPersonalSchedulesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Delete.json */ /** * Sample code: ScalingPlanPersonalSchedules_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesDelete( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() - .deleteWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE); + manager.scalingPlanPersonalSchedules() + .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java index 1839d2b7d1e1..fade6f09052c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetSamples.java @@ -4,24 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlanPersonalSchedules Get. */ +/** + * Samples for ScalingPlanPersonalSchedules Get. + */ public final class ScalingPlanPersonalSchedulesGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Get.json */ /** * Sample code: ScalingPlanPersonalSchedules_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesGet( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() - .getWithResponse( - "resourceGroup1", - "PersonalScalingPlan1", - "PersonalScalingPlanSchedule", + manager.scalingPlanPersonalSchedules() + .getWithResponse("resourceGroup1", "PersonalScalingPlan1", "PersonalScalingPlanSchedule", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java index 3daaa366ec74..88e492b8a83a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlanPersonalSchedules List. */ +/** + * Samples for ScalingPlanPersonalSchedules List. + */ public final class ScalingPlanPersonalSchedulesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_List.json */ /** * Sample code: ScalingPlanPersonalSchedules_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesList( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPersonalSchedules() + manager.scalingPlanPersonalSchedules() .list("resourceGroup1", "scalingPlan", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java index a89a76ee5c55..3cb50c8c469f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesUpdateSamples.java @@ -9,26 +9,27 @@ import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.Time; -/** Samples for ScalingPlanPersonalSchedules Update. */ +/** + * Samples for ScalingPlanPersonalSchedules Update. + */ public final class ScalingPlanPersonalSchedulesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPersonalSchedule_Update.json */ /** * Sample code: ScalingPlanPersonalSchedules_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPersonalSchedulesUpdate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlanPersonalSchedule resource = - manager - .scalingPlanPersonalSchedules() - .getWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + ScalingPlanPersonalSchedule resource = manager.scalingPlanPersonalSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withPeakStartTime(new Time().withHour(8).withMinute(0)) .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) .withPeakMinutesToWaitOnDisconnect(10) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java index 57ba8cf561ff..b2a103d4761e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateSamples.java @@ -9,26 +9,27 @@ import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; -/** Samples for ScalingPlanPooledSchedules Create. */ +/** + * Samples for ScalingPlanPooledSchedules Create. + */ public final class ScalingPlanPooledSchedulesCreateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Create.json */ /** * Sample code: ScalingPlanPooledSchedules_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesCreate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() + manager.scalingPlanPooledSchedules() .define("scalingPlanScheduleWeekdays1") .withExistingScalingPlan("resourceGroup1", "scalingPlan1") - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) .withRampUpStartTime(new Time().withHour(6).withMinute(0)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .withRampUpMinimumHostsPct(20) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java index 73c7fe42a09d..21be7dc898b3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlanPooledSchedules Delete. */ +/** + * Samples for ScalingPlanPooledSchedules Delete. + */ public final class ScalingPlanPooledSchedulesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Delete.json */ /** * Sample code: ScalingPlanPooledSchedules_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesDelete( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() - .deleteWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE); + manager.scalingPlanPooledSchedules() + .deleteWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java index c709d6102088..36e723f0fbe0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlanPooledSchedules Get. */ +/** + * Samples for ScalingPlanPooledSchedules Get. + */ public final class ScalingPlanPooledSchedulesGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Get.json */ /** * Sample code: ScalingPlanPooledSchedules_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesGet( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() - .getWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE); + manager.scalingPlanPooledSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java index 695c3fb9c5bb..1174fdda1992 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlanPooledSchedules List. */ +/** + * Samples for ScalingPlanPooledSchedules List. + */ public final class ScalingPlanPooledSchedulesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_List.json */ /** * Sample code: ScalingPlanPooledSchedules_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesList( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlanPooledSchedules() + manager.scalingPlanPooledSchedules() .list("resourceGroup1", "scalingPlan1", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java index f9d99313f570..80fc7ef5f71e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesUpdateSamples.java @@ -10,30 +10,29 @@ import com.azure.resourcemanager.desktopvirtualization.models.Time; import java.util.Arrays; -/** Samples for ScalingPlanPooledSchedules Update. */ +/** + * Samples for ScalingPlanPooledSchedules Update. + */ public final class ScalingPlanPooledSchedulesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlanPooledSchedule_Update.json */ /** * Sample code: ScalingPlanPooledSchedules_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanPooledSchedulesUpdate( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlanPooledSchedule resource = - manager - .scalingPlanPooledSchedules() - .getWithResponse( - "resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, DayOfWeek.FRIDAY)) + ScalingPlanPooledSchedule resource = manager.scalingPlanPooledSchedules() + .getWithResponse("resourceGroup1", "scalingPlan1", "scalingPlanScheduleWeekdays1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY, + DayOfWeek.FRIDAY)) .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) .withRampUpCapacityThresholdPct(80) .withPeakStartTime(new Time().withHour(8).withMinute(0)) diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java index a6b224a2857f..36b86bab80fc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansCreateSamples.java @@ -14,20 +14,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for ScalingPlans Create. */ +/** + * Samples for ScalingPlans Create. + */ public final class ScalingPlansCreateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Create.json */ /** * Sample code: ScalingPlans_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + public static void + scalingPlansCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() .define("scalingPlan1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") @@ -37,41 +40,28 @@ public static void scalingPlansCreate( .withFriendlyName("Scaling Plan 1") .withHostPoolType(ScalingHostPoolType.POOLED) .withExclusionTag("value") - .withSchedules( - Arrays - .asList( - new ScalingSchedule() - .withName("schedule1") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(6).withMinute(0)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(20) - .withRampUpCapacityThresholdPct(80) - .withPeakStartTime(new Time().withHour(8).withMinute(0)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(18).withMinute(0)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(20) - .withRampDownCapacityThresholdPct(50) - .withRampDownForceLogoffUsers(true) - .withRampDownWaitTimeMinutes(30) - .withRampDownNotificationMessage("message") - .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences( - Arrays - .asList( - new ScalingHostPoolReference() - .withHostPoolArmPath( - "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") - .withScalingPlanEnabled(true))) + .withSchedules(Arrays.asList(new ScalingSchedule().withName("schedule1") + .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.MONDAY, + ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY, + ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) + .withRampUpStartTime(new Time().withHour(6).withMinute(0)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(20) + .withRampUpCapacityThresholdPct(80) + .withPeakStartTime(new Time().withHour(8).withMinute(0)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(18).withMinute(0)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(20) + .withRampDownCapacityThresholdPct(50) + .withRampDownForceLogoffUsers(true) + .withRampDownWaitTimeMinutes(30) + .withRampDownNotificationMessage("message") + .withOffPeakStartTime(new Time().withHour(20).withMinute(0)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) + .withHostPoolReferences(Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath( + "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1") + .withScalingPlanEnabled(true))) .create(); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java index a32071be0bac..783c833435f3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlans Delete. */ +/** + * Samples for ScalingPlans Delete. + */ public final class ScalingPlansDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Delete.json */ /** * Sample code: ScalingPlans_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + public static void + scalingPlansDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() .deleteByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java index fcb015cb26c0..5b2c4558fa9a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlans GetByResourceGroup. */ +/** + * Samples for ScalingPlans GetByResourceGroup. + */ public final class ScalingPlansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Get.json */ /** * Sample code: ScalingPlans_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + public static void + scalingPlansGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.scalingPlans() .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java index 0a6e860ab3b6..73d62377d1ee 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByHostPoolSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlans ListByHostPool. */ +/** + * Samples for ScalingPlans ListByHostPool. + */ public final class ScalingPlansListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_ListByHostPool.json */ /** * Sample code: ScalingPlan_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlanListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .scalingPlans() + manager.scalingPlans() .listByHostPool("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java index c8e8b6ddc8e3..32736c7059ca 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListByResourceGroupSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlans ListByResourceGroup. */ +/** + * Samples for ScalingPlans ListByResourceGroup. + */ public final class ScalingPlansListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_ListByResourceGroup.json */ /** * Sample code: ScalingPlans_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlansListByResourceGroup( diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java index 5f37f255b8d4..9ca1b42f132e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for ScalingPlans List. */ +/** + * Samples for ScalingPlans List. + */ public final class ScalingPlansListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListBySubscription.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_ListBySubscription.json */ /** * Sample code: ScalingPlans_ListBySubscription. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void scalingPlansListBySubscription( diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java index 40f559c3dd7a..1195e317705c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansUpdateSamples.java @@ -6,23 +6,25 @@ import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlan; -/** Samples for ScalingPlans Update. */ +/** + * Samples for ScalingPlans Update. + */ public final class ScalingPlansUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * ScalingPlan_Update.json */ /** * Sample code: ScalingPlans_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void scalingPlansUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - ScalingPlan resource = - manager - .scalingPlans() - .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) - .getValue(); + public static void + scalingPlansUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + ScalingPlan resource = manager.scalingPlans() + .getByResourceGroupWithResponse("resourceGroup1", "scalingPlan1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java index dd743a3e0a72..1d4fd832d03b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for SessionHosts Delete. */ +/** + * Samples for SessionHosts Delete. + */ public final class SessionHostsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_Delete.json */ /** * Sample code: SessionHost_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .sessionHosts() - .deleteWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, com.azure.core.util.Context.NONE); + public static void + sessionHostDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java index 9357f442e991..97905852f887 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsGetSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for SessionHosts Get. */ +/** + * Samples for SessionHosts Get. + */ public final class SessionHostsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_Get.json */ /** * Sample code: SessionHost_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .sessionHosts() - .getWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", com.azure.core.util.Context.NONE); + public static void + sessionHostGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java index a173fc7631fb..fa6f2bf4a7a4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsListSamples.java @@ -4,18 +4,22 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for SessionHosts List. */ +/** + * Samples for SessionHosts List. + */ public final class SessionHostsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_List.json */ /** * Sample code: SessionHost_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + public static void + sessionHostList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { manager.sessionHosts().list("resourceGroup1", "hostPool1", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java index 94607d6a7c12..9dd436628b88 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsUpdateSamples.java @@ -6,27 +6,25 @@ import com.azure.resourcemanager.desktopvirtualization.models.SessionHostPatch; -/** Samples for SessionHosts Update. */ +/** + * Samples for SessionHosts Update. + */ public final class SessionHostsUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * SessionHost_Update.json */ /** * Sample code: SessionHost_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void sessionHostUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .sessionHosts() - .updateWithResponse( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - true, - new SessionHostPatch() - .withAllowNewSession(true) + public static void + sessionHostUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.sessionHosts() + .updateWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", true, + new SessionHostPatch().withAllowNewSession(true) .withAssignedUser("user1@microsoft.com") .withFriendlyName("friendly"), com.azure.core.util.Context.NONE); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java index aac9de967e81..28035bfee527 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for StartMenuItems List. */ +/** + * Samples for StartMenuItems List. + */ public final class StartMenuItemsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/StartMenuItem_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * StartMenuItem_List.json */ /** * Sample code: StartMenuItem_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void startMenuItemList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .startMenuItems() + public static void + startMenuItemList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.startMenuItems() .list("resourceGroup1", "applicationGroup1", null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java index b6d8cb96e044..6c07821d7f9e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteSamples.java @@ -4,26 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for UserSessions Delete. */ +/** + * Samples for UserSessions Delete. + */ public final class UserSessionsDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_Delete.json */ /** * Sample code: UserSession_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .deleteWithResponse( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - "1", - true, + public static void + userSessionDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .deleteWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", true, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java index d8ca961dd9af..e3776042a696 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for UserSessions Disconnect. */ +/** + * Samples for UserSessions Disconnect. + */ public final class UserSessionsDisconnectSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Disconnect_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_Disconnect_Post.json */ /** * Sample code: UserSession_Disconnect_Post. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void userSessionDisconnectPost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .disconnectWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", com.azure.core.util.Context.NONE); + manager.userSessions() + .disconnectWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java index 063dcb23c53c..a96d185dffee 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetSamples.java @@ -4,21 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for UserSessions Get. */ +/** + * Samples for UserSessions Get. + */ public final class UserSessionsGetSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_Get.json */ /** * Sample code: UserSession_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .getWithResponse( - "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", com.azure.core.util.Context.NONE); + public static void + userSessionGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .getWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java index 743af2364466..3bc2e2d94a06 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolSamples.java @@ -4,27 +4,25 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for UserSessions ListByHostPool. */ +/** + * Samples for UserSessions ListByHostPool. + */ public final class UserSessionsListByHostPoolSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_ListByHostPool.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_ListByHostPool.json */ /** * Sample code: UserSession_ListByHostPool. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void userSessionListByHostPool( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .listByHostPool( - "resourceGroup1", - "hostPool1", - "userPrincipalName eq 'user1@microsoft.com' and state eq 'active'", - 10, - true, - 0, + manager.userSessions() + .listByHostPool("resourceGroup1", "hostPool1", + "userPrincipalName eq 'user1@microsoft.com' and state eq 'active'", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java index b1ad5dc1c671..e9cfab81fb36 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListSamples.java @@ -4,27 +4,24 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for UserSessions List. */ +/** + * Samples for UserSessions List. + */ public final class UserSessionsListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_List.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_List.json */ /** * Sample code: UserSession_List. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void userSessionList( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .list( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - 10, - true, - 0, + public static void + userSessionList(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.userSessions() + .list("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", 10, true, 0, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java index 1927a382d8f1..5fdc03e498e4 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageSamples.java @@ -6,26 +6,24 @@ import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; -/** Samples for UserSessions SendMessage. */ +/** + * Samples for UserSessions SendMessage. + */ public final class UserSessionsSendMessageSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_SendMessage_Post.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * UserSession_SendMessage_Post.json */ /** * Sample code: UserSession_SendMessage_Post. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void userSessionSendMessagePost( com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .userSessions() - .sendMessageWithResponse( - "resourceGroup1", - "hostPool1", - "sessionHost1.microsoft.com", - "1", - new SendMessage().withMessageTitle("title").withMessageBody("body"), - com.azure.core.util.Context.NONE); + manager.userSessions() + .sendMessageWithResponse("resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", "1", + new SendMessage().withMessageTitle("title").withMessageBody("body"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java index d00760de9e64..601bb273404f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesCreateOrUpdateSamples.java @@ -7,20 +7,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces CreateOrUpdate. */ +/** + * Samples for Workspaces CreateOrUpdate. + */ public final class WorkspacesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Create.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Create.json */ /** * Sample code: Workspace_Create. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceCreate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .workspaces() + public static void + workspaceCreate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() .define("workspace1") .withRegion("centralus") .withExistingResourceGroup("resourceGroup1") diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java index 6e94a24b977d..cc27cfe7dfb9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Workspaces Delete. */ +/** + * Samples for Workspaces Delete. + */ public final class WorkspacesDeleteSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Delete.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Delete.json */ /** * Sample code: Workspace_Delete. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceDelete( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .workspaces() + public static void + workspaceDelete(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() .deleteByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java index 0d4bb1ef6d29..2b1a65bd6a61 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesGetByResourceGroupSamples.java @@ -4,20 +4,23 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Workspaces GetByResourceGroup. */ +/** + * Samples for Workspaces GetByResourceGroup. + */ public final class WorkspacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Get.json */ /** * Sample code: Workspace_Get. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceGet( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - manager - .workspaces() + public static void + workspaceGet(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + manager.workspaces() .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java index e19d22123052..6353f4f4407e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListByResourceGroupSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Workspaces ListByResourceGroup. */ +/** + * Samples for Workspaces ListByResourceGroup. + */ public final class WorkspacesListByResourceGroupSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListByResourceGroup.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_ListByResourceGroup.json */ /** * Sample code: Workspace_ListByResourceGroup. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void workspaceListByResourceGroup( diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java index b319baabb4c3..880944f93d66 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesListSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.desktopvirtualization.generated; -/** Samples for Workspaces List. */ +/** + * Samples for Workspaces List. + */ public final class WorkspacesListSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListBySubscription.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_ListBySubscription.json */ /** * Sample code: Workspace_ListBySubscription. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ public static void workspaceListBySubscription( diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java index 24be100cd849..1bbcda9d8499 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/samples/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesUpdateSamples.java @@ -8,25 +8,26 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Workspaces Update. */ +/** + * Samples for Workspaces Update. + */ public final class WorkspacesUpdateSamples { /* - * x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Update.json + * x-ms-original-file: + * specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ + * Workspace_Update.json */ /** * Sample code: Workspace_Update. - * + * * @param manager Entry point to DesktopVirtualizationManager. */ - public static void workspaceUpdate( - com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { - Workspace resource = - manager - .workspaces() - .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + workspaceUpdate(com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager) { + Workspace resource = manager.workspaces() + .getByResourceGroupWithResponse("resourceGroup1", "workspace1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withDescription("des1") .withFriendlyName("friendly") diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java index 275cfc87770b..dc6af8be8779 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePatchPropertiesTests.java @@ -15,39 +15,31 @@ public final class AgentUpdatePatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AgentUpdatePatchProperties model = - BinaryData - .fromString( - "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":false,\"maintenanceWindowTimeZone\":\"lzywemhzrncsdtc\",\"maintenanceWindows\":[{\"hour\":2121256273,\"dayOfWeek\":\"Thursday\"},{\"hour\":1674447280,\"dayOfWeek\":\"Thursday\"}]}") - .toObject(AgentUpdatePatchProperties.class); - Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); + AgentUpdatePatchProperties model = BinaryData.fromString( + "{\"type\":\"Default\",\"useSessionHostLocalTime\":false,\"maintenanceWindowTimeZone\":\"exmk\",\"maintenanceWindows\":[{\"hour\":1054348500,\"dayOfWeek\":\"Monday\"},{\"hour\":1964594423,\"dayOfWeek\":\"Wednesday\"},{\"hour\":471536025,\"dayOfWeek\":\"Wednesday\"}]}") + .toObject(AgentUpdatePatchProperties.class); + Assertions.assertEquals(SessionHostComponentUpdateType.DEFAULT, model.type()); Assertions.assertEquals(false, model.useSessionHostLocalTime()); - Assertions.assertEquals("lzywemhzrncsdtc", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(2121256273, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.maintenanceWindows().get(0).dayOfWeek()); + Assertions.assertEquals("exmk", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(1054348500, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.MONDAY, model.maintenanceWindows().get(0).dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AgentUpdatePatchProperties model = - new AgentUpdatePatchProperties() - .withType(SessionHostComponentUpdateType.SCHEDULED) + AgentUpdatePatchProperties model + = new AgentUpdatePatchProperties().withType(SessionHostComponentUpdateType.DEFAULT) .withUseSessionHostLocalTime(false) - .withMaintenanceWindowTimeZone("lzywemhzrncsdtc") - .withMaintenanceWindows( - Arrays - .asList( - new MaintenanceWindowPatchProperties() - .withHour(2121256273) - .withDayOfWeek(DayOfWeek.THURSDAY), - new MaintenanceWindowPatchProperties() - .withHour(1674447280) - .withDayOfWeek(DayOfWeek.THURSDAY))); + .withMaintenanceWindowTimeZone("exmk") + .withMaintenanceWindows(Arrays.asList( + new MaintenanceWindowPatchProperties().withHour(1054348500).withDayOfWeek(DayOfWeek.MONDAY), + new MaintenanceWindowPatchProperties().withHour(1964594423).withDayOfWeek(DayOfWeek.WEDNESDAY), + new MaintenanceWindowPatchProperties().withHour(471536025).withDayOfWeek(DayOfWeek.WEDNESDAY))); model = BinaryData.fromObject(model).toObject(AgentUpdatePatchProperties.class); - Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); + Assertions.assertEquals(SessionHostComponentUpdateType.DEFAULT, model.type()); Assertions.assertEquals(false, model.useSessionHostLocalTime()); - Assertions.assertEquals("lzywemhzrncsdtc", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(2121256273, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.maintenanceWindows().get(0).dayOfWeek()); + Assertions.assertEquals("exmk", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(1054348500, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.MONDAY, model.maintenanceWindows().get(0).dayOfWeek()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java index bd031a6ba1a4..b66c2b818027 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AgentUpdatePropertiesTests.java @@ -15,36 +15,29 @@ public final class AgentUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AgentUpdateProperties model = - BinaryData - .fromString( - "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":true,\"maintenanceWindowTimeZone\":\"kopbminrf\",\"maintenanceWindows\":[{\"hour\":1704063633,\"dayOfWeek\":\"Tuesday\"},{\"hour\":1209901082,\"dayOfWeek\":\"Monday\"},{\"hour\":2008385948,\"dayOfWeek\":\"Wednesday\"}]}") - .toObject(AgentUpdateProperties.class); + AgentUpdateProperties model = BinaryData.fromString( + "{\"type\":\"Scheduled\",\"useSessionHostLocalTime\":false,\"maintenanceWindowTimeZone\":\"dlhewp\",\"maintenanceWindows\":[{\"hour\":270021296,\"dayOfWeek\":\"Friday\"},{\"hour\":1072941550,\"dayOfWeek\":\"Tuesday\"}]}") + .toObject(AgentUpdateProperties.class); Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); - Assertions.assertEquals(true, model.useSessionHostLocalTime()); - Assertions.assertEquals("kopbminrf", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(1704063633, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.TUESDAY, model.maintenanceWindows().get(0).dayOfWeek()); + Assertions.assertEquals(false, model.useSessionHostLocalTime()); + Assertions.assertEquals("dlhewp", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(270021296, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.maintenanceWindows().get(0).dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AgentUpdateProperties model = - new AgentUpdateProperties() - .withType(SessionHostComponentUpdateType.SCHEDULED) - .withUseSessionHostLocalTime(true) - .withMaintenanceWindowTimeZone("kopbminrf") - .withMaintenanceWindows( - Arrays - .asList( - new MaintenanceWindowProperties().withHour(1704063633).withDayOfWeek(DayOfWeek.TUESDAY), - new MaintenanceWindowProperties().withHour(1209901082).withDayOfWeek(DayOfWeek.MONDAY), - new MaintenanceWindowProperties().withHour(2008385948).withDayOfWeek(DayOfWeek.WEDNESDAY))); + AgentUpdateProperties model = new AgentUpdateProperties().withType(SessionHostComponentUpdateType.SCHEDULED) + .withUseSessionHostLocalTime(false) + .withMaintenanceWindowTimeZone("dlhewp") + .withMaintenanceWindows( + Arrays.asList(new MaintenanceWindowProperties().withHour(270021296).withDayOfWeek(DayOfWeek.FRIDAY), + new MaintenanceWindowProperties().withHour(1072941550).withDayOfWeek(DayOfWeek.TUESDAY))); model = BinaryData.fromObject(model).toObject(AgentUpdateProperties.class); Assertions.assertEquals(SessionHostComponentUpdateType.SCHEDULED, model.type()); - Assertions.assertEquals(true, model.useSessionHostLocalTime()); - Assertions.assertEquals("kopbminrf", model.maintenanceWindowTimeZone()); - Assertions.assertEquals(1704063633, model.maintenanceWindows().get(0).hour()); - Assertions.assertEquals(DayOfWeek.TUESDAY, model.maintenanceWindows().get(0).dayOfWeek()); + Assertions.assertEquals(false, model.useSessionHostLocalTime()); + Assertions.assertEquals("dlhewp", model.maintenanceWindowTimeZone()); + Assertions.assertEquals(270021296, model.maintenanceWindows().get(0).hour()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.maintenanceWindows().get(0).dayOfWeek()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoPropertiesTests.java new file mode 100644 index 000000000000..31137dd5c895 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackageInfoPropertiesTests.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageInfoProperties; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; +import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; +import com.azure.resourcemanager.desktopvirtualization.models.PackageTimestamped; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AppAttachPackageInfoPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AppAttachPackageInfoProperties model = BinaryData.fromString( + "{\"packageAlias\":\"fieypefojyqdhcup\",\"imagePath\":\"plcwkhi\",\"packageName\":\"hlhzdsqtzbsrgno\",\"packageFamilyName\":\"jhf\",\"packageFullName\":\"vecactx\",\"displayName\":\"oteyowc\",\"packageRelativePath\":\"qovekqvgqou\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"yivqikfxcvhrfsp\",\"publisher\":\"agr\",\"minVersion\":\"ikteusqczkvyk\"}],\"version\":\"ubyjaffmmf\",\"lastUpdated\":\"2021-09-28T19:04:07Z\",\"packageApplications\":[{\"appId\":\"ubgq\",\"description\":\"rtalmet\",\"appUserModelID\":\"wgdsl\",\"friendlyName\":\"ihhrmo\",\"iconImageName\":\"z\"},{\"appId\":\"pxiutc\",\"description\":\"pzhyr\",\"appUserModelID\":\"togebjoxsl\",\"friendlyName\":\"nhl\",\"iconImageName\":\"rqnkkzjcjbtr\"}],\"certificateName\":\"vvib\",\"certificateExpiry\":\"2021-06-30T16:55:59Z\",\"isPackageTimestamped\":\"Timestamped\"}") + .toObject(AppAttachPackageInfoProperties.class); + Assertions.assertEquals("fieypefojyqdhcup", model.packageAlias()); + Assertions.assertEquals("plcwkhi", model.imagePath()); + Assertions.assertEquals("hlhzdsqtzbsrgno", model.packageName()); + Assertions.assertEquals("jhf", model.packageFamilyName()); + Assertions.assertEquals("vecactx", model.packageFullName()); + Assertions.assertEquals("oteyowc", model.displayName()); + Assertions.assertEquals("qovekqvgqou", model.packageRelativePath()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals(false, model.isActive()); + Assertions.assertEquals("yivqikfxcvhrfsp", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("agr", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("ikteusqczkvyk", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("ubyjaffmmf", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T19:04:07Z"), model.lastUpdated()); + Assertions.assertEquals("ubgq", model.packageApplications().get(0).appId()); + Assertions.assertEquals("rtalmet", model.packageApplications().get(0).description()); + Assertions.assertEquals("wgdsl", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("ihhrmo", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("z", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("vvib", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T16:55:59Z"), model.certificateExpiry()); + Assertions.assertEquals(PackageTimestamped.TIMESTAMPED, model.isPackageTimestamped()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AppAttachPackageInfoProperties model = new AppAttachPackageInfoProperties().withPackageAlias("fieypefojyqdhcup") + .withImagePath("plcwkhi") + .withPackageName("hlhzdsqtzbsrgno") + .withPackageFamilyName("jhf") + .withPackageFullName("vecactx") + .withDisplayName("oteyowc") + .withPackageRelativePath("qovekqvgqou") + .withIsRegularRegistration(true) + .withIsActive(false) + .withPackageDependencies(Arrays.asList(new MsixPackageDependencies().withDependencyName("yivqikfxcvhrfsp") + .withPublisher("agr") + .withMinVersion("ikteusqczkvyk"))) + .withVersion("ubyjaffmmf") + .withLastUpdated(OffsetDateTime.parse("2021-09-28T19:04:07Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("ubgq") + .withDescription("rtalmet") + .withAppUserModelId("wgdsl") + .withFriendlyName("ihhrmo") + .withIconImageName("z"), + new MsixPackageApplications().withAppId("pxiutc") + .withDescription("pzhyr") + .withAppUserModelId("togebjoxsl") + .withFriendlyName("nhl") + .withIconImageName("rqnkkzjcjbtr"))) + .withCertificateName("vvib") + .withCertificateExpiry(OffsetDateTime.parse("2021-06-30T16:55:59Z")) + .withIsPackageTimestamped(PackageTimestamped.TIMESTAMPED); + model = BinaryData.fromObject(model).toObject(AppAttachPackageInfoProperties.class); + Assertions.assertEquals("fieypefojyqdhcup", model.packageAlias()); + Assertions.assertEquals("plcwkhi", model.imagePath()); + Assertions.assertEquals("hlhzdsqtzbsrgno", model.packageName()); + Assertions.assertEquals("jhf", model.packageFamilyName()); + Assertions.assertEquals("vecactx", model.packageFullName()); + Assertions.assertEquals("oteyowc", model.displayName()); + Assertions.assertEquals("qovekqvgqou", model.packageRelativePath()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals(false, model.isActive()); + Assertions.assertEquals("yivqikfxcvhrfsp", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("agr", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("ikteusqczkvyk", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("ubyjaffmmf", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T19:04:07Z"), model.lastUpdated()); + Assertions.assertEquals("ubgq", model.packageApplications().get(0).appId()); + Assertions.assertEquals("rtalmet", model.packageApplications().get(0).description()); + Assertions.assertEquals("wgdsl", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("ihhrmo", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("z", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("vvib", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-30T16:55:59Z"), model.certificateExpiry()); + Assertions.assertEquals(PackageTimestamped.TIMESTAMPED, model.isPackageTimestamped()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..d4b94f4f4e4f --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/AppAttachPackagesDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AppAttachPackagesDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.appAttachPackages() + .deleteByResourceGroupWithResponse("gmokzkltrfowt", "vrfmvlihcvjd", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java index 6f22ff4e82f3..6b32070d87bc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchPropertiesTests.java @@ -11,25 +11,22 @@ public final class ApplicationGroupPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationGroupPatchProperties model = - BinaryData - .fromString("{\"description\":\"hjpglkf\",\"friendlyName\":\"hdneuelfph\",\"showInFeed\":true}") + ApplicationGroupPatchProperties model + = BinaryData.fromString("{\"description\":\"dsjnka\",\"friendlyName\":\"utiiswacf\",\"showInFeed\":true}") .toObject(ApplicationGroupPatchProperties.class); - Assertions.assertEquals("hjpglkf", model.description()); - Assertions.assertEquals("hdneuelfph", model.friendlyName()); + Assertions.assertEquals("dsjnka", model.description()); + Assertions.assertEquals("utiiswacf", model.friendlyName()); Assertions.assertEquals(true, model.showInFeed()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationGroupPatchProperties model = - new ApplicationGroupPatchProperties() - .withDescription("hjpglkf") - .withFriendlyName("hdneuelfph") - .withShowInFeed(true); + ApplicationGroupPatchProperties model = new ApplicationGroupPatchProperties().withDescription("dsjnka") + .withFriendlyName("utiiswacf") + .withShowInFeed(true); model = BinaryData.fromObject(model).toObject(ApplicationGroupPatchProperties.class); - Assertions.assertEquals("hjpglkf", model.description()); - Assertions.assertEquals("hdneuelfph", model.friendlyName()); + Assertions.assertEquals("dsjnka", model.description()); + Assertions.assertEquals("utiiswacf", model.friendlyName()); Assertions.assertEquals(true, model.showInFeed()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java index 6296f5135968..65f2e2e30a27 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPatchTests.java @@ -13,39 +13,27 @@ public final class ApplicationGroupPatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationGroupPatch model = - BinaryData - .fromString( - "{\"tags\":{\"wakbogqxndl\":\"obdagxtibqdxb\",\"uriplbpodxunkb\":\"zgx\",\"lrb\":\"bxmubyynt\",\"l\":\"tkoievseotgq\"},\"properties\":{\"description\":\"u\",\"friendlyName\":\"auwzizxbmpgc\",\"showInFeed\":true},\"id\":\"u\",\"name\":\"muvp\",\"type\":\"ttdumorppxebmnzb\"}") - .toObject(ApplicationGroupPatch.class); - Assertions.assertEquals("obdagxtibqdxb", model.tags().get("wakbogqxndl")); - Assertions.assertEquals("u", model.description()); - Assertions.assertEquals("auwzizxbmpgc", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); + ApplicationGroupPatch model = BinaryData.fromString( + "{\"tags\":{\"tmuwlauwzi\":\"vseotgqrl\",\"cjefuzmu\":\"xbmp\",\"rp\":\"pbttdum\",\"mnzb\":\"xe\"},\"properties\":{\"description\":\"jpglkfgohdne\",\"friendlyName\":\"lfphsdyhtozfikd\",\"showInFeed\":false},\"id\":\"uuvxz\",\"name\":\"clvit\",\"type\":\"hqzonosggbhcoh\"}") + .toObject(ApplicationGroupPatch.class); + Assertions.assertEquals("vseotgqrl", model.tags().get("tmuwlauwzi")); + Assertions.assertEquals("jpglkfgohdne", model.description()); + Assertions.assertEquals("lfphsdyhtozfikd", model.friendlyName()); + Assertions.assertEquals(false, model.showInFeed()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationGroupPatch model = - new ApplicationGroupPatch() - .withTags( - mapOf( - "wakbogqxndl", - "obdagxtibqdxb", - "uriplbpodxunkb", - "zgx", - "lrb", - "bxmubyynt", - "l", - "tkoievseotgq")) - .withDescription("u") - .withFriendlyName("auwzizxbmpgc") - .withShowInFeed(true); + ApplicationGroupPatch model = new ApplicationGroupPatch() + .withTags(mapOf("tmuwlauwzi", "vseotgqrl", "cjefuzmu", "xbmp", "rp", "pbttdum", "mnzb", "xe")) + .withDescription("jpglkfgohdne") + .withFriendlyName("lfphsdyhtozfikd") + .withShowInFeed(false); model = BinaryData.fromObject(model).toObject(ApplicationGroupPatch.class); - Assertions.assertEquals("obdagxtibqdxb", model.tags().get("wakbogqxndl")); - Assertions.assertEquals("u", model.description()); - Assertions.assertEquals("auwzizxbmpgc", model.friendlyName()); - Assertions.assertEquals(true, model.showInFeed()); + Assertions.assertEquals("vseotgqrl", model.tags().get("tmuwlauwzi")); + Assertions.assertEquals("jpglkfgohdne", model.description()); + Assertions.assertEquals("lfphsdyhtozfikd", model.friendlyName()); + Assertions.assertEquals(false, model.showInFeed()); } // Use "Map.of" if available diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java index 1abb205efdc2..e3251c77435e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupPropertiesTests.java @@ -12,32 +12,28 @@ public final class ApplicationGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationGroupProperties model = - BinaryData - .fromString( - "{\"objectId\":\"tppjflcx\",\"description\":\"aokonzmnsik\",\"friendlyName\":\"kqze\",\"hostPoolArmPath\":\"qkdltfz\",\"workspaceArmPath\":\"hhvh\",\"applicationGroupType\":\"RemoteApp\",\"cloudPcResource\":true,\"showInFeed\":true}") - .toObject(ApplicationGroupProperties.class); - Assertions.assertEquals("aokonzmnsik", model.description()); - Assertions.assertEquals("kqze", model.friendlyName()); - Assertions.assertEquals("qkdltfz", model.hostPoolArmPath()); - Assertions.assertEquals(ApplicationGroupType.REMOTE_APP, model.applicationGroupType()); + ApplicationGroupProperties model = BinaryData.fromString( + "{\"objectId\":\"kwobdagxtibq\",\"description\":\"bxwakbog\",\"friendlyName\":\"ndlkzgxhurip\",\"hostPoolArmPath\":\"bpodxunkbebxm\",\"workspaceArmPath\":\"yyntwl\",\"applicationGroupType\":\"Desktop\",\"cloudPcResource\":true,\"showInFeed\":true}") + .toObject(ApplicationGroupProperties.class); + Assertions.assertEquals("bxwakbog", model.description()); + Assertions.assertEquals("ndlkzgxhurip", model.friendlyName()); + Assertions.assertEquals("bpodxunkbebxm", model.hostPoolArmPath()); + Assertions.assertEquals(ApplicationGroupType.DESKTOP, model.applicationGroupType()); Assertions.assertEquals(true, model.showInFeed()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationGroupProperties model = - new ApplicationGroupProperties() - .withDescription("aokonzmnsik") - .withFriendlyName("kqze") - .withHostPoolArmPath("qkdltfz") - .withApplicationGroupType(ApplicationGroupType.REMOTE_APP) - .withShowInFeed(true); + ApplicationGroupProperties model = new ApplicationGroupProperties().withDescription("bxwakbog") + .withFriendlyName("ndlkzgxhurip") + .withHostPoolArmPath("bpodxunkbebxm") + .withApplicationGroupType(ApplicationGroupType.DESKTOP) + .withShowInFeed(true); model = BinaryData.fromObject(model).toObject(ApplicationGroupProperties.class); - Assertions.assertEquals("aokonzmnsik", model.description()); - Assertions.assertEquals("kqze", model.friendlyName()); - Assertions.assertEquals("qkdltfz", model.hostPoolArmPath()); - Assertions.assertEquals(ApplicationGroupType.REMOTE_APP, model.applicationGroupType()); + Assertions.assertEquals("bxwakbog", model.description()); + Assertions.assertEquals("ndlkzgxhurip", model.friendlyName()); + Assertions.assertEquals("bpodxunkbebxm", model.hostPoolArmPath()); + Assertions.assertEquals(ApplicationGroupType.DESKTOP, model.applicationGroupType()); Assertions.assertEquals(true, model.showInFeed()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java index 996ef82e2dfe..3b6ff005d3ed 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationGroupsDeleteByResourceGroupWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ApplicationGroupsDeleteByResourceGroupWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.applicationGroups() + .deleteByResourceGroupWithResponse("kklelssxblycs", "zujksrlsmdes", com.azure.core.util.Context.NONE); - manager - .applicationGroups() - .deleteByResourceGroupWithResponse("kxxpvbrd", "jmzsyzfh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java index 302fda66e8f0..709c7e782c29 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationInnerTests.java @@ -13,50 +13,46 @@ public final class ApplicationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationInner model = - BinaryData - .fromString( - "{\"properties\":{\"objectId\":\"uqgbdbutauvfbt\",\"description\":\"whhmhykojo\",\"friendlyName\":\"fnndl\",\"filePath\":\"chkoymkcdyh\",\"msixPackageFamilyName\":\"kkpwdreqnovvq\",\"msixPackageApplicationId\":\"vljxywsu\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"ndsytgadg\",\"showInPortal\":true,\"iconPath\":\"aeneqnzarrwl\",\"iconIndex\":1397845425,\"iconHash\":\"jfqka\"},\"id\":\"wiipfpub\",\"name\":\"ibwwiftohqkv\",\"type\":\"uvksgplsaknynfsy\"}") - .toObject(ApplicationInner.class); - Assertions.assertEquals("whhmhykojo", model.description()); - Assertions.assertEquals("fnndl", model.friendlyName()); - Assertions.assertEquals("chkoymkcdyh", model.filePath()); - Assertions.assertEquals("kkpwdreqnovvq", model.msixPackageFamilyName()); - Assertions.assertEquals("vljxywsu", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); + ApplicationInner model = BinaryData.fromString( + "{\"properties\":{\"objectId\":\"ynl\",\"description\":\"huopxodlqiynto\",\"friendlyName\":\"ihleos\",\"filePath\":\"w\",\"msixPackageFamilyName\":\"mslyzrpzbchckqqz\",\"msixPackageApplicationId\":\"ox\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"i\",\"showInPortal\":true,\"iconPath\":\"edyatrwyhqmibzyh\",\"iconIndex\":893061772,\"iconHash\":\"mypyynpcdpu\"},\"id\":\"g\",\"name\":\"wznm\",\"type\":\"biknsorgjhxbld\"}") + .toObject(ApplicationInner.class); + Assertions.assertEquals("huopxodlqiynto", model.description()); + Assertions.assertEquals("ihleos", model.friendlyName()); + Assertions.assertEquals("w", model.filePath()); + Assertions.assertEquals("mslyzrpzbchckqqz", model.msixPackageFamilyName()); + Assertions.assertEquals("ox", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); - Assertions.assertEquals("ndsytgadg", model.commandLineArguments()); + Assertions.assertEquals("i", model.commandLineArguments()); Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("aeneqnzarrwl", model.iconPath()); - Assertions.assertEquals(1397845425, model.iconIndex()); + Assertions.assertEquals("edyatrwyhqmibzyh", model.iconPath()); + Assertions.assertEquals(893061772, model.iconIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationInner model = - new ApplicationInner() - .withDescription("whhmhykojo") - .withFriendlyName("fnndl") - .withFilePath("chkoymkcdyh") - .withMsixPackageFamilyName("kkpwdreqnovvq") - .withMsixPackageApplicationId("vljxywsu") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withCommandLineArguments("ndsytgadg") - .withShowInPortal(true) - .withIconPath("aeneqnzarrwl") - .withIconIndex(1397845425); + ApplicationInner model = new ApplicationInner().withDescription("huopxodlqiynto") + .withFriendlyName("ihleos") + .withFilePath("w") + .withMsixPackageFamilyName("mslyzrpzbchckqqz") + .withMsixPackageApplicationId("ox") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("i") + .withShowInPortal(true) + .withIconPath("edyatrwyhqmibzyh") + .withIconIndex(893061772); model = BinaryData.fromObject(model).toObject(ApplicationInner.class); - Assertions.assertEquals("whhmhykojo", model.description()); - Assertions.assertEquals("fnndl", model.friendlyName()); - Assertions.assertEquals("chkoymkcdyh", model.filePath()); - Assertions.assertEquals("kkpwdreqnovvq", model.msixPackageFamilyName()); - Assertions.assertEquals("vljxywsu", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); + Assertions.assertEquals("huopxodlqiynto", model.description()); + Assertions.assertEquals("ihleos", model.friendlyName()); + Assertions.assertEquals("w", model.filePath()); + Assertions.assertEquals("mslyzrpzbchckqqz", model.msixPackageFamilyName()); + Assertions.assertEquals("ox", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); - Assertions.assertEquals("ndsytgadg", model.commandLineArguments()); + Assertions.assertEquals("i", model.commandLineArguments()); Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("aeneqnzarrwl", model.iconPath()); - Assertions.assertEquals(1397845425, model.iconIndex()); + Assertions.assertEquals("edyatrwyhqmibzyh", model.iconPath()); + Assertions.assertEquals(893061772, model.iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java index 1f2d5d63af09..49d70ea03ca9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationListTests.java @@ -15,90 +15,58 @@ public final class ApplicationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"hfjx\",\"description\":\"szkkfoqre\",\"friendlyName\":\"kzikfjawneaivxwc\",\"filePath\":\"lpcirelsf\",\"msixPackageFamilyName\":\"enwabfatk\",\"msixPackageApplicationId\":\"dxbjhwuaanozj\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"oulpjrv\",\"showInPortal\":true,\"iconPath\":\"rvimjwosytxitcsk\",\"iconIndex\":212130052,\"iconHash\":\"qumiek\"},\"id\":\"zzikhlyfjhdg\",\"name\":\"gge\",\"type\":\"dunyg\"},{\"properties\":{\"objectId\":\"idb\",\"description\":\"atpxl\",\"friendlyName\":\"xcyjmoadsuvarmy\",\"filePath\":\"mjsjqb\",\"msixPackageFamilyName\":\"hyxxrwlycoduhpk\",\"msixPackageApplicationId\":\"gymare\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"qugjhkycube\",\"showInPortal\":false,\"iconPath\":\"sofwqmzqalkrmnji\",\"iconIndex\":988494266,\"iconHash\":\"cqqudf\"},\"id\":\"yxbaaabjyvayf\",\"name\":\"imrzrtuzqog\",\"type\":\"exn\"},{\"properties\":{\"objectId\":\"dnw\",\"description\":\"mewzsyyc\",\"friendlyName\":\"zsoibjudpfrxtr\",\"filePath\":\"zvaytdwkqbr\",\"msixPackageFamilyName\":\"bpaxhexiilivpdt\",\"msixPackageApplicationId\":\"r\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"axoruzfgsquy\",\"showInPortal\":false,\"iconPath\":\"xleptramx\",\"iconIndex\":726747953,\"iconHash\":\"lwnwxuqlcvydyp\"},\"id\":\"dooaojkniodko\",\"name\":\"ebwnujhe\",\"type\":\"msbvdkcrodtjinf\"},{\"properties\":{\"objectId\":\"fltkacjv\",\"description\":\"kdlfoa\",\"friendlyName\":\"gkfpaga\",\"filePath\":\"pulpqblylsyxk\",\"msixPackageFamilyName\":\"nsj\",\"msixPackageApplicationId\":\"vti\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"sz\",\"showInPortal\":true,\"iconPath\":\"sbzkf\",\"iconIndex\":1389741266,\"iconHash\":\"v\"},\"id\":\"qi\",\"name\":\"vinvkj\",\"type\":\"xdxr\"}],\"nextLink\":\"ukzclewyhmlwpaz\"}") - .toObject(ApplicationList.class); - Assertions.assertEquals("szkkfoqre", model.value().get(0).description()); - Assertions.assertEquals("kzikfjawneaivxwc", model.value().get(0).friendlyName()); - Assertions.assertEquals("lpcirelsf", model.value().get(0).filePath()); - Assertions.assertEquals("enwabfatk", model.value().get(0).msixPackageFamilyName()); - Assertions.assertEquals("dxbjhwuaanozj", model.value().get(0).msixPackageApplicationId()); + ApplicationList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"objectId\":\"wosytxitcskf\",\"description\":\"tq\",\"friendlyName\":\"iekkezz\",\"filePath\":\"hlyfjhdgqgg\",\"msixPackageFamilyName\":\"dunyg\",\"msixPackageApplicationId\":\"qidbqfatpxllrxcy\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"su\",\"showInPortal\":false,\"iconPath\":\"ywdmjsjqbjh\",\"iconIndex\":249171205,\"iconHash\":\"rw\"},\"id\":\"oduhp\",\"name\":\"xkgymareqnajxqu\",\"type\":\"jhkycub\"},{\"properties\":{\"objectId\":\"dgssofwqmzqal\",\"description\":\"mnjijpxacqqudf\",\"friendlyName\":\"yxbaaabjyvayf\",\"filePath\":\"m\",\"msixPackageFamilyName\":\"rtuzqogs\",\"msixPackageApplicationId\":\"nevfdnw\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"zsyyceuzso\",\"showInPortal\":false,\"iconPath\":\"dpfrxtrthzvaytdw\",\"iconIndex\":1467238377,\"iconHash\":\"qu\"},\"id\":\"xhexiilivpdti\",\"name\":\"r\",\"type\":\"tdqoaxoruzfgsq\"}],\"nextLink\":\"fxrxxle\"}") + .toObject(ApplicationList.class); + Assertions.assertEquals("tq", model.value().get(0).description()); + Assertions.assertEquals("iekkezz", model.value().get(0).friendlyName()); + Assertions.assertEquals("hlyfjhdgqgg", model.value().get(0).filePath()); + Assertions.assertEquals("dunyg", model.value().get(0).msixPackageFamilyName()); + Assertions.assertEquals("qidbqfatpxllrxcy", model.value().get(0).msixPackageApplicationId()); Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.value().get(0).applicationType()); Assertions.assertEquals(CommandLineSetting.REQUIRE, model.value().get(0).commandLineSetting()); - Assertions.assertEquals("oulpjrv", model.value().get(0).commandLineArguments()); - Assertions.assertEquals(true, model.value().get(0).showInPortal()); - Assertions.assertEquals("rvimjwosytxitcsk", model.value().get(0).iconPath()); - Assertions.assertEquals(212130052, model.value().get(0).iconIndex()); + Assertions.assertEquals("su", model.value().get(0).commandLineArguments()); + Assertions.assertEquals(false, model.value().get(0).showInPortal()); + Assertions.assertEquals("ywdmjsjqbjh", model.value().get(0).iconPath()); + Assertions.assertEquals(249171205, model.value().get(0).iconIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationList model = - new ApplicationList() - .withValue( - Arrays - .asList( - new ApplicationInner() - .withDescription("szkkfoqre") - .withFriendlyName("kzikfjawneaivxwc") - .withFilePath("lpcirelsf") - .withMsixPackageFamilyName("enwabfatk") - .withMsixPackageApplicationId("dxbjhwuaanozj") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("oulpjrv") - .withShowInPortal(true) - .withIconPath("rvimjwosytxitcsk") - .withIconIndex(212130052), - new ApplicationInner() - .withDescription("atpxl") - .withFriendlyName("xcyjmoadsuvarmy") - .withFilePath("mjsjqb") - .withMsixPackageFamilyName("hyxxrwlycoduhpk") - .withMsixPackageApplicationId("gymare") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("qugjhkycube") - .withShowInPortal(false) - .withIconPath("sofwqmzqalkrmnji") - .withIconIndex(988494266), - new ApplicationInner() - .withDescription("mewzsyyc") - .withFriendlyName("zsoibjudpfrxtr") - .withFilePath("zvaytdwkqbr") - .withMsixPackageFamilyName("bpaxhexiilivpdt") - .withMsixPackageApplicationId("r") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) - .withCommandLineArguments("axoruzfgsquy") - .withShowInPortal(false) - .withIconPath("xleptramx") - .withIconIndex(726747953), - new ApplicationInner() - .withDescription("kdlfoa") - .withFriendlyName("gkfpaga") - .withFilePath("pulpqblylsyxk") - .withMsixPackageFamilyName("nsj") - .withMsixPackageApplicationId("vti") - .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) - .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) - .withCommandLineArguments("sz") - .withShowInPortal(true) - .withIconPath("sbzkf") - .withIconIndex(1389741266))); + ApplicationList model = new ApplicationList().withValue(Arrays.asList( + new ApplicationInner().withDescription("tq") + .withFriendlyName("iekkezz") + .withFilePath("hlyfjhdgqgg") + .withMsixPackageFamilyName("dunyg") + .withMsixPackageApplicationId("qidbqfatpxllrxcy") + .withApplicationType(RemoteApplicationType.IN_BUILT) + .withCommandLineSetting(CommandLineSetting.REQUIRE) + .withCommandLineArguments("su") + .withShowInPortal(false) + .withIconPath("ywdmjsjqbjh") + .withIconIndex(249171205), + new ApplicationInner().withDescription("mnjijpxacqqudf") + .withFriendlyName("yxbaaabjyvayf") + .withFilePath("m") + .withMsixPackageFamilyName("rtuzqogs") + .withMsixPackageApplicationId("nevfdnw") + .withApplicationType(RemoteApplicationType.IN_BUILT) + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("zsyyceuzso") + .withShowInPortal(false) + .withIconPath("dpfrxtrthzvaytdw") + .withIconIndex(1467238377))); model = BinaryData.fromObject(model).toObject(ApplicationList.class); - Assertions.assertEquals("szkkfoqre", model.value().get(0).description()); - Assertions.assertEquals("kzikfjawneaivxwc", model.value().get(0).friendlyName()); - Assertions.assertEquals("lpcirelsf", model.value().get(0).filePath()); - Assertions.assertEquals("enwabfatk", model.value().get(0).msixPackageFamilyName()); - Assertions.assertEquals("dxbjhwuaanozj", model.value().get(0).msixPackageApplicationId()); + Assertions.assertEquals("tq", model.value().get(0).description()); + Assertions.assertEquals("iekkezz", model.value().get(0).friendlyName()); + Assertions.assertEquals("hlyfjhdgqgg", model.value().get(0).filePath()); + Assertions.assertEquals("dunyg", model.value().get(0).msixPackageFamilyName()); + Assertions.assertEquals("qidbqfatpxllrxcy", model.value().get(0).msixPackageApplicationId()); Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.value().get(0).applicationType()); Assertions.assertEquals(CommandLineSetting.REQUIRE, model.value().get(0).commandLineSetting()); - Assertions.assertEquals("oulpjrv", model.value().get(0).commandLineArguments()); - Assertions.assertEquals(true, model.value().get(0).showInPortal()); - Assertions.assertEquals("rvimjwosytxitcsk", model.value().get(0).iconPath()); - Assertions.assertEquals(212130052, model.value().get(0).iconIndex()); + Assertions.assertEquals("su", model.value().get(0).commandLineArguments()); + Assertions.assertEquals(false, model.value().get(0).showInPortal()); + Assertions.assertEquals("ywdmjsjqbjh", model.value().get(0).iconPath()); + Assertions.assertEquals(249171205, model.value().get(0).iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java index 384e7e960c59..c260c2b55f9d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchPropertiesTests.java @@ -13,50 +13,46 @@ public final class ApplicationPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationPatchProperties model = - BinaryData - .fromString( - "{\"description\":\"kzivgvvcnayrh\",\"friendlyName\":\"nxxmueedndrdv\",\"filePath\":\"kwqqtchealmf\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"aygdvwvgpioh\",\"showInPortal\":true,\"iconPath\":\"tfudxepx\",\"iconIndex\":1784889493,\"msixPackageFamilyName\":\"gvr\",\"msixPackageApplicationId\":\"npkukghimdblx\",\"applicationType\":\"MsixApplication\"}") - .toObject(ApplicationPatchProperties.class); - Assertions.assertEquals("kzivgvvcnayrh", model.description()); - Assertions.assertEquals("nxxmueedndrdv", model.friendlyName()); - Assertions.assertEquals("kwqqtchealmf", model.filePath()); - Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); - Assertions.assertEquals("aygdvwvgpioh", model.commandLineArguments()); + ApplicationPatchProperties model = BinaryData.fromString( + "{\"description\":\"ivx\",\"friendlyName\":\"zel\",\"filePath\":\"irels\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"nwabfatkldd\",\"showInPortal\":true,\"iconPath\":\"wuaanoz\",\"iconIndex\":1294061553,\"msixPackageFamilyName\":\"hyoulpjr\",\"msixPackageApplicationId\":\"ag\",\"applicationType\":\"InBuilt\"}") + .toObject(ApplicationPatchProperties.class); + Assertions.assertEquals("ivx", model.description()); + Assertions.assertEquals("zel", model.friendlyName()); + Assertions.assertEquals("irels", model.filePath()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.commandLineSetting()); + Assertions.assertEquals("nwabfatkldd", model.commandLineArguments()); Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("tfudxepx", model.iconPath()); - Assertions.assertEquals(1784889493, model.iconIndex()); - Assertions.assertEquals("gvr", model.msixPackageFamilyName()); - Assertions.assertEquals("npkukghimdblx", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); + Assertions.assertEquals("wuaanoz", model.iconPath()); + Assertions.assertEquals(1294061553, model.iconIndex()); + Assertions.assertEquals("hyoulpjr", model.msixPackageFamilyName()); + Assertions.assertEquals("ag", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationPatchProperties model = - new ApplicationPatchProperties() - .withDescription("kzivgvvcnayrh") - .withFriendlyName("nxxmueedndrdv") - .withFilePath("kwqqtchealmf") - .withCommandLineSetting(CommandLineSetting.ALLOW) - .withCommandLineArguments("aygdvwvgpioh") - .withShowInPortal(true) - .withIconPath("tfudxepx") - .withIconIndex(1784889493) - .withMsixPackageFamilyName("gvr") - .withMsixPackageApplicationId("npkukghimdblx") - .withApplicationType(RemoteApplicationType.MSIX_APPLICATION); + ApplicationPatchProperties model = new ApplicationPatchProperties().withDescription("ivx") + .withFriendlyName("zel") + .withFilePath("irels") + .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) + .withCommandLineArguments("nwabfatkldd") + .withShowInPortal(true) + .withIconPath("wuaanoz") + .withIconIndex(1294061553) + .withMsixPackageFamilyName("hyoulpjr") + .withMsixPackageApplicationId("ag") + .withApplicationType(RemoteApplicationType.IN_BUILT); model = BinaryData.fromObject(model).toObject(ApplicationPatchProperties.class); - Assertions.assertEquals("kzivgvvcnayrh", model.description()); - Assertions.assertEquals("nxxmueedndrdv", model.friendlyName()); - Assertions.assertEquals("kwqqtchealmf", model.filePath()); - Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); - Assertions.assertEquals("aygdvwvgpioh", model.commandLineArguments()); + Assertions.assertEquals("ivx", model.description()); + Assertions.assertEquals("zel", model.friendlyName()); + Assertions.assertEquals("irels", model.filePath()); + Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, model.commandLineSetting()); + Assertions.assertEquals("nwabfatkldd", model.commandLineArguments()); Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("tfudxepx", model.iconPath()); - Assertions.assertEquals(1784889493, model.iconIndex()); - Assertions.assertEquals("gvr", model.msixPackageFamilyName()); - Assertions.assertEquals("npkukghimdblx", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); + Assertions.assertEquals("wuaanoz", model.iconPath()); + Assertions.assertEquals(1294061553, model.iconIndex()); + Assertions.assertEquals("hyoulpjr", model.msixPackageFamilyName()); + Assertions.assertEquals("ag", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java index 07383cb3cd4a..0f7955f35092 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPatchTests.java @@ -15,54 +15,50 @@ public final class ApplicationPatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationPatch model = - BinaryData - .fromString( - "{\"tags\":{\"kotl\":\"wwrlkdmtncv\",\"gsyocogj\":\"xdy\"},\"properties\":{\"description\":\"tbnnha\",\"friendlyName\":\"ocrkvcikh\",\"filePath\":\"p\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"x\",\"showInPortal\":false,\"iconPath\":\"zikywgg\",\"iconIndex\":1558005484,\"msixPackageFamilyName\":\"la\",\"msixPackageApplicationId\":\"elwuipi\",\"applicationType\":\"InBuilt\"}}") - .toObject(ApplicationPatch.class); - Assertions.assertEquals("wwrlkdmtncv", model.tags().get("kotl")); - Assertions.assertEquals("tbnnha", model.description()); - Assertions.assertEquals("ocrkvcikh", model.friendlyName()); - Assertions.assertEquals("p", model.filePath()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("x", model.commandLineArguments()); + ApplicationPatch model = BinaryData.fromString( + "{\"tags\":{\"alm\":\"qqtch\"},\"properties\":{\"description\":\"d\",\"friendlyName\":\"ygdvwv\",\"filePath\":\"iohgwxrtfud\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"gyqagvrvmnpkuk\",\"showInPortal\":false,\"iconPath\":\"dblx\",\"iconIndex\":261614569,\"msixPackageFamilyName\":\"fnjhfjxwmszkkfo\",\"msixPackageApplicationId\":\"eyfkzikfja\",\"applicationType\":\"MsixApplication\"}}") + .toObject(ApplicationPatch.class); + Assertions.assertEquals("qqtch", model.tags().get("alm")); + Assertions.assertEquals("d", model.description()); + Assertions.assertEquals("ygdvwv", model.friendlyName()); + Assertions.assertEquals("iohgwxrtfud", model.filePath()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); + Assertions.assertEquals("gyqagvrvmnpkuk", model.commandLineArguments()); Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("zikywgg", model.iconPath()); - Assertions.assertEquals(1558005484, model.iconIndex()); - Assertions.assertEquals("la", model.msixPackageFamilyName()); - Assertions.assertEquals("elwuipi", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); + Assertions.assertEquals("dblx", model.iconPath()); + Assertions.assertEquals(261614569, model.iconIndex()); + Assertions.assertEquals("fnjhfjxwmszkkfo", model.msixPackageFamilyName()); + Assertions.assertEquals("eyfkzikfja", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationPatch model = - new ApplicationPatch() - .withTags(mapOf("kotl", "wwrlkdmtncv", "gsyocogj", "xdy")) - .withDescription("tbnnha") - .withFriendlyName("ocrkvcikh") - .withFilePath("p") - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("x") - .withShowInPortal(false) - .withIconPath("zikywgg") - .withIconIndex(1558005484) - .withMsixPackageFamilyName("la") - .withMsixPackageApplicationId("elwuipi") - .withApplicationType(RemoteApplicationType.IN_BUILT); + ApplicationPatch model = new ApplicationPatch().withTags(mapOf("alm", "qqtch")) + .withDescription("d") + .withFriendlyName("ygdvwv") + .withFilePath("iohgwxrtfud") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("gyqagvrvmnpkuk") + .withShowInPortal(false) + .withIconPath("dblx") + .withIconIndex(261614569) + .withMsixPackageFamilyName("fnjhfjxwmszkkfo") + .withMsixPackageApplicationId("eyfkzikfja") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION); model = BinaryData.fromObject(model).toObject(ApplicationPatch.class); - Assertions.assertEquals("wwrlkdmtncv", model.tags().get("kotl")); - Assertions.assertEquals("tbnnha", model.description()); - Assertions.assertEquals("ocrkvcikh", model.friendlyName()); - Assertions.assertEquals("p", model.filePath()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("x", model.commandLineArguments()); + Assertions.assertEquals("qqtch", model.tags().get("alm")); + Assertions.assertEquals("d", model.description()); + Assertions.assertEquals("ygdvwv", model.friendlyName()); + Assertions.assertEquals("iohgwxrtfud", model.filePath()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); + Assertions.assertEquals("gyqagvrvmnpkuk", model.commandLineArguments()); Assertions.assertEquals(false, model.showInPortal()); - Assertions.assertEquals("zikywgg", model.iconPath()); - Assertions.assertEquals(1558005484, model.iconIndex()); - Assertions.assertEquals("la", model.msixPackageFamilyName()); - Assertions.assertEquals("elwuipi", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); + Assertions.assertEquals("dblx", model.iconPath()); + Assertions.assertEquals(261614569, model.iconIndex()); + Assertions.assertEquals("fnjhfjxwmszkkfo", model.msixPackageFamilyName()); + Assertions.assertEquals("eyfkzikfja", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); } // Use "Map.of" if available diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java index b6ca27e72897..fe2b288b2c8e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationPropertiesTests.java @@ -13,50 +13,46 @@ public final class ApplicationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ApplicationProperties model = - BinaryData - .fromString( - "{\"objectId\":\"jphuopxodlqi\",\"description\":\"torzih\",\"friendlyName\":\"osjswsr\",\"filePath\":\"lyzrpzbchckqqzqi\",\"msixPackageFamilyName\":\"iysui\",\"msixPackageApplicationId\":\"ynkedyatrwyhqmib\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"tsmypyynpcdp\",\"showInPortal\":true,\"iconPath\":\"g\",\"iconIndex\":83591449,\"iconHash\":\"mabiknsorgjhxb\"}") - .toObject(ApplicationProperties.class); - Assertions.assertEquals("torzih", model.description()); - Assertions.assertEquals("osjswsr", model.friendlyName()); - Assertions.assertEquals("lyzrpzbchckqqzqi", model.filePath()); - Assertions.assertEquals("iysui", model.msixPackageFamilyName()); - Assertions.assertEquals("ynkedyatrwyhqmib", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("tsmypyynpcdp", model.commandLineArguments()); + ApplicationProperties model = BinaryData.fromString( + "{\"objectId\":\"wwrlkdmtncv\",\"description\":\"otllxdyhgsyo\",\"friendlyName\":\"gjltdtbnnhado\",\"filePath\":\"rkvcikhnvpa\",\"msixPackageFamilyName\":\"gxqquezik\",\"msixPackageApplicationId\":\"ggxkallatmelwuip\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"kzivgvvcnayrh\",\"showInPortal\":true,\"iconPath\":\"xmueed\",\"iconIndex\":877361195,\"iconHash\":\"v\"}") + .toObject(ApplicationProperties.class); + Assertions.assertEquals("otllxdyhgsyo", model.description()); + Assertions.assertEquals("gjltdtbnnhado", model.friendlyName()); + Assertions.assertEquals("rkvcikhnvpa", model.filePath()); + Assertions.assertEquals("gxqquezik", model.msixPackageFamilyName()); + Assertions.assertEquals("ggxkallatmelwuip", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); + Assertions.assertEquals("kzivgvvcnayrh", model.commandLineArguments()); Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("g", model.iconPath()); - Assertions.assertEquals(83591449, model.iconIndex()); + Assertions.assertEquals("xmueed", model.iconPath()); + Assertions.assertEquals(877361195, model.iconIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ApplicationProperties model = - new ApplicationProperties() - .withDescription("torzih") - .withFriendlyName("osjswsr") - .withFilePath("lyzrpzbchckqqzqi") - .withMsixPackageFamilyName("iysui") - .withMsixPackageApplicationId("ynkedyatrwyhqmib") - .withApplicationType(RemoteApplicationType.IN_BUILT) - .withCommandLineSetting(CommandLineSetting.REQUIRE) - .withCommandLineArguments("tsmypyynpcdp") - .withShowInPortal(true) - .withIconPath("g") - .withIconIndex(83591449); + ApplicationProperties model = new ApplicationProperties().withDescription("otllxdyhgsyo") + .withFriendlyName("gjltdtbnnhado") + .withFilePath("rkvcikhnvpa") + .withMsixPackageFamilyName("gxqquezik") + .withMsixPackageApplicationId("ggxkallatmelwuip") + .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withCommandLineArguments("kzivgvvcnayrh") + .withShowInPortal(true) + .withIconPath("xmueed") + .withIconIndex(877361195); model = BinaryData.fromObject(model).toObject(ApplicationProperties.class); - Assertions.assertEquals("torzih", model.description()); - Assertions.assertEquals("osjswsr", model.friendlyName()); - Assertions.assertEquals("lyzrpzbchckqqzqi", model.filePath()); - Assertions.assertEquals("iysui", model.msixPackageFamilyName()); - Assertions.assertEquals("ynkedyatrwyhqmib", model.msixPackageApplicationId()); - Assertions.assertEquals(RemoteApplicationType.IN_BUILT, model.applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, model.commandLineSetting()); - Assertions.assertEquals("tsmypyynpcdp", model.commandLineArguments()); + Assertions.assertEquals("otllxdyhgsyo", model.description()); + Assertions.assertEquals("gjltdtbnnhado", model.friendlyName()); + Assertions.assertEquals("rkvcikhnvpa", model.filePath()); + Assertions.assertEquals("gxqquezik", model.msixPackageFamilyName()); + Assertions.assertEquals("ggxkallatmelwuip", model.msixPackageApplicationId()); + Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, model.applicationType()); + Assertions.assertEquals(CommandLineSetting.ALLOW, model.commandLineSetting()); + Assertions.assertEquals("kzivgvvcnayrh", model.commandLineArguments()); Assertions.assertEquals(true, model.showInPortal()); - Assertions.assertEquals("g", model.iconPath()); - Assertions.assertEquals(83591449, model.iconIndex()); + Assertions.assertEquals("xmueed", model.iconPath()); + Assertions.assertEquals(877361195, model.iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java index 9a644553df32..813f3e061132 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsCreateOrUpdateWithResponseMockTests.java @@ -6,89 +6,58 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Application; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ApplicationsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"objectId\":\"qwcabvnui\",\"description\":\"ey\",\"friendlyName\":\"wlpaugmrmfjlrxwt\",\"filePath\":\"ukhfkvc\",\"msixPackageFamilyName\":\"izmoaeds\",\"msixPackageApplicationId\":\"wuived\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Require\",\"commandLineArguments\":\"ewxeiqbpsm\",\"showInPortal\":false,\"iconPath\":\"u\",\"iconIndex\":468041184,\"iconHash\":\"dlrgms\"},\"id\":\"zgaufcshhvn\",\"name\":\"wgnxkympqanxrj\",\"type\":\"ixt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .applications() - .define("gygqwah") - .withExistingApplicationGroup("dtguk", "anblwphqlkccu") - .withCommandLineSetting(CommandLineSetting.DO_NOT_ALLOW) - .withDescription("d") - .withFriendlyName("ypivlsbb") - .withFilePath("mcub") - .withMsixPackageFamilyName("ifoxxkubvphav") - .withMsixPackageApplicationId("h") - .withApplicationType(RemoteApplicationType.MSIX_APPLICATION) - .withCommandLineArguments("vgovpbbttefjokn") - .withShowInPortal(true) - .withIconPath("zqedikdfrdbi") - .withIconIndex(1455317057) - .create(); - - Assertions.assertEquals("ey", response.description()); - Assertions.assertEquals("wlpaugmrmfjlrxwt", response.friendlyName()); - Assertions.assertEquals("ukhfkvc", response.filePath()); - Assertions.assertEquals("izmoaeds", response.msixPackageFamilyName()); - Assertions.assertEquals("wuived", response.msixPackageApplicationId()); + String responseStr + = "{\"properties\":{\"objectId\":\"aq\",\"description\":\"irpiwrqofulopmj\",\"friendlyName\":\"exwhcb\",\"filePath\":\"ibkeph\",\"msixPackageFamilyName\":\"uerct\",\"msixPackageApplicationId\":\"oyin\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"lc\",\"showInPortal\":false,\"iconPath\":\"czkgofxyfsrucvcr\",\"iconIndex\":1764052687,\"iconHash\":\"ttbst\"},\"id\":\"aqnrmvvfkoxmlg\",\"name\":\"ktuidvrm\",\"type\":\"zlpdwwex\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Application response = manager.applications() + .define("gat") + .withExistingApplicationGroup("z", "izvg") + .withCommandLineSetting(CommandLineSetting.ALLOW) + .withDescription("wggahttzlswvaj") + .withFriendlyName("utlxjoqzasunwqrj") + .withFilePath("rg") + .withMsixPackageFamilyName("aohcmbuocn") + .withMsixPackageApplicationId("ohmbpyr") + .withApplicationType(RemoteApplicationType.IN_BUILT) + .withCommandLineArguments("blydyvkf") + .withShowInPortal(true) + .withIconPath("cxneh") + .withIconIndex(1148200701) + .create(); + + Assertions.assertEquals("irpiwrqofulopmj", response.description()); + Assertions.assertEquals("exwhcb", response.friendlyName()); + Assertions.assertEquals("ibkeph", response.filePath()); + Assertions.assertEquals("uerct", response.msixPackageFamilyName()); + Assertions.assertEquals("oyin", response.msixPackageApplicationId()); Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, response.applicationType()); - Assertions.assertEquals(CommandLineSetting.REQUIRE, response.commandLineSetting()); - Assertions.assertEquals("ewxeiqbpsm", response.commandLineArguments()); + Assertions.assertEquals(CommandLineSetting.ALLOW, response.commandLineSetting()); + Assertions.assertEquals("lc", response.commandLineArguments()); Assertions.assertEquals(false, response.showInPortal()); - Assertions.assertEquals("u", response.iconPath()); - Assertions.assertEquals(468041184, response.iconIndex()); + Assertions.assertEquals("czkgofxyfsrucvcr", response.iconPath()); + Assertions.assertEquals(1764052687, response.iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java index aab6c15bca1c..7f818f10f5a1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsDeleteWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ApplicationsDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.applications() + .deleteWithResponse("hdbvqvwzkjop", "beonrlkwzdq", "bxcea", com.azure.core.util.Context.NONE); - manager - .applications() - .deleteWithResponse("csgguxhemlw", "waeeczgfb", "kklelssxblycs", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java index 763fa29ca168..3d4507f299b7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsGetWithResponseMockTests.java @@ -6,77 +6,46 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Application; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ApplicationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"objectId\":\"mdyomkxfbvfbh\",\"description\":\"i\",\"friendlyName\":\"pwpgddei\",\"filePath\":\"wzovgk\",\"msixPackageFamilyName\":\"muikjcjcaztbws\",\"msixPackageApplicationId\":\"qowxwcom\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"wvczcswkacve\",\"showInPortal\":false,\"iconPath\":\"vlvhbwrnfxtgd\",\"iconIndex\":994119130,\"iconHash\":\"hehnmnaoya\"},\"id\":\"coeqswankltytm\",\"name\":\"droznn\",\"type\":\"drlktg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .applications() - .getWithResponse("qwjksghudgz", "xog", "ggsvoujkxibdaf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("i", response.description()); - Assertions.assertEquals("pwpgddei", response.friendlyName()); - Assertions.assertEquals("wzovgk", response.filePath()); - Assertions.assertEquals("muikjcjcaztbws", response.msixPackageFamilyName()); - Assertions.assertEquals("qowxwcom", response.msixPackageApplicationId()); + String responseStr + = "{\"properties\":{\"objectId\":\"qqqagwwrxaomzi\",\"description\":\"lrrcz\",\"friendlyName\":\"k\",\"filePath\":\"ltn\",\"msixPackageFamilyName\":\"dhqoawj\",\"msixPackageApplicationId\":\"yueayfbpcmsp\",\"applicationType\":\"InBuilt\",\"commandLineSetting\":\"Allow\",\"commandLineArguments\":\"ueq\",\"showInPortal\":false,\"iconPath\":\"gnmbscbbxigdhx\",\"iconIndex\":115297328,\"iconHash\":\"opedbwdpyqyybxub\"},\"id\":\"afcbqw\",\"name\":\"e\",\"type\":\"jelaqacigele\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Application response = manager.applications() + .getWithResponse("wxihs", "nxw", "agnepzwaklsb", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("lrrcz", response.description()); + Assertions.assertEquals("k", response.friendlyName()); + Assertions.assertEquals("ltn", response.filePath()); + Assertions.assertEquals("dhqoawj", response.msixPackageFamilyName()); + Assertions.assertEquals("yueayfbpcmsp", response.msixPackageApplicationId()); Assertions.assertEquals(RemoteApplicationType.IN_BUILT, response.applicationType()); - Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, response.commandLineSetting()); - Assertions.assertEquals("wvczcswkacve", response.commandLineArguments()); + Assertions.assertEquals(CommandLineSetting.ALLOW, response.commandLineSetting()); + Assertions.assertEquals("ueq", response.commandLineArguments()); Assertions.assertEquals(false, response.showInPortal()); - Assertions.assertEquals("vlvhbwrnfxtgd", response.iconPath()); - Assertions.assertEquals(994119130, response.iconIndex()); + Assertions.assertEquals("gnmbscbbxigdhx", response.iconPath()); + Assertions.assertEquals(115297328, response.iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java index 6aec93df29f2..0567763b26ec 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ApplicationsListMockTests.java @@ -6,77 +6,46 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Application; import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting; import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ApplicationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"objectId\":\"bidyv\",\"description\":\"owx\",\"friendlyName\":\"piudeugfsxzecpa\",\"filePath\":\"kufykhvu\",\"msixPackageFamilyName\":\"epmrut\",\"msixPackageApplicationId\":\"abaobnslujdjltym\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"ihywartspph\",\"showInPortal\":true,\"iconPath\":\"ykxdssjpemmuc\",\"iconIndex\":115970163,\"iconHash\":\"kkflrmymyincqlhr\"},\"id\":\"wslmiiiovgqcg\",\"name\":\"uugqk\",\"type\":\"totiowlxteqdptjg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .applications() - .list("zujksrlsmdes", "plpvm", 536619974, true, 1460091990, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("owx", response.iterator().next().description()); - Assertions.assertEquals("piudeugfsxzecpa", response.iterator().next().friendlyName()); - Assertions.assertEquals("kufykhvu", response.iterator().next().filePath()); - Assertions.assertEquals("epmrut", response.iterator().next().msixPackageFamilyName()); - Assertions.assertEquals("abaobnslujdjltym", response.iterator().next().msixPackageApplicationId()); + String responseStr + = "{\"value\":[{\"properties\":{\"objectId\":\"sg\",\"description\":\"iuemvanbwzohmnr\",\"friendlyName\":\"bsojk\",\"filePath\":\"nhmdptysprqs\",\"msixPackageFamilyName\":\"zxojpslsv\",\"msixPackageApplicationId\":\"pli\",\"applicationType\":\"MsixApplication\",\"commandLineSetting\":\"DoNotAllow\",\"commandLineArguments\":\"oyxqvapcohhou\",\"showInPortal\":false,\"iconPath\":\"oj\",\"iconIndex\":137725853,\"iconHash\":\"rzdcgdzbenribcaw\"},\"id\":\"qd\",\"name\":\"tjwfljhznamtua\",\"type\":\"mzwcjjncqt\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.applications() + .list("xcptsoqfyiaseqc", "krtt", 1347123491, false, 1599400117, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("iuemvanbwzohmnr", response.iterator().next().description()); + Assertions.assertEquals("bsojk", response.iterator().next().friendlyName()); + Assertions.assertEquals("nhmdptysprqs", response.iterator().next().filePath()); + Assertions.assertEquals("zxojpslsv", response.iterator().next().msixPackageFamilyName()); + Assertions.assertEquals("pli", response.iterator().next().msixPackageApplicationId()); Assertions.assertEquals(RemoteApplicationType.MSIX_APPLICATION, response.iterator().next().applicationType()); Assertions.assertEquals(CommandLineSetting.DO_NOT_ALLOW, response.iterator().next().commandLineSetting()); - Assertions.assertEquals("ihywartspph", response.iterator().next().commandLineArguments()); - Assertions.assertEquals(true, response.iterator().next().showInPortal()); - Assertions.assertEquals("ykxdssjpemmuc", response.iterator().next().iconPath()); - Assertions.assertEquals(115970163, response.iterator().next().iconIndex()); + Assertions.assertEquals("oyxqvapcohhou", response.iterator().next().commandLineArguments()); + Assertions.assertEquals(false, response.iterator().next().showInPortal()); + Assertions.assertEquals("oj", response.iterator().next().iconPath()); + Assertions.assertEquals(137725853, response.iterator().next().iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java index 37514c55707f..010e86cfe1b2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopInnerTests.java @@ -11,20 +11,18 @@ public final class DesktopInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DesktopInner model = - BinaryData - .fromString( - "{\"properties\":{\"objectId\":\"fn\",\"description\":\"kwyfzqwhxxbuyqax\",\"friendlyName\":\"eqz\",\"iconHash\":\"priolx\"},\"id\":\"jaltolmnc\",\"name\":\"sobqw\",\"type\":\"sdbnwdcfhucqdpf\"}") - .toObject(DesktopInner.class); - Assertions.assertEquals("kwyfzqwhxxbuyqax", model.description()); - Assertions.assertEquals("eqz", model.friendlyName()); + DesktopInner model = BinaryData.fromString( + "{\"properties\":{\"objectId\":\"amxjezwlw\",\"description\":\"xuqlcvydypat\",\"friendlyName\":\"oa\",\"iconHash\":\"kniod\"},\"id\":\"ebwnujhe\",\"name\":\"msbvdkcrodtjinf\",\"type\":\"jlfltkacjvefkdlf\"}") + .toObject(DesktopInner.class); + Assertions.assertEquals("xuqlcvydypat", model.description()); + Assertions.assertEquals("oa", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DesktopInner model = new DesktopInner().withDescription("kwyfzqwhxxbuyqax").withFriendlyName("eqz"); + DesktopInner model = new DesktopInner().withDescription("xuqlcvydypat").withFriendlyName("oa"); model = BinaryData.fromObject(model).toObject(DesktopInner.class); - Assertions.assertEquals("kwyfzqwhxxbuyqax", model.description()); - Assertions.assertEquals("eqz", model.friendlyName()); + Assertions.assertEquals("xuqlcvydypat", model.description()); + Assertions.assertEquals("oa", model.friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java index 3fab48f41b23..8678428c34f3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopListTests.java @@ -13,26 +13,20 @@ public final class DesktopListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DesktopList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"frvtpuqu\",\"description\":\"qlgkfbtn\",\"friendlyName\":\"aongbj\",\"iconHash\":\"tujitcjedft\"},\"id\":\"ae\",\"name\":\"kojvd\",\"type\":\"pzfoqoui\"},{\"properties\":{\"objectId\":\"arz\",\"description\":\"zuf\",\"friendlyName\":\"ciqopidoa\",\"iconHash\":\"iodhkhazxkhnz\"},\"id\":\"nlwntoe\",\"name\":\"okdwb\",\"type\":\"hksz\"}],\"nextLink\":\"mrv\"}") - .toObject(DesktopList.class); - Assertions.assertEquals("qlgkfbtn", model.value().get(0).description()); - Assertions.assertEquals("aongbj", model.value().get(0).friendlyName()); + DesktopList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"objectId\":\"pfuvglsbjjca\",\"description\":\"xbvtvudu\",\"friendlyName\":\"cormr\",\"iconHash\":\"qtvcofudflvkgj\"},\"id\":\"dknnqvsazn\",\"name\":\"n\",\"type\":\"orudsgsa\"},{\"properties\":{\"objectId\":\"yc\",\"description\":\"auwjuetaebu\",\"friendlyName\":\"vdmovsmzlxwabm\",\"iconHash\":\"efkifr\"},\"id\":\"u\",\"name\":\"ujmqlgkfbtndoa\",\"type\":\"n\"}],\"nextLink\":\"jcntuj\"}") + .toObject(DesktopList.class); + Assertions.assertEquals("xbvtvudu", model.value().get(0).description()); + Assertions.assertEquals("cormr", model.value().get(0).friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DesktopList model = - new DesktopList() - .withValue( - Arrays - .asList( - new DesktopInner().withDescription("qlgkfbtn").withFriendlyName("aongbj"), - new DesktopInner().withDescription("zuf").withFriendlyName("ciqopidoa"))); + DesktopList model = new DesktopList() + .withValue(Arrays.asList(new DesktopInner().withDescription("xbvtvudu").withFriendlyName("cormr"), + new DesktopInner().withDescription("auwjuetaebu").withFriendlyName("vdmovsmzlxwabm"))); model = BinaryData.fromObject(model).toObject(DesktopList.class); - Assertions.assertEquals("qlgkfbtn", model.value().get(0).description()); - Assertions.assertEquals("aongbj", model.value().get(0).friendlyName()); + Assertions.assertEquals("xbvtvudu", model.value().get(0).description()); + Assertions.assertEquals("cormr", model.value().get(0).friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java index d8fec0d48337..412055c908b7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchPropertiesTests.java @@ -11,20 +11,19 @@ public final class DesktopPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DesktopPatchProperties model = - BinaryData - .fromString("{\"description\":\"auwjuetaebu\",\"friendlyName\":\"vdmovsmzlxwabm\"}") + DesktopPatchProperties model + = BinaryData.fromString("{\"description\":\"rjaltolmncw\",\"friendlyName\":\"bqwcsdbnwdcf\"}") .toObject(DesktopPatchProperties.class); - Assertions.assertEquals("auwjuetaebu", model.description()); - Assertions.assertEquals("vdmovsmzlxwabm", model.friendlyName()); + Assertions.assertEquals("rjaltolmncw", model.description()); + Assertions.assertEquals("bqwcsdbnwdcf", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DesktopPatchProperties model = - new DesktopPatchProperties().withDescription("auwjuetaebu").withFriendlyName("vdmovsmzlxwabm"); + DesktopPatchProperties model + = new DesktopPatchProperties().withDescription("rjaltolmncw").withFriendlyName("bqwcsdbnwdcf"); model = BinaryData.fromObject(model).toObject(DesktopPatchProperties.class); - Assertions.assertEquals("auwjuetaebu", model.description()); - Assertions.assertEquals("vdmovsmzlxwabm", model.friendlyName()); + Assertions.assertEquals("rjaltolmncw", model.description()); + Assertions.assertEquals("bqwcsdbnwdcf", model.friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java index 1e213caa4e75..b9ba5333513f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPatchTests.java @@ -13,24 +13,24 @@ public final class DesktopPatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DesktopPatch model = - BinaryData - .fromString( - "{\"tags\":{\"gdknnqv\":\"u\"},\"properties\":{\"description\":\"nqntorudsgsahm\",\"friendlyName\":\"c\"}}") - .toObject(DesktopPatch.class); - Assertions.assertEquals("u", model.tags().get("gdknnqv")); - Assertions.assertEquals("nqntorudsgsahm", model.description()); - Assertions.assertEquals("c", model.friendlyName()); + DesktopPatch model = BinaryData.fromString( + "{\"tags\":{\"sbzkf\":\"uem\",\"dxrbuukzcle\":\"beyvpnqicvinvkjj\",\"fn\":\"yhmlwpaztzp\"},\"properties\":{\"description\":\"wyfzqwhxxbuyqa\",\"friendlyName\":\"feqztppriol\"}}") + .toObject(DesktopPatch.class); + Assertions.assertEquals("uem", model.tags().get("sbzkf")); + Assertions.assertEquals("wyfzqwhxxbuyqa", model.description()); + Assertions.assertEquals("feqztppriol", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DesktopPatch model = - new DesktopPatch().withTags(mapOf("gdknnqv", "u")).withDescription("nqntorudsgsahm").withFriendlyName("c"); + DesktopPatch model + = new DesktopPatch().withTags(mapOf("sbzkf", "uem", "dxrbuukzcle", "beyvpnqicvinvkjj", "fn", "yhmlwpaztzp")) + .withDescription("wyfzqwhxxbuyqa") + .withFriendlyName("feqztppriol"); model = BinaryData.fromObject(model).toObject(DesktopPatch.class); - Assertions.assertEquals("u", model.tags().get("gdknnqv")); - Assertions.assertEquals("nqntorudsgsahm", model.description()); - Assertions.assertEquals("c", model.friendlyName()); + Assertions.assertEquals("uem", model.tags().get("sbzkf")); + Assertions.assertEquals("wyfzqwhxxbuyqa", model.description()); + Assertions.assertEquals("feqztppriol", model.friendlyName()); } // Use "Map.of" if available diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java index deff52079e46..ec7a34742a7e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopPropertiesTests.java @@ -11,20 +11,18 @@ public final class DesktopPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DesktopProperties model = - BinaryData - .fromString( - "{\"objectId\":\"glsbjjc\",\"description\":\"vxb\",\"friendlyName\":\"vudutncor\",\"iconHash\":\"lxqtvcofudfl\"}") - .toObject(DesktopProperties.class); - Assertions.assertEquals("vxb", model.description()); - Assertions.assertEquals("vudutncor", model.friendlyName()); + DesktopProperties model = BinaryData.fromString( + "{\"objectId\":\"kggkfpa\",\"description\":\"owpulpq\",\"friendlyName\":\"ylsyxkqjnsje\",\"iconHash\":\"tiagx\"}") + .toObject(DesktopProperties.class); + Assertions.assertEquals("owpulpq", model.description()); + Assertions.assertEquals("ylsyxkqjnsje", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DesktopProperties model = new DesktopProperties().withDescription("vxb").withFriendlyName("vudutncor"); + DesktopProperties model = new DesktopProperties().withDescription("owpulpq").withFriendlyName("ylsyxkqjnsje"); model = BinaryData.fromObject(model).toObject(DesktopProperties.class); - Assertions.assertEquals("vxb", model.description()); - Assertions.assertEquals("vudutncor", model.friendlyName()); + Assertions.assertEquals("owpulpq", model.description()); + Assertions.assertEquals("ylsyxkqjnsje", model.friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java index 6ac6810bba06..ba3c2b21a373 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsGetWithResponseMockTests.java @@ -6,66 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Desktop; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class DesktopsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"objectId\":\"hdrwjjkh\",\"description\":\"omacluzvxnqmhr\",\"friendlyName\":\"pd\",\"iconHash\":\"mkoisqcssf\"},\"id\":\"uifmc\",\"name\":\"ypobkdqzr\",\"type\":\"zsylollgt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Desktop response = - manager - .desktops() - .getWithResponse("bta", "ypnyghshxc", "lhkgmnsghp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("omacluzvxnqmhr", response.description()); - Assertions.assertEquals("pd", response.friendlyName()); + String responseStr + = "{\"properties\":{\"objectId\":\"tlbijpzg\",\"description\":\"srfhf\",\"friendlyName\":\"lmknbnxwcdom\",\"iconHash\":\"vfqawzfgbrttuiac\"},\"id\":\"exhajlfn\",\"name\":\"hiqfyuttdiy\",\"type\":\"b\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Desktop response = manager.desktops() + .getWithResponse("mzvlazipbh", "wvqsgny", "uuzivensrpmeyyvp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("srfhf", response.description()); + Assertions.assertEquals("lmknbnxwcdom", response.friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java index b0e9e640b645..910325fd5535 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsListMockTests.java @@ -6,64 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Desktop; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class DesktopsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"properties\":{\"objectId\":\"cqlliz\",\"description\":\"ac\",\"friendlyName\":\"vhrweftkwqejpmv\",\"iconHash\":\"ehaepwamcxtc\"},\"id\":\"peuknijd\",\"name\":\"y\",\"type\":\"es\"}]}"; - String responseStr = - "{\"value\":[{\"properties\":{\"objectId\":\"xigdhxiidlope\",\"description\":\"wdpyq\",\"friendlyName\":\"bxubmdna\",\"iconHash\":\"bqwremjela\"},\"id\":\"cigeleohdbvqvw\",\"name\":\"kjopwbeon\",\"type\":\"lkwzdqybxceakxcp\"}]}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + PagedIterable response = manager.desktops() + .list("gqzgwldoychill", "ecfehuwa", 45723317, false, 2064417512, com.azure.core.util.Context.NONE); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.desktops().list("yrrueqth", "mg", 1745918799, false, 1620223491, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wdpyq", response.iterator().next().description()); - Assertions.assertEquals("bxubmdna", response.iterator().next().friendlyName()); + Assertions.assertEquals("ac", response.iterator().next().description()); + Assertions.assertEquals("vhrweftkwqejpmv", response.iterator().next().friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java index 46afcc0534d9..7d83af5d0ec6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/DesktopsUpdateWithResponseMockTests.java @@ -6,78 +6,44 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.Desktop; import com.azure.resourcemanager.desktopvirtualization.models.DesktopPatch; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class DesktopsUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"objectId\":\"xihspnxwq\",\"description\":\"nepzwakls\",\"friendlyName\":\"bqqqagwwrxa\",\"iconHash\":\"zisglrrczezkhh\"},\"id\":\"njad\",\"name\":\"qoawjqoy\",\"type\":\"eayfbpcmspl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Desktop response = - manager - .desktops() - .updateWithResponse( - "czzydmxzjij", - "vuaurk", - "hci", - new DesktopPatch() - .withTags(mapOf("ja", "efxrdcoxnbk", "qltgrd", "urnnqbnqbpiz")) - .withDescription("pxrxvbfihwu") - .withFriendlyName("ctafsrbxrblm"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nepzwakls", response.description()); - Assertions.assertEquals("bqqqagwwrxa", response.friendlyName()); + String responseStr + = "{\"properties\":{\"objectId\":\"afbwqroohtuovmao\",\"description\":\"rjtumghih\",\"friendlyName\":\"ecmslclbl\",\"iconHash\":\"xltbsjuscvsf\"},\"id\":\"ctmgxuupbezqccy\",\"name\":\"rtceukdqkkyihzt\",\"type\":\"eq\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Desktop response = manager.desktops() + .updateWithResponse("vnwsw", "txkyctwwgzwxjlm", "cvogygzyvne", + new DesktopPatch() + .withTags(mapOf("moqqtlffhzbk", "ifgh", "avfqnvhnqoewdogi", "kjj", "b", "etesypvidbztjhqt")) + .withDescription("ynkbwetnju") + .withFriendlyName("sprkzyaupiac"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("rjtumghih", response.description()); + Assertions.assertEquals("ecmslclbl", response.friendlyName()); } // Use "Map.of" if available diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java index 4154411b7b12..891694b9cca9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageInnerTests.java @@ -15,94 +15,76 @@ public final class ExpandMsixImageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExpandMsixImageInner model = - BinaryData - .fromString( - "{\"properties\":{\"packageAlias\":\"fgiagtcojocqwo\",\"imagePath\":\"nzjvusfzldm\",\"packageName\":\"uxylfsbtkadpy\",\"packageFamilyName\":\"wn\",\"packageFullName\":\"gkbugrjqct\",\"displayName\":\"cmisofie\",\"packageRelativePath\":\"efojyqdhcupl\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"hihlhzdsqtzbs\",\"publisher\":\"nowc\",\"minVersion\":\"fgmvecactxmwo\"},{\"dependencyName\":\"yowc\",\"publisher\":\"qovekqvgqou\",\"minVersion\":\"fzmpjwyivq\"},{\"dependencyName\":\"f\",\"publisher\":\"vhrfsphuagrt\",\"minVersion\":\"kteusqczk\"},{\"dependencyName\":\"klxubyja\",\"publisher\":\"mmfblcqcuubgqib\",\"minVersion\":\"a\"}],\"version\":\"etttwgdslqxihhr\",\"lastUpdated\":\"2021-07-10T01:42:44Z\",\"packageApplications\":[{\"appId\":\"seypxiutcxapz\",\"description\":\"rpetogebjoxsl\",\"appUserModelID\":\"nhl\",\"friendlyName\":\"rqnkkzjcjbtr\",\"iconImageName\":\"ehvvib\"}]},\"id\":\"jsto\",\"name\":\"beitpkx\",\"type\":\"tmo\"}") - .toObject(ExpandMsixImageInner.class); - Assertions.assertEquals("fgiagtcojocqwo", model.packageAlias()); - Assertions.assertEquals("nzjvusfzldm", model.imagePath()); - Assertions.assertEquals("uxylfsbtkadpy", model.packageName()); - Assertions.assertEquals("wn", model.packageFamilyName()); - Assertions.assertEquals("gkbugrjqct", model.packageFullName()); - Assertions.assertEquals("cmisofie", model.displayName()); - Assertions.assertEquals("efojyqdhcupl", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); + ExpandMsixImageInner model = BinaryData.fromString( + "{\"properties\":{\"packageAlias\":\"obrltt\",\"imagePath\":\"sjnygqdnfwqzdzgt\",\"packageName\":\"axhnfh\",\"packageFamilyName\":\"yvi\",\"packageFullName\":\"uwivkxoy\",\"displayName\":\"nbixxrti\",\"packageRelativePath\":\"cpwpg\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"oxfrkenxpmyyefr\",\"publisher\":\"pdnqqskawaoqvmmb\",\"minVersion\":\"qfr\"}],\"version\":\"lkzmegnitgvkxl\",\"lastUpdated\":\"2021-03-25T00:45:30Z\",\"packageApplications\":[{\"appId\":\"eg\",\"description\":\"alzxwhcan\",\"appUserModelID\":\"moy\",\"friendlyName\":\"lwigdivbkbx\",\"iconImageName\":\"mf\"}],\"certificateName\":\"asqvd\",\"certificateExpiry\":\"2021-08-06T04:39:44Z\"},\"id\":\"guxak\",\"name\":\"sqzhzbezkg\",\"type\":\"msidxasicddyvv\"}") + .toObject(ExpandMsixImageInner.class); + Assertions.assertEquals("obrltt", model.packageAlias()); + Assertions.assertEquals("sjnygqdnfwqzdzgt", model.imagePath()); + Assertions.assertEquals("axhnfh", model.packageName()); + Assertions.assertEquals("yvi", model.packageFamilyName()); + Assertions.assertEquals("uwivkxoy", model.packageFullName()); + Assertions.assertEquals("nbixxrti", model.displayName()); + Assertions.assertEquals("cpwpg", model.packageRelativePath()); + Assertions.assertEquals(false, model.isRegularRegistration()); Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("hihlhzdsqtzbs", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("nowc", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("fgmvecactxmwo", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("etttwgdslqxihhr", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T01:42:44Z"), model.lastUpdated()); - Assertions.assertEquals("seypxiutcxapz", model.packageApplications().get(0).appId()); - Assertions.assertEquals("rpetogebjoxsl", model.packageApplications().get(0).description()); - Assertions.assertEquals("nhl", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("rqnkkzjcjbtr", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("ehvvib", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("oxfrkenxpmyyefr", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("pdnqqskawaoqvmmb", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("qfr", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("lkzmegnitgvkxl", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T00:45:30Z"), model.lastUpdated()); + Assertions.assertEquals("eg", model.packageApplications().get(0).appId()); + Assertions.assertEquals("alzxwhcan", model.packageApplications().get(0).description()); + Assertions.assertEquals("moy", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("lwigdivbkbx", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("mf", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("asqvd", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T04:39:44Z"), model.certificateExpiry()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExpandMsixImageInner model = - new ExpandMsixImageInner() - .withPackageAlias("fgiagtcojocqwo") - .withImagePath("nzjvusfzldm") - .withPackageName("uxylfsbtkadpy") - .withPackageFamilyName("wn") - .withPackageFullName("gkbugrjqct") - .withDisplayName("cmisofie") - .withPackageRelativePath("efojyqdhcupl") - .withIsRegularRegistration(true) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("hihlhzdsqtzbs") - .withPublisher("nowc") - .withMinVersion("fgmvecactxmwo"), - new MsixPackageDependencies() - .withDependencyName("yowc") - .withPublisher("qovekqvgqou") - .withMinVersion("fzmpjwyivq"), - new MsixPackageDependencies() - .withDependencyName("f") - .withPublisher("vhrfsphuagrt") - .withMinVersion("kteusqczk"), - new MsixPackageDependencies() - .withDependencyName("klxubyja") - .withPublisher("mmfblcqcuubgqib") - .withMinVersion("a"))) - .withVersion("etttwgdslqxihhr") - .withLastUpdated(OffsetDateTime.parse("2021-07-10T01:42:44Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("seypxiutcxapz") - .withDescription("rpetogebjoxsl") - .withAppUserModelId("nhl") - .withFriendlyName("rqnkkzjcjbtr") - .withIconImageName("ehvvib"))); + ExpandMsixImageInner model = new ExpandMsixImageInner().withPackageAlias("obrltt") + .withImagePath("sjnygqdnfwqzdzgt") + .withPackageName("axhnfh") + .withPackageFamilyName("yvi") + .withPackageFullName("uwivkxoy") + .withDisplayName("nbixxrti") + .withPackageRelativePath("cpwpg") + .withIsRegularRegistration(false) + .withIsActive(true) + .withPackageDependencies(Arrays.asList(new MsixPackageDependencies().withDependencyName("oxfrkenxpmyyefr") + .withPublisher("pdnqqskawaoqvmmb") + .withMinVersion("qfr"))) + .withVersion("lkzmegnitgvkxl") + .withLastUpdated(OffsetDateTime.parse("2021-03-25T00:45:30Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("eg") + .withDescription("alzxwhcan") + .withAppUserModelId("moy") + .withFriendlyName("lwigdivbkbx") + .withIconImageName("mf"))) + .withCertificateName("asqvd") + .withCertificateExpiry(OffsetDateTime.parse("2021-08-06T04:39:44Z")); model = BinaryData.fromObject(model).toObject(ExpandMsixImageInner.class); - Assertions.assertEquals("fgiagtcojocqwo", model.packageAlias()); - Assertions.assertEquals("nzjvusfzldm", model.imagePath()); - Assertions.assertEquals("uxylfsbtkadpy", model.packageName()); - Assertions.assertEquals("wn", model.packageFamilyName()); - Assertions.assertEquals("gkbugrjqct", model.packageFullName()); - Assertions.assertEquals("cmisofie", model.displayName()); - Assertions.assertEquals("efojyqdhcupl", model.packageRelativePath()); - Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals("obrltt", model.packageAlias()); + Assertions.assertEquals("sjnygqdnfwqzdzgt", model.imagePath()); + Assertions.assertEquals("axhnfh", model.packageName()); + Assertions.assertEquals("yvi", model.packageFamilyName()); + Assertions.assertEquals("uwivkxoy", model.packageFullName()); + Assertions.assertEquals("nbixxrti", model.displayName()); + Assertions.assertEquals("cpwpg", model.packageRelativePath()); + Assertions.assertEquals(false, model.isRegularRegistration()); Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("hihlhzdsqtzbs", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("nowc", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("fgmvecactxmwo", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("etttwgdslqxihhr", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T01:42:44Z"), model.lastUpdated()); - Assertions.assertEquals("seypxiutcxapz", model.packageApplications().get(0).appId()); - Assertions.assertEquals("rpetogebjoxsl", model.packageApplications().get(0).description()); - Assertions.assertEquals("nhl", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("rqnkkzjcjbtr", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("ehvvib", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("oxfrkenxpmyyefr", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("pdnqqskawaoqvmmb", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("qfr", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("lkzmegnitgvkxl", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T00:45:30Z"), model.lastUpdated()); + Assertions.assertEquals("eg", model.packageApplications().get(0).appId()); + Assertions.assertEquals("alzxwhcan", model.packageApplications().get(0).description()); + Assertions.assertEquals("moy", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("lwigdivbkbx", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("mf", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("asqvd", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T04:39:44Z"), model.certificateExpiry()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java index 7bc66860f835..87d44d0d22e3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImageListTests.java @@ -16,150 +16,93 @@ public final class ExpandMsixImageListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExpandMsixImageList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"packageAlias\":\"ivsiy\",\"imagePath\":\"kdncj\",\"packageName\":\"onbzoggculapzwy\",\"packageFamilyName\":\"gogtqxepnylbf\",\"packageFullName\":\"jlyjtlvofq\",\"displayName\":\"vfcibyfmowux\",\"packageRelativePath\":\"jpvd\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"wzjbh\",\"publisher\":\"sxjrk\",\"minVersion\":\"btrnegvm\"},{\"dependencyName\":\"uqeqv\",\"publisher\":\"spastjbkkdmf\",\"minVersion\":\"est\"},{\"dependencyName\":\"lx\",\"publisher\":\"ilozapeewchpxlk\",\"minVersion\":\"kuziycsle\"}],\"version\":\"f\",\"lastUpdated\":\"2021-03-03T22:41:41Z\",\"packageApplications\":[{\"appId\":\"yhjtqedcgzu\",\"description\":\"mmrqz\",\"appUserModelID\":\"rjvpglydzgkrvqee\",\"friendlyName\":\"oepry\",\"iconImageName\":\"nwy\"},{\"appId\":\"mov\",\"description\":\"fvaawzqa\",\"appUserModelID\":\"lgzurig\",\"friendlyName\":\"ecxn\",\"iconImageName\":\"icokpv\"}]},\"id\":\"qtmldgxo\",\"name\":\"firclnpkciayz\",\"type\":\"iykhy\"},{\"properties\":{\"packageAlias\":\"vjlboxqvk\",\"imagePath\":\"mxho\",\"packageName\":\"ynhdwdigum\",\"packageFamilyName\":\"raauzzpt\",\"packageFullName\":\"zysdzh\",\"displayName\":\"wwvaiqyuvvfonk\",\"packageRelativePath\":\"hqyikvy\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"wmn\",\"publisher\":\"ttijfybvpoekrs\",\"minVersion\":\"gbdhuzqgnjdg\"},{\"dependencyName\":\"nscliqhzvhxnk\",\"publisher\":\"tkubotppn\",\"minVersion\":\"xz\"}],\"version\":\"ihfrbbcevqa\",\"lastUpdated\":\"2021-01-25T14:16:29Z\",\"packageApplications\":[{\"appId\":\"lfkqojpy\",\"description\":\"gtrd\",\"appUserModelID\":\"ifmzzsd\",\"friendlyName\":\"brn\",\"iconImageName\":\"u\"},{\"appId\":\"a\",\"description\":\"g\",\"appUserModelID\":\"hocxvdfffwafqrou\",\"friendlyName\":\"spave\",\"iconImageName\":\"r\"},{\"appId\":\"n\",\"description\":\"zudhcxg\",\"appUserModelID\":\"oyxcdyuib\",\"friendlyName\":\"fdn\",\"iconImageName\":\"ydvfvfcjnae\"},{\"appId\":\"vhmgorffukis\",\"description\":\"w\",\"appUserModelID\":\"hwplefaxvx\",\"friendlyName\":\"cbtgnhnz\",\"iconImageName\":\"qxtjjfzqlqhyca\"}]},\"id\":\"ggxdb\",\"name\":\"esmi\",\"type\":\"knlrariaawiuagy\"}],\"nextLink\":\"qfby\"}") - .toObject(ExpandMsixImageList.class); - Assertions.assertEquals("ivsiy", model.value().get(0).packageAlias()); - Assertions.assertEquals("kdncj", model.value().get(0).imagePath()); - Assertions.assertEquals("onbzoggculapzwy", model.value().get(0).packageName()); - Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("jlyjtlvofq", model.value().get(0).packageFullName()); - Assertions.assertEquals("vfcibyfmowux", model.value().get(0).displayName()); - Assertions.assertEquals("jpvd", model.value().get(0).packageRelativePath()); + ExpandMsixImageList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"packageAlias\":\"lftidgfcwqmpim\",\"imagePath\":\"xzhemjyh\",\"packageName\":\"uj\",\"packageFamilyName\":\"t\",\"packageFullName\":\"ozzwculkba\",\"displayName\":\"fajnjwltlwtjjguk\",\"packageRelativePath\":\"lhsnvkcdmx\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"nwiaaomyl\",\"publisher\":\"azul\",\"minVersion\":\"ethwwnpjhlfz\"},{\"dependencyName\":\"pchwa\",\"publisher\":\"bousn\",\"minVersion\":\"pgfewetwlyx\"},{\"dependencyName\":\"cxy\",\"publisher\":\"hdjhlimmbcx\",\"minVersion\":\"bcporxvxcjzhqizx\"},{\"dependencyName\":\"xtgqscjavftjuh\",\"publisher\":\"azkmtgguwp\",\"minVersion\":\"r\"}],\"version\":\"civmmg\",\"lastUpdated\":\"2021-01-10T01:44:49Z\",\"packageApplications\":[{\"appId\":\"rxgkne\",\"description\":\"yinzqodfvpgs\",\"appUserModelID\":\"xgsg\",\"friendlyName\":\"fgzdjtxvz\",\"iconImageName\":\"bqvgaqv\"},{\"appId\":\"cqusr\",\"description\":\"etnwsdtutnw\",\"appUserModelID\":\"uycvuzhyrmewip\",\"friendlyName\":\"ekdxuku\",\"iconImageName\":\"sjjxundxgketw\"}],\"certificateName\":\"jhfjmhvvmuvgpm\",\"certificateExpiry\":\"2021-03-07T00:28:37Z\"},\"id\":\"sx\",\"name\":\"mhfbuzjy\",\"type\":\"hsasbhu\"}],\"nextLink\":\"pohyuemslynsqyr\"}") + .toObject(ExpandMsixImageList.class); + Assertions.assertEquals("lftidgfcwqmpim", model.value().get(0).packageAlias()); + Assertions.assertEquals("xzhemjyh", model.value().get(0).imagePath()); + Assertions.assertEquals("uj", model.value().get(0).packageName()); + Assertions.assertEquals("t", model.value().get(0).packageFamilyName()); + Assertions.assertEquals("ozzwculkba", model.value().get(0).packageFullName()); + Assertions.assertEquals("fajnjwltlwtjjguk", model.value().get(0).displayName()); + Assertions.assertEquals("lhsnvkcdmx", model.value().get(0).packageRelativePath()); Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); Assertions.assertEquals(true, model.value().get(0).isActive()); - Assertions.assertEquals("wzjbh", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("sxjrk", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("btrnegvm", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("f", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T22:41:41Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("yhjtqedcgzu", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("mmrqz", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("rjvpglydzgkrvqee", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("oepry", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("nwy", model.value().get(0).packageApplications().get(0).iconImageName()); + Assertions.assertEquals("nwiaaomyl", model.value().get(0).packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("azul", model.value().get(0).packageDependencies().get(0).publisher()); + Assertions.assertEquals("ethwwnpjhlfz", model.value().get(0).packageDependencies().get(0).minVersion()); + Assertions.assertEquals("civmmg", model.value().get(0).version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T01:44:49Z"), model.value().get(0).lastUpdated()); + Assertions.assertEquals("rxgkne", model.value().get(0).packageApplications().get(0).appId()); + Assertions.assertEquals("yinzqodfvpgs", model.value().get(0).packageApplications().get(0).description()); + Assertions.assertEquals("xgsg", model.value().get(0).packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("fgzdjtxvz", model.value().get(0).packageApplications().get(0).friendlyName()); + Assertions.assertEquals("bqvgaqv", model.value().get(0).packageApplications().get(0).iconImageName()); + Assertions.assertEquals("jhfjmhvvmuvgpm", model.value().get(0).certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T00:28:37Z"), model.value().get(0).certificateExpiry()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExpandMsixImageList model = - new ExpandMsixImageList() - .withValue( - Arrays - .asList( - new ExpandMsixImageInner() - .withPackageAlias("ivsiy") - .withImagePath("kdncj") - .withPackageName("onbzoggculapzwy") - .withPackageFamilyName("gogtqxepnylbf") - .withPackageFullName("jlyjtlvofq") - .withDisplayName("vfcibyfmowux") - .withPackageRelativePath("jpvd") - .withIsRegularRegistration(true) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("wzjbh") - .withPublisher("sxjrk") - .withMinVersion("btrnegvm"), - new MsixPackageDependencies() - .withDependencyName("uqeqv") - .withPublisher("spastjbkkdmf") - .withMinVersion("est"), - new MsixPackageDependencies() - .withDependencyName("lx") - .withPublisher("ilozapeewchpxlk") - .withMinVersion("kuziycsle"))) - .withVersion("f") - .withLastUpdated(OffsetDateTime.parse("2021-03-03T22:41:41Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("yhjtqedcgzu") - .withDescription("mmrqz") - .withAppUserModelId("rjvpglydzgkrvqee") - .withFriendlyName("oepry") - .withIconImageName("nwy"), - new MsixPackageApplications() - .withAppId("mov") - .withDescription("fvaawzqa") - .withAppUserModelId("lgzurig") - .withFriendlyName("ecxn") - .withIconImageName("icokpv"))), - new ExpandMsixImageInner() - .withPackageAlias("vjlboxqvk") - .withImagePath("mxho") - .withPackageName("ynhdwdigum") - .withPackageFamilyName("raauzzpt") - .withPackageFullName("zysdzh") - .withDisplayName("wwvaiqyuvvfonk") - .withPackageRelativePath("hqyikvy") - .withIsRegularRegistration(false) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("wmn") - .withPublisher("ttijfybvpoekrs") - .withMinVersion("gbdhuzqgnjdg"), - new MsixPackageDependencies() - .withDependencyName("nscliqhzvhxnk") - .withPublisher("tkubotppn") - .withMinVersion("xz"))) - .withVersion("ihfrbbcevqa") - .withLastUpdated(OffsetDateTime.parse("2021-01-25T14:16:29Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("lfkqojpy") - .withDescription("gtrd") - .withAppUserModelId("ifmzzsd") - .withFriendlyName("brn") - .withIconImageName("u"), - new MsixPackageApplications() - .withAppId("a") - .withDescription("g") - .withAppUserModelId("hocxvdfffwafqrou") - .withFriendlyName("spave") - .withIconImageName("r"), - new MsixPackageApplications() - .withAppId("n") - .withDescription("zudhcxg") - .withAppUserModelId("oyxcdyuib") - .withFriendlyName("fdn") - .withIconImageName("ydvfvfcjnae"), - new MsixPackageApplications() - .withAppId("vhmgorffukis") - .withDescription("w") - .withAppUserModelId("hwplefaxvx") - .withFriendlyName("cbtgnhnz") - .withIconImageName("qxtjjfzqlqhyca"))))); + ExpandMsixImageList model = new ExpandMsixImageList() + .withValue(Arrays.asList(new ExpandMsixImageInner().withPackageAlias("lftidgfcwqmpim") + .withImagePath("xzhemjyh") + .withPackageName("uj") + .withPackageFamilyName("t") + .withPackageFullName("ozzwculkba") + .withDisplayName("fajnjwltlwtjjguk") + .withPackageRelativePath("lhsnvkcdmx") + .withIsRegularRegistration(true) + .withIsActive(true) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("nwiaaomyl") + .withPublisher("azul") + .withMinVersion("ethwwnpjhlfz"), + new MsixPackageDependencies().withDependencyName("pchwa") + .withPublisher("bousn") + .withMinVersion("pgfewetwlyx"), + new MsixPackageDependencies().withDependencyName("cxy") + .withPublisher("hdjhlimmbcx") + .withMinVersion("bcporxvxcjzhqizx"), + new MsixPackageDependencies().withDependencyName("xtgqscjavftjuh") + .withPublisher("azkmtgguwp") + .withMinVersion("r"))) + .withVersion("civmmg") + .withLastUpdated(OffsetDateTime.parse("2021-01-10T01:44:49Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("rxgkne") + .withDescription("yinzqodfvpgs") + .withAppUserModelId("xgsg") + .withFriendlyName("fgzdjtxvz") + .withIconImageName("bqvgaqv"), + new MsixPackageApplications().withAppId("cqusr") + .withDescription("etnwsdtutnw") + .withAppUserModelId("uycvuzhyrmewip") + .withFriendlyName("ekdxuku") + .withIconImageName("sjjxundxgketw"))) + .withCertificateName("jhfjmhvvmuvgpm") + .withCertificateExpiry(OffsetDateTime.parse("2021-03-07T00:28:37Z")))); model = BinaryData.fromObject(model).toObject(ExpandMsixImageList.class); - Assertions.assertEquals("ivsiy", model.value().get(0).packageAlias()); - Assertions.assertEquals("kdncj", model.value().get(0).imagePath()); - Assertions.assertEquals("onbzoggculapzwy", model.value().get(0).packageName()); - Assertions.assertEquals("gogtqxepnylbf", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("jlyjtlvofq", model.value().get(0).packageFullName()); - Assertions.assertEquals("vfcibyfmowux", model.value().get(0).displayName()); - Assertions.assertEquals("jpvd", model.value().get(0).packageRelativePath()); + Assertions.assertEquals("lftidgfcwqmpim", model.value().get(0).packageAlias()); + Assertions.assertEquals("xzhemjyh", model.value().get(0).imagePath()); + Assertions.assertEquals("uj", model.value().get(0).packageName()); + Assertions.assertEquals("t", model.value().get(0).packageFamilyName()); + Assertions.assertEquals("ozzwculkba", model.value().get(0).packageFullName()); + Assertions.assertEquals("fajnjwltlwtjjguk", model.value().get(0).displayName()); + Assertions.assertEquals("lhsnvkcdmx", model.value().get(0).packageRelativePath()); Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); Assertions.assertEquals(true, model.value().get(0).isActive()); - Assertions.assertEquals("wzjbh", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("sxjrk", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("btrnegvm", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("f", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T22:41:41Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("yhjtqedcgzu", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("mmrqz", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("rjvpglydzgkrvqee", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("oepry", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("nwy", model.value().get(0).packageApplications().get(0).iconImageName()); + Assertions.assertEquals("nwiaaomyl", model.value().get(0).packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("azul", model.value().get(0).packageDependencies().get(0).publisher()); + Assertions.assertEquals("ethwwnpjhlfz", model.value().get(0).packageDependencies().get(0).minVersion()); + Assertions.assertEquals("civmmg", model.value().get(0).version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-10T01:44:49Z"), model.value().get(0).lastUpdated()); + Assertions.assertEquals("rxgkne", model.value().get(0).packageApplications().get(0).appId()); + Assertions.assertEquals("yinzqodfvpgs", model.value().get(0).packageApplications().get(0).description()); + Assertions.assertEquals("xgsg", model.value().get(0).packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("fgzdjtxvz", model.value().get(0).packageApplications().get(0).friendlyName()); + Assertions.assertEquals("bqvgaqv", model.value().get(0).packageApplications().get(0).iconImageName()); + Assertions.assertEquals("jhfjmhvvmuvgpm", model.value().get(0).certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T00:28:37Z"), model.value().get(0).certificateExpiry()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java index 46cc8bb97e89..f5b00494e7ca 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ExpandMsixImagePropertiesTests.java @@ -15,96 +15,83 @@ public final class ExpandMsixImagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ExpandMsixImageProperties model = - BinaryData - .fromString( - "{\"packageAlias\":\"klf\",\"imagePath\":\"dgfcwqmp\",\"packageName\":\"aqxzhemjyho\",\"packageFamilyName\":\"jswtwkozzwc\",\"packageFullName\":\"kb\",\"displayName\":\"pfajnjwltlwtjj\",\"packageRelativePath\":\"ktalhsnvkcdmxz\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"wiaaomylweaz\",\"publisher\":\"cse\",\"minVersion\":\"wwnpj\"},{\"dependencyName\":\"fz\",\"publisher\":\"pchwa\",\"minVersion\":\"bousn\"},{\"dependencyName\":\"pgfewetwlyx\",\"publisher\":\"cxy\",\"minVersion\":\"hdjhlimmbcx\"}],\"version\":\"bcporxvxcjzhqizx\",\"lastUpdated\":\"2021-11-25T06:23:01Z\",\"packageApplications\":[{\"appId\":\"scjavftju\",\"description\":\"qaz\",\"appUserModelID\":\"tgguwpijrajcivmm\",\"friendlyName\":\"f\",\"iconImageName\":\"iwrxgkn\"},{\"appId\":\"inzqodfvpgs\",\"description\":\"xgsg\",\"appUserModelID\":\"fgzdjtxvz\",\"friendlyName\":\"bqvgaqv\",\"iconImageName\":\"a\"}]}") - .toObject(ExpandMsixImageProperties.class); - Assertions.assertEquals("klf", model.packageAlias()); - Assertions.assertEquals("dgfcwqmp", model.imagePath()); - Assertions.assertEquals("aqxzhemjyho", model.packageName()); - Assertions.assertEquals("jswtwkozzwc", model.packageFamilyName()); - Assertions.assertEquals("kb", model.packageFullName()); - Assertions.assertEquals("pfajnjwltlwtjj", model.displayName()); - Assertions.assertEquals("ktalhsnvkcdmxz", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("wiaaomylweaz", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("cse", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("wwnpj", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("bcporxvxcjzhqizx", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T06:23:01Z"), model.lastUpdated()); - Assertions.assertEquals("scjavftju", model.packageApplications().get(0).appId()); - Assertions.assertEquals("qaz", model.packageApplications().get(0).description()); - Assertions.assertEquals("tgguwpijrajcivmm", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("f", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("iwrxgkn", model.packageApplications().get(0).iconImageName()); + ExpandMsixImageProperties model = BinaryData.fromString( + "{\"packageAlias\":\"kgfmocwahpq\",\"imagePath\":\"tjeaahhvjhh\",\"packageName\":\"kzyb\",\"packageFamilyName\":\"jid\",\"packageFullName\":\"syxkyxvxevblb\",\"displayName\":\"dnlj\",\"packageRelativePath\":\"geuaulx\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ppxynenls\",\"publisher\":\"eizzgwk\",\"minVersion\":\"srmffeycxcktpiym\"},{\"dependencyName\":\"teeammxqiekkkzd\",\"publisher\":\"tkgdojbmxva\",\"minVersion\":\"efdeesve\"},{\"dependencyName\":\"ijpxtx\",\"publisher\":\"wprtu\",\"minVersion\":\"sawddjibabxvi\"}],\"version\":\"tvtzeexavoxtfg\",\"lastUpdated\":\"2021-10-13T21:26:08Z\",\"packageApplications\":[{\"appId\":\"qbw\",\"description\":\"pqtgsfjac\",\"appUserModelID\":\"lhhxudbxvodhtnsi\",\"friendlyName\":\"dhzmmesckdlp\",\"iconImageName\":\"zrcxfailcfxwmdbo\"}],\"certificateName\":\"sftufqobrjlna\",\"certificateExpiry\":\"2021-08-15T07:12:12Z\"}") + .toObject(ExpandMsixImageProperties.class); + Assertions.assertEquals("kgfmocwahpq", model.packageAlias()); + Assertions.assertEquals("tjeaahhvjhh", model.imagePath()); + Assertions.assertEquals("kzyb", model.packageName()); + Assertions.assertEquals("jid", model.packageFamilyName()); + Assertions.assertEquals("syxkyxvxevblb", model.packageFullName()); + Assertions.assertEquals("dnlj", model.displayName()); + Assertions.assertEquals("geuaulx", model.packageRelativePath()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals(false, model.isActive()); + Assertions.assertEquals("ppxynenls", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("eizzgwk", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("srmffeycxcktpiym", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("tvtzeexavoxtfg", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T21:26:08Z"), model.lastUpdated()); + Assertions.assertEquals("qbw", model.packageApplications().get(0).appId()); + Assertions.assertEquals("pqtgsfjac", model.packageApplications().get(0).description()); + Assertions.assertEquals("lhhxudbxvodhtnsi", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("dhzmmesckdlp", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("zrcxfailcfxwmdbo", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("sftufqobrjlna", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-15T07:12:12Z"), model.certificateExpiry()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ExpandMsixImageProperties model = - new ExpandMsixImageProperties() - .withPackageAlias("klf") - .withImagePath("dgfcwqmp") - .withPackageName("aqxzhemjyho") - .withPackageFamilyName("jswtwkozzwc") - .withPackageFullName("kb") - .withDisplayName("pfajnjwltlwtjj") - .withPackageRelativePath("ktalhsnvkcdmxz") - .withIsRegularRegistration(false) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("wiaaomylweaz") - .withPublisher("cse") - .withMinVersion("wwnpj"), - new MsixPackageDependencies() - .withDependencyName("fz") - .withPublisher("pchwa") - .withMinVersion("bousn"), - new MsixPackageDependencies() - .withDependencyName("pgfewetwlyx") - .withPublisher("cxy") - .withMinVersion("hdjhlimmbcx"))) - .withVersion("bcporxvxcjzhqizx") - .withLastUpdated(OffsetDateTime.parse("2021-11-25T06:23:01Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("scjavftju") - .withDescription("qaz") - .withAppUserModelId("tgguwpijrajcivmm") - .withFriendlyName("f") - .withIconImageName("iwrxgkn"), - new MsixPackageApplications() - .withAppId("inzqodfvpgs") - .withDescription("xgsg") - .withAppUserModelId("fgzdjtxvz") - .withFriendlyName("bqvgaqv") - .withIconImageName("a"))); + ExpandMsixImageProperties model = new ExpandMsixImageProperties().withPackageAlias("kgfmocwahpq") + .withImagePath("tjeaahhvjhh") + .withPackageName("kzyb") + .withPackageFamilyName("jid") + .withPackageFullName("syxkyxvxevblb") + .withDisplayName("dnlj") + .withPackageRelativePath("geuaulx") + .withIsRegularRegistration(true) + .withIsActive(false) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("ppxynenls") + .withPublisher("eizzgwk") + .withMinVersion("srmffeycxcktpiym"), + new MsixPackageDependencies().withDependencyName("teeammxqiekkkzd") + .withPublisher("tkgdojbmxva") + .withMinVersion("efdeesve"), + new MsixPackageDependencies().withDependencyName("ijpxtx") + .withPublisher("wprtu") + .withMinVersion("sawddjibabxvi"))) + .withVersion("tvtzeexavoxtfg") + .withLastUpdated(OffsetDateTime.parse("2021-10-13T21:26:08Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("qbw") + .withDescription("pqtgsfjac") + .withAppUserModelId("lhhxudbxvodhtnsi") + .withFriendlyName("dhzmmesckdlp") + .withIconImageName("zrcxfailcfxwmdbo"))) + .withCertificateName("sftufqobrjlna") + .withCertificateExpiry(OffsetDateTime.parse("2021-08-15T07:12:12Z")); model = BinaryData.fromObject(model).toObject(ExpandMsixImageProperties.class); - Assertions.assertEquals("klf", model.packageAlias()); - Assertions.assertEquals("dgfcwqmp", model.imagePath()); - Assertions.assertEquals("aqxzhemjyho", model.packageName()); - Assertions.assertEquals("jswtwkozzwc", model.packageFamilyName()); - Assertions.assertEquals("kb", model.packageFullName()); - Assertions.assertEquals("pfajnjwltlwtjj", model.displayName()); - Assertions.assertEquals("ktalhsnvkcdmxz", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("wiaaomylweaz", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("cse", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("wwnpj", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("bcporxvxcjzhqizx", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T06:23:01Z"), model.lastUpdated()); - Assertions.assertEquals("scjavftju", model.packageApplications().get(0).appId()); - Assertions.assertEquals("qaz", model.packageApplications().get(0).description()); - Assertions.assertEquals("tgguwpijrajcivmm", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("f", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("iwrxgkn", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("kgfmocwahpq", model.packageAlias()); + Assertions.assertEquals("tjeaahhvjhh", model.imagePath()); + Assertions.assertEquals("kzyb", model.packageName()); + Assertions.assertEquals("jid", model.packageFamilyName()); + Assertions.assertEquals("syxkyxvxevblb", model.packageFullName()); + Assertions.assertEquals("dnlj", model.displayName()); + Assertions.assertEquals("geuaulx", model.packageRelativePath()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals(false, model.isActive()); + Assertions.assertEquals("ppxynenls", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("eizzgwk", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("srmffeycxcktpiym", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("tvtzeexavoxtfg", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T21:26:08Z"), model.lastUpdated()); + Assertions.assertEquals("qbw", model.packageApplications().get(0).appId()); + Assertions.assertEquals("pqtgsfjac", model.packageApplications().get(0).description()); + Assertions.assertEquals("lhhxudbxvodhtnsi", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("dhzmmesckdlp", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("zrcxfailcfxwmdbo", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("sftufqobrjlna", model.certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-15T07:12:12Z"), model.certificateExpiry()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java index 6177b05dd095..ee2d8c4f1678 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/HostPoolsDeleteWithResponseMockTests.java @@ -6,56 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class HostPoolsDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.hostPools().deleteWithResponse("ay", "xbulpzealbmqkyo", false, com.azure.core.util.Context.NONE); - manager.hostPools().deleteWithResponse("houcqpqojxc", "zrzdcgd", true, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java index 1f1a86b7b845..adb6c194eeac 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/IdentityTests.java @@ -12,10 +12,9 @@ public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString("{\"principalId\":\"zdn\",\"tenantId\":\"jq\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); + Identity model = BinaryData.fromString( + "{\"principalId\":\"53ef37ad-32fd-43f1-b598-7081b2763649\",\"tenantId\":\"09593a46-6aac-4336-9d86-e82c1461a246\",\"type\":\"SystemAssigned\"}") + .toObject(Identity.class); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImportPackageInfoRequestTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImportPackageInfoRequestTests.java new file mode 100644 index 000000000000..6bd2615012b5 --- /dev/null +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ImportPackageInfoRequestTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.desktopvirtualization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackageArchitectures; +import com.azure.resourcemanager.desktopvirtualization.models.ImportPackageInfoRequest; +import org.junit.jupiter.api.Assertions; + +public final class ImportPackageInfoRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImportPackageInfoRequest model = BinaryData.fromString("{\"path\":\"uqeqv\",\"packageArchitecture\":\"x86\"}") + .toObject(ImportPackageInfoRequest.class); + Assertions.assertEquals("uqeqv", model.path()); + Assertions.assertEquals(AppAttachPackageArchitectures.X86, model.packageArchitecture()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImportPackageInfoRequest model = new ImportPackageInfoRequest().withPath("uqeqv") + .withPackageArchitecture(AppAttachPackageArchitectures.X86); + model = BinaryData.fromObject(model).toObject(ImportPackageInfoRequest.class); + Assertions.assertEquals("uqeqv", model.path()); + Assertions.assertEquals(AppAttachPackageArchitectures.X86, model.packageArchitecture()); + } +} diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java index 4265503fd082..ee52843d8630 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/LogSpecificationTests.java @@ -11,10 +11,9 @@ public final class LogSpecificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LogSpecification model = - BinaryData - .fromString("{\"name\":\"ryhtnapczwlokjy\",\"displayName\":\"kkvnipjox\",\"blobDuration\":\"nchgej\"}") - .toObject(LogSpecification.class); + LogSpecification model = BinaryData + .fromString("{\"name\":\"ryhtnapczwlokjy\",\"displayName\":\"kkvnipjox\",\"blobDuration\":\"nchgej\"}") + .toObject(LogSpecification.class); Assertions.assertEquals("ryhtnapczwlokjy", model.name()); Assertions.assertEquals("kkvnipjox", model.displayName()); Assertions.assertEquals("nchgej", model.blobDuration()); @@ -22,8 +21,9 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogSpecification model = - new LogSpecification().withName("ryhtnapczwlokjy").withDisplayName("kkvnipjox").withBlobDuration("nchgej"); + LogSpecification model = new LogSpecification().withName("ryhtnapczwlokjy") + .withDisplayName("kkvnipjox") + .withBlobDuration("nchgej"); model = BinaryData.fromObject(model).toObject(LogSpecification.class); Assertions.assertEquals("ryhtnapczwlokjy", model.name()); Assertions.assertEquals("kkvnipjox", model.displayName()); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java index c4347feabd38..bab5292c3215 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPatchPropertiesTests.java @@ -12,20 +12,19 @@ public final class MaintenanceWindowPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MaintenanceWindowPatchProperties model = - BinaryData - .fromString("{\"hour\":831606659,\"dayOfWeek\":\"Wednesday\"}") + MaintenanceWindowPatchProperties model + = BinaryData.fromString("{\"hour\":1311146203,\"dayOfWeek\":\"Wednesday\"}") .toObject(MaintenanceWindowPatchProperties.class); - Assertions.assertEquals(831606659, model.hour()); + Assertions.assertEquals(1311146203, model.hour()); Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MaintenanceWindowPatchProperties model = - new MaintenanceWindowPatchProperties().withHour(831606659).withDayOfWeek(DayOfWeek.WEDNESDAY); + MaintenanceWindowPatchProperties model + = new MaintenanceWindowPatchProperties().withHour(1311146203).withDayOfWeek(DayOfWeek.WEDNESDAY); model = BinaryData.fromObject(model).toObject(MaintenanceWindowPatchProperties.class); - Assertions.assertEquals(831606659, model.hour()); + Assertions.assertEquals(1311146203, model.hour()); Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java index 6b6eafe167ac..86e5118b9aa1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MaintenanceWindowPropertiesTests.java @@ -12,20 +12,18 @@ public final class MaintenanceWindowPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MaintenanceWindowProperties model = - BinaryData - .fromString("{\"hour\":1689863270,\"dayOfWeek\":\"Wednesday\"}") - .toObject(MaintenanceWindowProperties.class); - Assertions.assertEquals(1689863270, model.hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); + MaintenanceWindowProperties model = BinaryData.fromString("{\"hour\":1374887959,\"dayOfWeek\":\"Friday\"}") + .toObject(MaintenanceWindowProperties.class); + Assertions.assertEquals(1374887959, model.hour()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.dayOfWeek()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MaintenanceWindowProperties model = - new MaintenanceWindowProperties().withHour(1689863270).withDayOfWeek(DayOfWeek.WEDNESDAY); + MaintenanceWindowProperties model + = new MaintenanceWindowProperties().withHour(1374887959).withDayOfWeek(DayOfWeek.FRIDAY); model = BinaryData.fromObject(model).toObject(MaintenanceWindowProperties.class); - Assertions.assertEquals(1689863270, model.hour()); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.dayOfWeek()); + Assertions.assertEquals(1374887959, model.hour()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.dayOfWeek()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java index 00ac600b0706..d60856db7211 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImageUriTests.java @@ -11,14 +11,14 @@ public final class MsixImageUriTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixImageUri model = BinaryData.fromString("{\"uri\":\"zb\"}").toObject(MsixImageUri.class); - Assertions.assertEquals("zb", model.uri()); + MsixImageUri model = BinaryData.fromString("{\"uri\":\"oqbeitpkxzt\"}").toObject(MsixImageUri.class); + Assertions.assertEquals("oqbeitpkxzt", model.uri()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixImageUri model = new MsixImageUri().withUri("zb"); + MsixImageUri model = new MsixImageUri().withUri("oqbeitpkxzt"); model = BinaryData.fromObject(model).toObject(MsixImageUri.class); - Assertions.assertEquals("zb", model.uri()); + Assertions.assertEquals("oqbeitpkxzt", model.uri()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java index 6ce8e89a96ce..8e0073667c9b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixImagesExpandMockTests.java @@ -6,84 +6,57 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ExpandMsixImage; import com.azure.resourcemanager.desktopvirtualization.models.MsixImageUri; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MsixImagesExpandMockTests { @Test public void testExpand() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"packageAlias\":\"hmpejtlkexaonw\",\"imagePath\":\"kcq\",\"packageName\":\"xhxknlc\",\"packageFamilyName\":\"mmkyu\",\"packageFullName\":\"jubyqjfkakfq\",\"displayName\":\"kemyil\",\"packageRelativePath\":\"dxjascowvfdj\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ksnmgzv\",\"publisher\":\"ij\",\"minVersion\":\"zuqnwsithuqo\"},{\"dependencyName\":\"ah\",\"publisher\":\"qwqul\",\"minVersion\":\"trjbhxykfhyq\"},{\"dependencyName\":\"vqqugdrftbcv\",\"publisher\":\"reuquowtljvf\",\"minVersion\":\"reagkhyxvrqt\"}],\"version\":\"czsulmdggl\",\"lastUpdated\":\"2021-11-17T19:55:24Z\",\"packageApplications\":[{\"appId\":\"s\",\"description\":\"kgsangpszng\",\"appUserModelID\":\"p\",\"friendlyName\":\"lkvec\",\"iconImageName\":\"jcngoadyed\"},{\"appId\":\"jfoknubnoitpkp\",\"description\":\"rgdg\",\"appUserModelID\":\"coqra\",\"friendlyName\":\"ugyxpqit\",\"iconImageName\":\"ialwv\"}]},\"id\":\"uhz\",\"name\":\"caqt\",\"type\":\"ltcoqc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .msixImages() - .expand("oaiknaqlnuwig", "yxl", new MsixImageUri().withUri("wphvxz"), com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hmpejtlkexaonw", response.iterator().next().packageAlias()); - Assertions.assertEquals("kcq", response.iterator().next().imagePath()); - Assertions.assertEquals("xhxknlc", response.iterator().next().packageName()); - Assertions.assertEquals("mmkyu", response.iterator().next().packageFamilyName()); - Assertions.assertEquals("jubyqjfkakfq", response.iterator().next().packageFullName()); - Assertions.assertEquals("kemyil", response.iterator().next().displayName()); - Assertions.assertEquals("dxjascowvfdj", response.iterator().next().packageRelativePath()); - Assertions.assertEquals(false, response.iterator().next().isRegularRegistration()); + String responseStr + = "{\"value\":[{\"properties\":{\"packageAlias\":\"zvbrzcdbanfzndsc\",\"imagePath\":\"xeatkd\",\"packageName\":\"wnrdjyibqbnaom\",\"packageFamilyName\":\"rmkuh\",\"packageFullName\":\"xljalfihc\",\"displayName\":\"obcancdexxqcw\",\"packageRelativePath\":\"xf\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"wjjzrlt\",\"publisher\":\"l\",\"minVersion\":\"yyfytpqsixymm\"},{\"dependencyName\":\"jivyqlkjuv\",\"publisher\":\"bmslzoyov\",\"minVersion\":\"dbpqvybefgvm\"}],\"version\":\"okcvtlubses\",\"lastUpdated\":\"2021-01-02T05:52:53Z\",\"packageApplications\":[{\"appId\":\"t\",\"description\":\"unlpirykycndz\",\"appUserModelID\":\"ivjreuyk\",\"friendlyName\":\"mnwagltbxoe\",\"iconImageName\":\"nqlnfwmyymvqd\"}],\"certificateName\":\"fckdvez\",\"certificateExpiry\":\"2021-09-07T23:55:15Z\"},\"id\":\"sbzhd\",\"name\":\"ub\",\"type\":\"nqfblhkalehpava\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.msixImages() + .expand("bqsdtcjbctvi", "uzqymtuowog", new MsixImageUri().withUri("it"), com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zvbrzcdbanfzndsc", response.iterator().next().packageAlias()); + Assertions.assertEquals("xeatkd", response.iterator().next().imagePath()); + Assertions.assertEquals("wnrdjyibqbnaom", response.iterator().next().packageName()); + Assertions.assertEquals("rmkuh", response.iterator().next().packageFamilyName()); + Assertions.assertEquals("xljalfihc", response.iterator().next().packageFullName()); + Assertions.assertEquals("obcancdexxqcw", response.iterator().next().displayName()); + Assertions.assertEquals("xf", response.iterator().next().packageRelativePath()); + Assertions.assertEquals(true, response.iterator().next().isRegularRegistration()); Assertions.assertEquals(false, response.iterator().next().isActive()); - Assertions.assertEquals("ksnmgzv", response.iterator().next().packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("ij", response.iterator().next().packageDependencies().get(0).publisher()); - Assertions.assertEquals("zuqnwsithuqo", response.iterator().next().packageDependencies().get(0).minVersion()); - Assertions.assertEquals("czsulmdggl", response.iterator().next().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T19:55:24Z"), response.iterator().next().lastUpdated()); - Assertions.assertEquals("s", response.iterator().next().packageApplications().get(0).appId()); - Assertions.assertEquals("kgsangpszng", response.iterator().next().packageApplications().get(0).description()); - Assertions.assertEquals("p", response.iterator().next().packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("lkvec", response.iterator().next().packageApplications().get(0).friendlyName()); - Assertions.assertEquals("jcngoadyed", response.iterator().next().packageApplications().get(0).iconImageName()); + Assertions.assertEquals("wjjzrlt", response.iterator().next().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("l", response.iterator().next().packageDependencies().get(0).publisher()); + Assertions.assertEquals("yyfytpqsixymm", response.iterator().next().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("okcvtlubses", response.iterator().next().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-02T05:52:53Z"), response.iterator().next().lastUpdated()); + Assertions.assertEquals("t", response.iterator().next().packageApplications().get(0).appId()); + Assertions.assertEquals("unlpirykycndz", response.iterator().next().packageApplications().get(0).description()); + Assertions.assertEquals("ivjreuyk", response.iterator().next().packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("mnwagltbxoe", response.iterator().next().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("nqlnfwmyymvqd", + response.iterator().next().packageApplications().get(0).iconImageName()); + Assertions.assertEquals("fckdvez", response.iterator().next().certificateName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T23:55:15Z"), + response.iterator().next().certificateExpiry()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java index 831d8daa2fda..36ee92a28071 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageApplicationsTests.java @@ -11,32 +11,28 @@ public final class MsixPackageApplicationsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackageApplications model = - BinaryData - .fromString( - "{\"appId\":\"xeclzedqbcvhzlhp\",\"description\":\"dqkdlwwqfbu\",\"appUserModelID\":\"kxtrq\",\"friendlyName\":\"smlmbtxhwgfwsrta\",\"iconImageName\":\"oezbrhubsk\"}") - .toObject(MsixPackageApplications.class); - Assertions.assertEquals("xeclzedqbcvhzlhp", model.appId()); - Assertions.assertEquals("dqkdlwwqfbu", model.description()); - Assertions.assertEquals("kxtrq", model.appUserModelId()); - Assertions.assertEquals("smlmbtxhwgfwsrta", model.friendlyName()); - Assertions.assertEquals("oezbrhubsk", model.iconImageName()); + MsixPackageApplications model = BinaryData.fromString( + "{\"appId\":\"mwn\",\"description\":\"tmr\",\"appUserModelID\":\"irctymoxoftpipiw\",\"friendlyName\":\"zuhx\",\"iconImageName\":\"pqjlihhyusps\"}") + .toObject(MsixPackageApplications.class); + Assertions.assertEquals("mwn", model.appId()); + Assertions.assertEquals("tmr", model.description()); + Assertions.assertEquals("irctymoxoftpipiw", model.appUserModelId()); + Assertions.assertEquals("zuhx", model.friendlyName()); + Assertions.assertEquals("pqjlihhyusps", model.iconImageName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackageApplications model = - new MsixPackageApplications() - .withAppId("xeclzedqbcvhzlhp") - .withDescription("dqkdlwwqfbu") - .withAppUserModelId("kxtrq") - .withFriendlyName("smlmbtxhwgfwsrta") - .withIconImageName("oezbrhubsk"); + MsixPackageApplications model = new MsixPackageApplications().withAppId("mwn") + .withDescription("tmr") + .withAppUserModelId("irctymoxoftpipiw") + .withFriendlyName("zuhx") + .withIconImageName("pqjlihhyusps"); model = BinaryData.fromObject(model).toObject(MsixPackageApplications.class); - Assertions.assertEquals("xeclzedqbcvhzlhp", model.appId()); - Assertions.assertEquals("dqkdlwwqfbu", model.description()); - Assertions.assertEquals("kxtrq", model.appUserModelId()); - Assertions.assertEquals("smlmbtxhwgfwsrta", model.friendlyName()); - Assertions.assertEquals("oezbrhubsk", model.iconImageName()); + Assertions.assertEquals("mwn", model.appId()); + Assertions.assertEquals("tmr", model.description()); + Assertions.assertEquals("irctymoxoftpipiw", model.appUserModelId()); + Assertions.assertEquals("zuhx", model.friendlyName()); + Assertions.assertEquals("pqjlihhyusps", model.iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java index 98cb9643dce8..836c2f512704 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageDependenciesTests.java @@ -11,26 +11,23 @@ public final class MsixPackageDependenciesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackageDependencies model = - BinaryData - .fromString( - "{\"dependencyName\":\"yklyhpluodpvruud\",\"publisher\":\"zibt\",\"minVersion\":\"stgktst\"}") - .toObject(MsixPackageDependencies.class); - Assertions.assertEquals("yklyhpluodpvruud", model.dependencyName()); - Assertions.assertEquals("zibt", model.publisher()); - Assertions.assertEquals("stgktst", model.minVersion()); + MsixPackageDependencies model = BinaryData + .fromString( + "{\"dependencyName\":\"zzbtdcqvpniyujvi\",\"publisher\":\"wdsh\",\"minVersion\":\"snrbgyefrymsgao\"}") + .toObject(MsixPackageDependencies.class); + Assertions.assertEquals("zzbtdcqvpniyujvi", model.dependencyName()); + Assertions.assertEquals("wdsh", model.publisher()); + Assertions.assertEquals("snrbgyefrymsgao", model.minVersion()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackageDependencies model = - new MsixPackageDependencies() - .withDependencyName("yklyhpluodpvruud") - .withPublisher("zibt") - .withMinVersion("stgktst"); + MsixPackageDependencies model = new MsixPackageDependencies().withDependencyName("zzbtdcqvpniyujvi") + .withPublisher("wdsh") + .withMinVersion("snrbgyefrymsgao"); model = BinaryData.fromObject(model).toObject(MsixPackageDependencies.class); - Assertions.assertEquals("yklyhpluodpvruud", model.dependencyName()); - Assertions.assertEquals("zibt", model.publisher()); - Assertions.assertEquals("stgktst", model.minVersion()); + Assertions.assertEquals("zzbtdcqvpniyujvi", model.dependencyName()); + Assertions.assertEquals("wdsh", model.publisher()); + Assertions.assertEquals("snrbgyefrymsgao", model.minVersion()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java index 1e2017bef96f..4806f0d331e3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageInnerTests.java @@ -15,90 +15,82 @@ public final class MsixPackageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackageInner model = - BinaryData - .fromString( - "{\"properties\":{\"imagePath\":\"swdvzyybycnun\",\"packageName\":\"srtkfa\",\"packageFamilyName\":\"opqgikyzirtxdyux\",\"displayName\":\"jntpsewgioilqu\",\"packageRelativePath\":\"ydxtqm\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ufhyaomtbgh\",\"publisher\":\"vgrvkffo\",\"minVersion\":\"zh\"},{\"dependencyName\":\"bibgjmfxumv\",\"publisher\":\"luyovwxnbkfezzx\",\"minVersion\":\"yhwzdgiruj\"},{\"dependencyName\":\"bomvzzbtdcqv\",\"publisher\":\"iyujviylwdshfs\",\"minVersion\":\"rbgyefry\"}],\"version\":\"gaojf\",\"lastUpdated\":\"2021-04-10T10:30:40Z\",\"packageApplications\":[{\"appId\":\"mrfhirctymox\",\"description\":\"tpipiwyczuhx\",\"appUserModelID\":\"pqjlihhyusps\",\"friendlyName\":\"sdvlmfwdgzxulucv\",\"iconImageName\":\"mrsreuzvxurisjnh\"},{\"appId\":\"ifqjz\",\"description\":\"mrhublwpc\",\"appUserModelID\":\"utr\",\"friendlyName\":\"upauut\",\"iconImageName\":\"oqh\"}]},\"id\":\"jqgwzp\",\"name\":\"fqntcyp\",\"type\":\"xjvfoimwksl\"}") - .toObject(MsixPackageInner.class); - Assertions.assertEquals("swdvzyybycnun", model.imagePath()); - Assertions.assertEquals("srtkfa", model.packageName()); - Assertions.assertEquals("opqgikyzirtxdyux", model.packageFamilyName()); - Assertions.assertEquals("jntpsewgioilqu", model.displayName()); - Assertions.assertEquals("ydxtqm", model.packageRelativePath()); + MsixPackageInner model = BinaryData.fromString( + "{\"properties\":{\"imagePath\":\"vyhgs\",\"packageName\":\"byrqufeg\",\"packageFamilyName\":\"vwz\",\"displayName\":\"nhlmctlpdng\",\"packageRelativePath\":\"vgbmhr\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"ejvegrhbpnaixex\",\"publisher\":\"b\",\"minVersion\":\"eaxhcexdrrvqahqk\"},{\"dependencyName\":\"tpwijnh\",\"publisher\":\"svfycxzbfv\",\"minVersion\":\"wvrvmtg\"},{\"dependencyName\":\"ppyostronzmyhgf\",\"publisher\":\"nsxkmcwaekrrjr\",\"minVersion\":\"fxtsgum\"}],\"version\":\"glikkxwslolb\",\"lastUpdated\":\"2021-11-05T04:06:51Z\",\"packageApplications\":[{\"appId\":\"m\",\"description\":\"elfk\",\"appUserModelID\":\"plcrpwjxeznoig\",\"friendlyName\":\"njwmwkpnbsazejj\",\"iconImageName\":\"kagfhsxtt\"},{\"appId\":\"xnfaazpxdtnk\",\"description\":\"kqjjlwuenvrkp\",\"appUserModelID\":\"uaibrebqaaysj\",\"friendlyName\":\"xqtnq\",\"iconImageName\":\"ezl\"},{\"appId\":\"iakp\",\"description\":\"qqmtedltmmji\",\"appUserModelID\":\"eozphv\",\"friendlyName\":\"uyqncygupkvipmd\",\"iconImageName\":\"wx\"}]},\"id\":\"vzhfstotxhoj\",\"name\":\"jbypel\",\"type\":\"c\"}") + .toObject(MsixPackageInner.class); + Assertions.assertEquals("vyhgs", model.imagePath()); + Assertions.assertEquals("byrqufeg", model.packageName()); + Assertions.assertEquals("vwz", model.packageFamilyName()); + Assertions.assertEquals("nhlmctlpdng", model.displayName()); + Assertions.assertEquals("vgbmhr", model.packageRelativePath()); Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("ufhyaomtbgh", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("vgrvkffo", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("zh", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("gaojf", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T10:30:40Z"), model.lastUpdated()); - Assertions.assertEquals("mrfhirctymox", model.packageApplications().get(0).appId()); - Assertions.assertEquals("tpipiwyczuhx", model.packageApplications().get(0).description()); - Assertions.assertEquals("pqjlihhyusps", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("sdvlmfwdgzxulucv", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("mrsreuzvxurisjnh", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals(true, model.isActive()); + Assertions.assertEquals("ejvegrhbpnaixex", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("b", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("eaxhcexdrrvqahqk", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("glikkxwslolb", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T04:06:51Z"), model.lastUpdated()); + Assertions.assertEquals("m", model.packageApplications().get(0).appId()); + Assertions.assertEquals("elfk", model.packageApplications().get(0).description()); + Assertions.assertEquals("plcrpwjxeznoig", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("njwmwkpnbsazejj", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("kagfhsxtt", model.packageApplications().get(0).iconImageName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackageInner model = - new MsixPackageInner() - .withImagePath("swdvzyybycnun") - .withPackageName("srtkfa") - .withPackageFamilyName("opqgikyzirtxdyux") - .withDisplayName("jntpsewgioilqu") - .withPackageRelativePath("ydxtqm") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("ufhyaomtbgh") - .withPublisher("vgrvkffo") - .withMinVersion("zh"), - new MsixPackageDependencies() - .withDependencyName("bibgjmfxumv") - .withPublisher("luyovwxnbkfezzx") - .withMinVersion("yhwzdgiruj"), - new MsixPackageDependencies() - .withDependencyName("bomvzzbtdcqv") - .withPublisher("iyujviylwdshfs") - .withMinVersion("rbgyefry"))) - .withVersion("gaojf") - .withLastUpdated(OffsetDateTime.parse("2021-04-10T10:30:40Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("mrfhirctymox") - .withDescription("tpipiwyczuhx") - .withAppUserModelId("pqjlihhyusps") - .withFriendlyName("sdvlmfwdgzxulucv") - .withIconImageName("mrsreuzvxurisjnh"), - new MsixPackageApplications() - .withAppId("ifqjz") - .withDescription("mrhublwpc") - .withAppUserModelId("utr") - .withFriendlyName("upauut") - .withIconImageName("oqh"))); + MsixPackageInner model = new MsixPackageInner().withImagePath("vyhgs") + .withPackageName("byrqufeg") + .withPackageFamilyName("vwz") + .withDisplayName("nhlmctlpdng") + .withPackageRelativePath("vgbmhr") + .withIsRegularRegistration(false) + .withIsActive(true) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("ejvegrhbpnaixex") + .withPublisher("b") + .withMinVersion("eaxhcexdrrvqahqk"), + new MsixPackageDependencies().withDependencyName("tpwijnh") + .withPublisher("svfycxzbfv") + .withMinVersion("wvrvmtg"), + new MsixPackageDependencies().withDependencyName("ppyostronzmyhgf") + .withPublisher("nsxkmcwaekrrjr") + .withMinVersion("fxtsgum"))) + .withVersion("glikkxwslolb") + .withLastUpdated(OffsetDateTime.parse("2021-11-05T04:06:51Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("m") + .withDescription("elfk") + .withAppUserModelId("plcrpwjxeznoig") + .withFriendlyName("njwmwkpnbsazejj") + .withIconImageName("kagfhsxtt"), + new MsixPackageApplications().withAppId("xnfaazpxdtnk") + .withDescription("kqjjlwuenvrkp") + .withAppUserModelId("uaibrebqaaysj") + .withFriendlyName("xqtnq") + .withIconImageName("ezl"), + new MsixPackageApplications().withAppId("iakp") + .withDescription("qqmtedltmmji") + .withAppUserModelId("eozphv") + .withFriendlyName("uyqncygupkvipmd") + .withIconImageName("wx"))); model = BinaryData.fromObject(model).toObject(MsixPackageInner.class); - Assertions.assertEquals("swdvzyybycnun", model.imagePath()); - Assertions.assertEquals("srtkfa", model.packageName()); - Assertions.assertEquals("opqgikyzirtxdyux", model.packageFamilyName()); - Assertions.assertEquals("jntpsewgioilqu", model.displayName()); - Assertions.assertEquals("ydxtqm", model.packageRelativePath()); + Assertions.assertEquals("vyhgs", model.imagePath()); + Assertions.assertEquals("byrqufeg", model.packageName()); + Assertions.assertEquals("vwz", model.packageFamilyName()); + Assertions.assertEquals("nhlmctlpdng", model.displayName()); + Assertions.assertEquals("vgbmhr", model.packageRelativePath()); Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals("ufhyaomtbgh", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("vgrvkffo", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("zh", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("gaojf", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T10:30:40Z"), model.lastUpdated()); - Assertions.assertEquals("mrfhirctymox", model.packageApplications().get(0).appId()); - Assertions.assertEquals("tpipiwyczuhx", model.packageApplications().get(0).description()); - Assertions.assertEquals("pqjlihhyusps", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("sdvlmfwdgzxulucv", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("mrsreuzvxurisjnh", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals(true, model.isActive()); + Assertions.assertEquals("ejvegrhbpnaixex", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("b", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("eaxhcexdrrvqahqk", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("glikkxwslolb", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T04:06:51Z"), model.lastUpdated()); + Assertions.assertEquals("m", model.packageApplications().get(0).appId()); + Assertions.assertEquals("elfk", model.packageApplications().get(0).description()); + Assertions.assertEquals("plcrpwjxeznoig", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("njwmwkpnbsazejj", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("kagfhsxtt", model.packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java index 06dc1945824a..dbda88dbda1d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackageListTests.java @@ -16,158 +16,182 @@ public final class MsixPackageListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackageList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"imagePath\":\"tiewdj\",\"packageName\":\"bquwrbehw\",\"packageFamilyName\":\"o\",\"displayName\":\"uffkmrqemvvh\",\"packageRelativePath\":\"tdrjfutacoebj\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"m\",\"publisher\":\"pmguaadraufac\",\"minVersion\":\"ahzovajjziuxxp\"},{\"dependencyName\":\"neekulfg\",\"publisher\":\"qubkw\",\"minVersion\":\"enr\"}],\"version\":\"utujba\",\"lastUpdated\":\"2021-06-27T02:39:57Z\",\"packageApplications\":[{\"appId\":\"minyflnorwm\",\"description\":\"vwpklvxwmygdxp\",\"appUserModelID\":\"qchiszep\",\"friendlyName\":\"bjcrxgibbdaxco\",\"iconImageName\":\"ozauorsukokwb\"}]},\"id\":\"hlvnuuepzlr\",\"name\":\"hw\",\"type\":\"soldweyuqdunv\"},{\"properties\":{\"imagePath\":\"rwrbi\",\"packageName\":\"ktalywjhhgdnhxms\",\"packageFamilyName\":\"fomiloxgg\",\"displayName\":\"fi\",\"packageRelativePath\":\"dieuzaofj\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"fgdo\",\"publisher\":\"ubiipuipwoqonma\",\"minVersion\":\"ekni\"}],\"version\":\"hqvcimpevfgmblr\",\"lastUpdated\":\"2021-02-01T14:17Z\",\"packageApplications\":[{\"appId\":\"dxsm\",\"description\":\"cwrwfs\",\"appUserModelID\":\"fnynszqujizdvoqy\",\"friendlyName\":\"byowbblgyavutp\",\"iconImageName\":\"joxoism\"},{\"appId\":\"pi\",\"description\":\"qolj\",\"appUserModelID\":\"cgxxlxs\",\"friendlyName\":\"gcvizqzdwlvwlyou\",\"iconImageName\":\"gfbkjubdyh\"}]},\"id\":\"minsgowzf\",\"name\":\"tsttktlahbq\",\"type\":\"ctxtgzukxi\"},{\"properties\":{\"imagePath\":\"qtgqqqxhrnxr\",\"packageName\":\"pjui\",\"packageFamilyName\":\"vokqdzfv\",\"displayName\":\"ivjlfrqttbajlka\",\"packageRelativePath\":\"wxyiopidkqq\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"dmligovibrxk\",\"publisher\":\"loazuruocbgoo\",\"minVersion\":\"te\"},{\"dependencyName\":\"bfhjxakvvjgsl\",\"publisher\":\"dilmyww\",\"minVersion\":\"gkxnyedabg\"}],\"version\":\"udtjuewbc\",\"lastUpdated\":\"2021-05-21T16:55:19Z\",\"packageApplications\":[{\"appId\":\"hcjyxc\",\"description\":\"bvpa\",\"appUserModelID\":\"kkudzp\",\"friendlyName\":\"wjplma\",\"iconImageName\":\"tcyohpfkyrk\"},{\"appId\":\"iogsjkmnwq\",\"description\":\"obaiyhddviaceg\",\"appUserModelID\":\"m\",\"friendlyName\":\"fpmvmemfnczd\",\"iconImageName\":\"vbalxlllc\"},{\"appId\":\"bzevwrd\",\"description\":\"fukuvsjcswsmystu\",\"appUserModelID\":\"qypfcv\",\"friendlyName\":\"rchpqbmfpjbabwid\",\"iconImageName\":\"xsspuunnoxyhk\"}]},\"id\":\"ddrihpf\",\"name\":\"oqcaaewdaomdj\",\"type\":\"l\"}],\"nextLink\":\"x\"}") - .toObject(MsixPackageList.class); - Assertions.assertEquals("tiewdj", model.value().get(0).imagePath()); - Assertions.assertEquals("bquwrbehw", model.value().get(0).packageName()); - Assertions.assertEquals("o", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("uffkmrqemvvh", model.value().get(0).displayName()); - Assertions.assertEquals("tdrjfutacoebj", model.value().get(0).packageRelativePath()); + MsixPackageList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"imagePath\":\"p\",\"packageName\":\"qhih\",\"packageFamilyName\":\"qg\",\"displayName\":\"pnfqntcyp\",\"packageRelativePath\":\"jv\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ircizjxvy\",\"publisher\":\"ceacvlhvygdy\",\"minVersion\":\"umrtwnawjsl\"},{\"dependencyName\":\"wkojgcyztsfmzn\",\"publisher\":\"eqphchqnrnr\",\"minVersion\":\"ehuwrykqgaifmvik\"}],\"version\":\"ydv\",\"lastUpdated\":\"2021-08-31T10:25:05Z\",\"packageApplications\":[{\"appId\":\"znxcvds\",\"description\":\"njivolvtnovq\",\"appUserModelID\":\"gemjdftuljltdu\",\"friendlyName\":\"amtmcz\",\"iconImageName\":\"m\"}]},\"id\":\"w\",\"name\":\"qioknssxmojm\",\"type\":\"vpkjpr\"},{\"properties\":{\"imagePath\":\"wcfzqljyxgt\",\"packageName\":\"heyd\",\"packageFamilyName\":\"dshmkxmaehvbbx\",\"displayName\":\"iplt\",\"packageRelativePath\":\"htba\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"kpyklyhp\",\"publisher\":\"odpvruudlgzib\",\"minVersion\":\"ostgkts\"}],\"version\":\"dxeclzedqbcvh\",\"lastUpdated\":\"2021-11-03T22:17:41Z\",\"packageApplications\":[{\"appId\":\"dqkdlwwqfbu\",\"description\":\"kxtrq\",\"appUserModelID\":\"smlmbtxhwgfwsrta\",\"friendlyName\":\"oezbrhubsk\",\"iconImageName\":\"dyg\"},{\"appId\":\"kqfqjbvl\",\"description\":\"rfmluiqtq\",\"appUserModelID\":\"avyvnqqyba\",\"friendlyName\":\"euayjkqabqgzsles\",\"iconImageName\":\"bhernntiew\"},{\"appId\":\"bquwrbehw\",\"description\":\"o\",\"appUserModelID\":\"uffkmrqemvvh\",\"friendlyName\":\"tdrjfutacoebj\",\"iconImageName\":\"wzcjznmwcpmgua\"},{\"appId\":\"ufactk\",\"description\":\"zov\",\"appUserModelID\":\"j\",\"friendlyName\":\"uxxpshne\",\"iconImageName\":\"ulfgslqu\"}]},\"id\":\"lenrd\",\"name\":\"utujba\",\"type\":\"pjuohminyfl\"},{\"properties\":{\"imagePath\":\"rwm\",\"packageName\":\"vwpklvxwmygdxp\",\"packageFamilyName\":\"qchiszep\",\"displayName\":\"bjcrxgibbdaxco\",\"packageRelativePath\":\"ozauorsukokwb\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"uepzl\",\"publisher\":\"hw\",\"minVersion\":\"oldweyuqdu\"},{\"dependencyName\":\"mnnrwr\",\"publisher\":\"ork\",\"minVersion\":\"lywjhh\"},{\"dependencyName\":\"nhxmsi\",\"publisher\":\"omi\",\"minVersion\":\"xggdufi\"}],\"version\":\"dieuzaofj\",\"lastUpdated\":\"2021-08-18T10:11:41Z\",\"packageApplications\":[{\"appId\":\"ys\",\"description\":\"dotcubiipuip\",\"appUserModelID\":\"qonmacj\",\"friendlyName\":\"nizshqvcim\",\"iconImageName\":\"vfgmblrrilby\"},{\"appId\":\"miccwrwfscjfnyn\",\"description\":\"qujizdvo\",\"appUserModelID\":\"tiby\",\"friendlyName\":\"bblgyavut\",\"iconImageName\":\"hjoxo\"},{\"appId\":\"ksbpimlqoljx\",\"description\":\"gxxlxsffgcvizq\",\"appUserModelID\":\"wlvwlyoupf\",\"friendlyName\":\"bkjubdyhgkfmins\",\"iconImageName\":\"wzf\"},{\"appId\":\"t\",\"description\":\"lahb\",\"appUserModelID\":\"ctxtgzukxi\",\"friendlyName\":\"m\",\"iconImageName\":\"gqqqxh\"}]},\"id\":\"xcpjuisavokqdzf\",\"name\":\"azivjlfrqttbajl\",\"type\":\"atnwxyiopi\"},{\"properties\":{\"imagePath\":\"qqfkuv\",\"packageName\":\"xkdmligo\",\"packageFamilyName\":\"brxk\",\"displayName\":\"loazuruocbgoo\",\"packageRelativePath\":\"te\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"kvvjgslordilmyww\",\"publisher\":\"gkxnyedabg\",\"minVersion\":\"udtjuewbc\"},{\"dependencyName\":\"xuuwhcj\",\"publisher\":\"ccybvp\",\"minVersion\":\"akkud\"},{\"dependencyName\":\"xgwjplmagstcyoh\",\"publisher\":\"kyrk\",\"minVersion\":\"dg\"}],\"version\":\"gsj\",\"lastUpdated\":\"2021-04-30T17:49:14Z\",\"packageApplications\":[{\"appId\":\"nobaiyhddviacegf\",\"description\":\"ntfpmvmemfnc\",\"appUserModelID\":\"wvvb\",\"friendlyName\":\"xlllchp\",\"iconImageName\":\"bzevwrd\"},{\"appId\":\"kuvsjcswsm\",\"description\":\"tuluq\",\"appUserModelID\":\"fcvlerch\",\"friendlyName\":\"bm\",\"iconImageName\":\"jbabwidf\"},{\"appId\":\"puunnoxyhkxgqd\",\"description\":\"i\",\"appUserModelID\":\"fhoqca\",\"friendlyName\":\"wdaomdjvlpjxxkzb\",\"iconImageName\":\"sgeivsiy\"},{\"appId\":\"ncj\",\"description\":\"onbzoggculapzwy\",\"appUserModelID\":\"gogtqxepnylbf\",\"friendlyName\":\"jlyjtlvofq\",\"iconImageName\":\"vfcibyfmowux\"}]},\"id\":\"vdwxfzwi\",\"name\":\"vwzjbhyz\",\"type\":\"xjrk\"}],\"nextLink\":\"btrnegvm\"}") + .toObject(MsixPackageList.class); + Assertions.assertEquals("p", model.value().get(0).imagePath()); + Assertions.assertEquals("qhih", model.value().get(0).packageName()); + Assertions.assertEquals("qg", model.value().get(0).packageFamilyName()); + Assertions.assertEquals("pnfqntcyp", model.value().get(0).displayName()); + Assertions.assertEquals("jv", model.value().get(0).packageRelativePath()); Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); - Assertions.assertEquals(true, model.value().get(0).isActive()); - Assertions.assertEquals("m", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("pmguaadraufac", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("ahzovajjziuxxp", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("utujba", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T02:39:57Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("minyflnorwm", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("vwpklvxwmygdxp", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("qchiszep", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("bjcrxgibbdaxco", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("ozauorsukokwb", model.value().get(0).packageApplications().get(0).iconImageName()); + Assertions.assertEquals(false, model.value().get(0).isActive()); + Assertions.assertEquals("ircizjxvy", model.value().get(0).packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("ceacvlhvygdy", model.value().get(0).packageDependencies().get(0).publisher()); + Assertions.assertEquals("umrtwnawjsl", model.value().get(0).packageDependencies().get(0).minVersion()); + Assertions.assertEquals("ydv", model.value().get(0).version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T10:25:05Z"), model.value().get(0).lastUpdated()); + Assertions.assertEquals("znxcvds", model.value().get(0).packageApplications().get(0).appId()); + Assertions.assertEquals("njivolvtnovq", model.value().get(0).packageApplications().get(0).description()); + Assertions.assertEquals("gemjdftuljltdu", model.value().get(0).packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("amtmcz", model.value().get(0).packageApplications().get(0).friendlyName()); + Assertions.assertEquals("m", model.value().get(0).packageApplications().get(0).iconImageName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackageList model = - new MsixPackageList() - .withValue( - Arrays - .asList( - new MsixPackageInner() - .withImagePath("tiewdj") - .withPackageName("bquwrbehw") - .withPackageFamilyName("o") - .withDisplayName("uffkmrqemvvh") - .withPackageRelativePath("tdrjfutacoebj") - .withIsRegularRegistration(true) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("m") - .withPublisher("pmguaadraufac") - .withMinVersion("ahzovajjziuxxp"), - new MsixPackageDependencies() - .withDependencyName("neekulfg") - .withPublisher("qubkw") - .withMinVersion("enr"))) - .withVersion("utujba") - .withLastUpdated(OffsetDateTime.parse("2021-06-27T02:39:57Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("minyflnorwm") - .withDescription("vwpklvxwmygdxp") - .withAppUserModelId("qchiszep") - .withFriendlyName("bjcrxgibbdaxco") - .withIconImageName("ozauorsukokwb"))), - new MsixPackageInner() - .withImagePath("rwrbi") - .withPackageName("ktalywjhhgdnhxms") - .withPackageFamilyName("fomiloxgg") - .withDisplayName("fi") - .withPackageRelativePath("dieuzaofj") - .withIsRegularRegistration(false) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("fgdo") - .withPublisher("ubiipuipwoqonma") - .withMinVersion("ekni"))) - .withVersion("hqvcimpevfgmblr") - .withLastUpdated(OffsetDateTime.parse("2021-02-01T14:17Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("dxsm") - .withDescription("cwrwfs") - .withAppUserModelId("fnynszqujizdvoqy") - .withFriendlyName("byowbblgyavutp") - .withIconImageName("joxoism"), - new MsixPackageApplications() - .withAppId("pi") - .withDescription("qolj") - .withAppUserModelId("cgxxlxs") - .withFriendlyName("gcvizqzdwlvwlyou") - .withIconImageName("gfbkjubdyh"))), - new MsixPackageInner() - .withImagePath("qtgqqqxhrnxr") - .withPackageName("pjui") - .withPackageFamilyName("vokqdzfv") - .withDisplayName("ivjlfrqttbajlka") - .withPackageRelativePath("wxyiopidkqq") - .withIsRegularRegistration(true) - .withIsActive(false) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("dmligovibrxk") - .withPublisher("loazuruocbgoo") - .withMinVersion("te"), - new MsixPackageDependencies() - .withDependencyName("bfhjxakvvjgsl") - .withPublisher("dilmyww") - .withMinVersion("gkxnyedabg"))) - .withVersion("udtjuewbc") - .withLastUpdated(OffsetDateTime.parse("2021-05-21T16:55:19Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("hcjyxc") - .withDescription("bvpa") - .withAppUserModelId("kkudzp") - .withFriendlyName("wjplma") - .withIconImageName("tcyohpfkyrk"), - new MsixPackageApplications() - .withAppId("iogsjkmnwq") - .withDescription("obaiyhddviaceg") - .withAppUserModelId("m") - .withFriendlyName("fpmvmemfnczd") - .withIconImageName("vbalxlllc"), - new MsixPackageApplications() - .withAppId("bzevwrd") - .withDescription("fukuvsjcswsmystu") - .withAppUserModelId("qypfcv") - .withFriendlyName("rchpqbmfpjbabwid") - .withIconImageName("xsspuunnoxyhk"))))); + MsixPackageList model = new MsixPackageList().withValue(Arrays.asList( + new MsixPackageInner().withImagePath("p") + .withPackageName("qhih") + .withPackageFamilyName("qg") + .withDisplayName("pnfqntcyp") + .withPackageRelativePath("jv") + .withIsRegularRegistration(true) + .withIsActive(false) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("ircizjxvy") + .withPublisher("ceacvlhvygdy") + .withMinVersion("umrtwnawjsl"), + new MsixPackageDependencies().withDependencyName("wkojgcyztsfmzn") + .withPublisher("eqphchqnrnr") + .withMinVersion("ehuwrykqgaifmvik"))) + .withVersion("ydv") + .withLastUpdated(OffsetDateTime.parse("2021-08-31T10:25:05Z")) + .withPackageApplications(Arrays.asList(new MsixPackageApplications().withAppId("znxcvds") + .withDescription("njivolvtnovq") + .withAppUserModelId("gemjdftuljltdu") + .withFriendlyName("amtmcz") + .withIconImageName("m"))), + new MsixPackageInner().withImagePath("wcfzqljyxgt") + .withPackageName("heyd") + .withPackageFamilyName("dshmkxmaehvbbx") + .withDisplayName("iplt") + .withPackageRelativePath("htba") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies(Arrays.asList(new MsixPackageDependencies().withDependencyName("kpyklyhp") + .withPublisher("odpvruudlgzib") + .withMinVersion("ostgkts"))) + .withVersion("dxeclzedqbcvh") + .withLastUpdated(OffsetDateTime.parse("2021-11-03T22:17:41Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("dqkdlwwqfbu") + .withDescription("kxtrq") + .withAppUserModelId("smlmbtxhwgfwsrta") + .withFriendlyName("oezbrhubsk") + .withIconImageName("dyg"), + new MsixPackageApplications().withAppId("kqfqjbvl") + .withDescription("rfmluiqtq") + .withAppUserModelId("avyvnqqyba") + .withFriendlyName("euayjkqabqgzsles") + .withIconImageName("bhernntiew"), + new MsixPackageApplications().withAppId("bquwrbehw") + .withDescription("o") + .withAppUserModelId("uffkmrqemvvh") + .withFriendlyName("tdrjfutacoebj") + .withIconImageName("wzcjznmwcpmgua"), + new MsixPackageApplications().withAppId("ufactk") + .withDescription("zov") + .withAppUserModelId("j") + .withFriendlyName("uxxpshne") + .withIconImageName("ulfgslqu"))), + new MsixPackageInner().withImagePath("rwm") + .withPackageName("vwpklvxwmygdxp") + .withPackageFamilyName("qchiszep") + .withDisplayName("bjcrxgibbdaxco") + .withPackageRelativePath("ozauorsukokwb") + .withIsRegularRegistration(false) + .withIsActive(true) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("uepzl") + .withPublisher("hw") + .withMinVersion("oldweyuqdu"), + new MsixPackageDependencies().withDependencyName("mnnrwr") + .withPublisher("ork") + .withMinVersion("lywjhh"), + new MsixPackageDependencies().withDependencyName("nhxmsi") + .withPublisher("omi") + .withMinVersion("xggdufi"))) + .withVersion("dieuzaofj") + .withLastUpdated(OffsetDateTime.parse("2021-08-18T10:11:41Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("ys") + .withDescription("dotcubiipuip") + .withAppUserModelId("qonmacj") + .withFriendlyName("nizshqvcim") + .withIconImageName("vfgmblrrilby"), + new MsixPackageApplications().withAppId("miccwrwfscjfnyn") + .withDescription("qujizdvo") + .withAppUserModelId("tiby") + .withFriendlyName("bblgyavut") + .withIconImageName("hjoxo"), + new MsixPackageApplications().withAppId("ksbpimlqoljx") + .withDescription("gxxlxsffgcvizq") + .withAppUserModelId("wlvwlyoupf") + .withFriendlyName("bkjubdyhgkfmins") + .withIconImageName("wzf"), + new MsixPackageApplications().withAppId("t") + .withDescription("lahb") + .withAppUserModelId("ctxtgzukxi") + .withFriendlyName("m") + .withIconImageName("gqqqxh"))), + new MsixPackageInner().withImagePath("qqfkuv") + .withPackageName("xkdmligo") + .withPackageFamilyName("brxk") + .withDisplayName("loazuruocbgoo") + .withPackageRelativePath("te") + .withIsRegularRegistration(true) + .withIsActive(false) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("kvvjgslordilmyww") + .withPublisher("gkxnyedabg") + .withMinVersion("udtjuewbc"), + new MsixPackageDependencies().withDependencyName("xuuwhcj") + .withPublisher("ccybvp") + .withMinVersion("akkud"), + new MsixPackageDependencies().withDependencyName("xgwjplmagstcyoh") + .withPublisher("kyrk") + .withMinVersion("dg"))) + .withVersion("gsj") + .withLastUpdated(OffsetDateTime.parse("2021-04-30T17:49:14Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("nobaiyhddviacegf") + .withDescription("ntfpmvmemfnc") + .withAppUserModelId("wvvb") + .withFriendlyName("xlllchp") + .withIconImageName("bzevwrd"), + new MsixPackageApplications().withAppId("kuvsjcswsm") + .withDescription("tuluq") + .withAppUserModelId("fcvlerch") + .withFriendlyName("bm") + .withIconImageName("jbabwidf"), + new MsixPackageApplications().withAppId("puunnoxyhkxgqd") + .withDescription("i") + .withAppUserModelId("fhoqca") + .withFriendlyName("wdaomdjvlpjxxkzb") + .withIconImageName("sgeivsiy"), + new MsixPackageApplications().withAppId("ncj") + .withDescription("onbzoggculapzwy") + .withAppUserModelId("gogtqxepnylbf") + .withFriendlyName("jlyjtlvofq") + .withIconImageName("vfcibyfmowux"))))); model = BinaryData.fromObject(model).toObject(MsixPackageList.class); - Assertions.assertEquals("tiewdj", model.value().get(0).imagePath()); - Assertions.assertEquals("bquwrbehw", model.value().get(0).packageName()); - Assertions.assertEquals("o", model.value().get(0).packageFamilyName()); - Assertions.assertEquals("uffkmrqemvvh", model.value().get(0).displayName()); - Assertions.assertEquals("tdrjfutacoebj", model.value().get(0).packageRelativePath()); + Assertions.assertEquals("p", model.value().get(0).imagePath()); + Assertions.assertEquals("qhih", model.value().get(0).packageName()); + Assertions.assertEquals("qg", model.value().get(0).packageFamilyName()); + Assertions.assertEquals("pnfqntcyp", model.value().get(0).displayName()); + Assertions.assertEquals("jv", model.value().get(0).packageRelativePath()); Assertions.assertEquals(true, model.value().get(0).isRegularRegistration()); - Assertions.assertEquals(true, model.value().get(0).isActive()); - Assertions.assertEquals("m", model.value().get(0).packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("pmguaadraufac", model.value().get(0).packageDependencies().get(0).publisher()); - Assertions.assertEquals("ahzovajjziuxxp", model.value().get(0).packageDependencies().get(0).minVersion()); - Assertions.assertEquals("utujba", model.value().get(0).version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T02:39:57Z"), model.value().get(0).lastUpdated()); - Assertions.assertEquals("minyflnorwm", model.value().get(0).packageApplications().get(0).appId()); - Assertions.assertEquals("vwpklvxwmygdxp", model.value().get(0).packageApplications().get(0).description()); - Assertions.assertEquals("qchiszep", model.value().get(0).packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("bjcrxgibbdaxco", model.value().get(0).packageApplications().get(0).friendlyName()); - Assertions.assertEquals("ozauorsukokwb", model.value().get(0).packageApplications().get(0).iconImageName()); + Assertions.assertEquals(false, model.value().get(0).isActive()); + Assertions.assertEquals("ircizjxvy", model.value().get(0).packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("ceacvlhvygdy", model.value().get(0).packageDependencies().get(0).publisher()); + Assertions.assertEquals("umrtwnawjsl", model.value().get(0).packageDependencies().get(0).minVersion()); + Assertions.assertEquals("ydv", model.value().get(0).version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T10:25:05Z"), model.value().get(0).lastUpdated()); + Assertions.assertEquals("znxcvds", model.value().get(0).packageApplications().get(0).appId()); + Assertions.assertEquals("njivolvtnovq", model.value().get(0).packageApplications().get(0).description()); + Assertions.assertEquals("gemjdftuljltdu", model.value().get(0).packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("amtmcz", model.value().get(0).packageApplications().get(0).friendlyName()); + Assertions.assertEquals("m", model.value().get(0).packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java index 7d4970753b26..0ec9670c1438 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchPropertiesTests.java @@ -11,25 +11,22 @@ public final class MsixPackagePatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackagePatchProperties model = - BinaryData - .fromString("{\"isActive\":false,\"isRegularRegistration\":false,\"displayName\":\"yjkqabqgzslesjcb\"}") + MsixPackagePatchProperties model + = BinaryData.fromString("{\"isActive\":false,\"isRegularRegistration\":true,\"displayName\":\"sutrgjup\"}") .toObject(MsixPackagePatchProperties.class); Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals("yjkqabqgzslesjcb", model.displayName()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals("sutrgjup", model.displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackagePatchProperties model = - new MsixPackagePatchProperties() - .withIsActive(false) - .withIsRegularRegistration(false) - .withDisplayName("yjkqabqgzslesjcb"); + MsixPackagePatchProperties model = new MsixPackagePatchProperties().withIsActive(false) + .withIsRegularRegistration(true) + .withDisplayName("sutrgjup"); model = BinaryData.fromObject(model).toObject(MsixPackagePatchProperties.class); Assertions.assertEquals(false, model.isActive()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals("yjkqabqgzslesjcb", model.displayName()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals("sutrgjup", model.displayName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java index 778ed043741c..95f5314229cf 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePatchTests.java @@ -11,23 +11,22 @@ public final class MsixPackagePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackagePatch model = - BinaryData - .fromString( - "{\"properties\":{\"isActive\":false,\"isRegularRegistration\":true,\"displayName\":\"kqfqjbvl\"},\"id\":\"orfmluiqt\",\"name\":\"zf\",\"type\":\"vyvnqqyb\"}") - .toObject(MsixPackagePatch.class); + MsixPackagePatch model = BinaryData.fromString( + "{\"properties\":{\"isActive\":false,\"isRegularRegistration\":true,\"displayName\":\"dgzxulucvpamrsr\"},\"id\":\"zvxurisjnhny\",\"name\":\"xifqjzgxm\",\"type\":\"hu\"}") + .toObject(MsixPackagePatch.class); Assertions.assertEquals(false, model.isActive()); Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals("kqfqjbvl", model.displayName()); + Assertions.assertEquals("dgzxulucvpamrsr", model.displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackagePatch model = - new MsixPackagePatch().withIsActive(false).withIsRegularRegistration(true).withDisplayName("kqfqjbvl"); + MsixPackagePatch model = new MsixPackagePatch().withIsActive(false) + .withIsRegularRegistration(true) + .withDisplayName("dgzxulucvpamrsr"); model = BinaryData.fromObject(model).toObject(MsixPackagePatch.class); Assertions.assertEquals(false, model.isActive()); Assertions.assertEquals(true, model.isRegularRegistration()); - Assertions.assertEquals("kqfqjbvl", model.displayName()); + Assertions.assertEquals("dgzxulucvpamrsr", model.displayName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java index c0e5cf0edd28..5708fa2c9bcf 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagePropertiesTests.java @@ -15,80 +15,84 @@ public final class MsixPackagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MsixPackageProperties model = - BinaryData - .fromString( - "{\"imagePath\":\"cizjxvydfceacvl\",\"packageName\":\"ygdyftumrtw\",\"packageFamilyName\":\"wjslbiwkojgcyzt\",\"displayName\":\"mznbaeqphch\",\"packageRelativePath\":\"rn\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"ykqgaifmvik\",\"publisher\":\"ydv\",\"minVersion\":\"bejdznxcv\"},{\"dependencyName\":\"rhnj\",\"publisher\":\"olvtnovqfzge\",\"minVersion\":\"dftuljltduce\"}],\"version\":\"tmczuomejwcwwqi\",\"lastUpdated\":\"2021-07-23T13:28:16Z\",\"packageApplications\":[{\"appId\":\"mojmsvpkjprvkw\",\"description\":\"zqljyxgtczh\",\"appUserModelID\":\"dbsdshm\",\"friendlyName\":\"maehvbbxurip\",\"iconImageName\":\"fnhtbaxkgxyw\"}]}") - .toObject(MsixPackageProperties.class); - Assertions.assertEquals("cizjxvydfceacvl", model.imagePath()); - Assertions.assertEquals("ygdyftumrtw", model.packageName()); - Assertions.assertEquals("wjslbiwkojgcyzt", model.packageFamilyName()); - Assertions.assertEquals("mznbaeqphch", model.displayName()); - Assertions.assertEquals("rn", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("ykqgaifmvik", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("ydv", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("bejdznxcv", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("tmczuomejwcwwqi", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T13:28:16Z"), model.lastUpdated()); - Assertions.assertEquals("mojmsvpkjprvkw", model.packageApplications().get(0).appId()); - Assertions.assertEquals("zqljyxgtczh", model.packageApplications().get(0).description()); - Assertions.assertEquals("dbsdshm", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("maehvbbxurip", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("fnhtbaxkgxyw", model.packageApplications().get(0).iconImageName()); + MsixPackageProperties model = BinaryData.fromString( + "{\"imagePath\":\"hixbjxyfwnyl\",\"packageName\":\"ool\",\"packageFamilyName\":\"tpkiwkkbnujry\",\"displayName\":\"tylbfpncurdoiw\",\"packageRelativePath\":\"thtywub\",\"isRegularRegistration\":true,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"nfdn\",\"publisher\":\"jchrdgoihxumw\",\"minVersion\":\"ond\"},{\"dependencyName\":\"luudfdlwggytsb\",\"publisher\":\"ovvtgseinqfiu\",\"minVersion\":\"qknp\"}],\"version\":\"gnepttwqmsni\",\"lastUpdated\":\"2021-04-12T20:00:21Z\",\"packageApplications\":[{\"appId\":\"nrojlpijnkr\",\"description\":\"rddh\",\"appUserModelID\":\"atiz\",\"friendlyName\":\"onasxifto\",\"iconImageName\":\"yzhftwesgogczh\"},{\"appId\":\"krlgnyhm\",\"description\":\"sxkkg\",\"appUserModelID\":\"rrghxjbdhqxvcxgf\",\"friendlyName\":\"dsofbshrns\",\"iconImageName\":\"uswdv\"},{\"appId\":\"ycnunvjsrtk\",\"description\":\"wnopqgikyzirtx\",\"appUserModelID\":\"uxzejntpsew\",\"friendlyName\":\"oi\",\"iconImageName\":\"ukry\"},{\"appId\":\"mieoxorgguf\",\"description\":\"aomtbghhavgrvkff\",\"appUserModelID\":\"jzhpjbibgjmfx\",\"friendlyName\":\"vfcluyovwxnbkfe\",\"iconImageName\":\"xscyhwzdgirujbz\"}]}") + .toObject(MsixPackageProperties.class); + Assertions.assertEquals("hixbjxyfwnyl", model.imagePath()); + Assertions.assertEquals("ool", model.packageName()); + Assertions.assertEquals("tpkiwkkbnujry", model.packageFamilyName()); + Assertions.assertEquals("tylbfpncurdoiw", model.displayName()); + Assertions.assertEquals("thtywub", model.packageRelativePath()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals(false, model.isActive()); + Assertions.assertEquals("nfdn", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("jchrdgoihxumw", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("ond", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("gnepttwqmsni", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T20:00:21Z"), model.lastUpdated()); + Assertions.assertEquals("nrojlpijnkr", model.packageApplications().get(0).appId()); + Assertions.assertEquals("rddh", model.packageApplications().get(0).description()); + Assertions.assertEquals("atiz", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("onasxifto", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("yzhftwesgogczh", model.packageApplications().get(0).iconImageName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MsixPackageProperties model = - new MsixPackageProperties() - .withImagePath("cizjxvydfceacvl") - .withPackageName("ygdyftumrtw") - .withPackageFamilyName("wjslbiwkojgcyzt") - .withDisplayName("mznbaeqphch") - .withPackageRelativePath("rn") - .withIsRegularRegistration(false) - .withIsActive(true) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("ykqgaifmvik") - .withPublisher("ydv") - .withMinVersion("bejdznxcv"), - new MsixPackageDependencies() - .withDependencyName("rhnj") - .withPublisher("olvtnovqfzge") - .withMinVersion("dftuljltduce"))) - .withVersion("tmczuomejwcwwqi") - .withLastUpdated(OffsetDateTime.parse("2021-07-23T13:28:16Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("mojmsvpkjprvkw") - .withDescription("zqljyxgtczh") - .withAppUserModelId("dbsdshm") - .withFriendlyName("maehvbbxurip") - .withIconImageName("fnhtbaxkgxyw"))); + MsixPackageProperties model = new MsixPackageProperties().withImagePath("hixbjxyfwnyl") + .withPackageName("ool") + .withPackageFamilyName("tpkiwkkbnujry") + .withDisplayName("tylbfpncurdoiw") + .withPackageRelativePath("thtywub") + .withIsRegularRegistration(true) + .withIsActive(false) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("nfdn") + .withPublisher("jchrdgoihxumw") + .withMinVersion("ond"), + new MsixPackageDependencies().withDependencyName("luudfdlwggytsb") + .withPublisher("ovvtgseinqfiu") + .withMinVersion("qknp"))) + .withVersion("gnepttwqmsni") + .withLastUpdated(OffsetDateTime.parse("2021-04-12T20:00:21Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("nrojlpijnkr") + .withDescription("rddh") + .withAppUserModelId("atiz") + .withFriendlyName("onasxifto") + .withIconImageName("yzhftwesgogczh"), + new MsixPackageApplications().withAppId("krlgnyhm") + .withDescription("sxkkg") + .withAppUserModelId("rrghxjbdhqxvcxgf") + .withFriendlyName("dsofbshrns") + .withIconImageName("uswdv"), + new MsixPackageApplications().withAppId("ycnunvjsrtk") + .withDescription("wnopqgikyzirtx") + .withAppUserModelId("uxzejntpsew") + .withFriendlyName("oi") + .withIconImageName("ukry"), + new MsixPackageApplications().withAppId("mieoxorgguf") + .withDescription("aomtbghhavgrvkff") + .withAppUserModelId("jzhpjbibgjmfx") + .withFriendlyName("vfcluyovwxnbkfe") + .withIconImageName("xscyhwzdgirujbz"))); model = BinaryData.fromObject(model).toObject(MsixPackageProperties.class); - Assertions.assertEquals("cizjxvydfceacvl", model.imagePath()); - Assertions.assertEquals("ygdyftumrtw", model.packageName()); - Assertions.assertEquals("wjslbiwkojgcyzt", model.packageFamilyName()); - Assertions.assertEquals("mznbaeqphch", model.displayName()); - Assertions.assertEquals("rn", model.packageRelativePath()); - Assertions.assertEquals(false, model.isRegularRegistration()); - Assertions.assertEquals(true, model.isActive()); - Assertions.assertEquals("ykqgaifmvik", model.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("ydv", model.packageDependencies().get(0).publisher()); - Assertions.assertEquals("bejdznxcv", model.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("tmczuomejwcwwqi", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-23T13:28:16Z"), model.lastUpdated()); - Assertions.assertEquals("mojmsvpkjprvkw", model.packageApplications().get(0).appId()); - Assertions.assertEquals("zqljyxgtczh", model.packageApplications().get(0).description()); - Assertions.assertEquals("dbsdshm", model.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("maehvbbxurip", model.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("fnhtbaxkgxyw", model.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("hixbjxyfwnyl", model.imagePath()); + Assertions.assertEquals("ool", model.packageName()); + Assertions.assertEquals("tpkiwkkbnujry", model.packageFamilyName()); + Assertions.assertEquals("tylbfpncurdoiw", model.displayName()); + Assertions.assertEquals("thtywub", model.packageRelativePath()); + Assertions.assertEquals(true, model.isRegularRegistration()); + Assertions.assertEquals(false, model.isActive()); + Assertions.assertEquals("nfdn", model.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("jchrdgoihxumw", model.packageDependencies().get(0).publisher()); + Assertions.assertEquals("ond", model.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("gnepttwqmsni", model.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T20:00:21Z"), model.lastUpdated()); + Assertions.assertEquals("nrojlpijnkr", model.packageApplications().get(0).appId()); + Assertions.assertEquals("rddh", model.packageApplications().get(0).description()); + Assertions.assertEquals("atiz", model.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("onasxifto", model.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("yzhftwesgogczh", model.packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java index 73cf6d07fd67..1c9e949a279b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesCreateOrUpdateWithResponseMockTests.java @@ -6,128 +6,81 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageApplications; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackageDependencies; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MsixPackagesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"imagePath\":\"tmvmmagoaqylkjz\",\"packageName\":\"iua\",\"packageFamilyName\":\"cgm\",\"displayName\":\"tpfinzcpdltkr\",\"packageRelativePath\":\"jmtbd\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"zhomp\",\"publisher\":\"qdurelyujlfyoum\",\"minVersion\":\"kyeclcdigpta\"}],\"version\":\"rzmq\",\"lastUpdated\":\"2021-06-01T07:57:22Z\",\"packageApplications\":[{\"appId\":\"joclxiutgjcyzy\",\"description\":\"dnrqjbtxj\",\"appUserModelID\":\"oqa\",\"friendlyName\":\"z\",\"iconImageName\":\"hfw\"}]},\"id\":\"tbwbqamteuli\",\"name\":\"slpkcvmwfauxxep\",\"type\":\"ywbo\"}"; - String responseStr = - "{\"properties\":{\"imagePath\":\"fz\",\"packageName\":\"fwxrzxmdew\",\"packageFamilyName\":\"sxkrpl\",\"displayName\":\"aze\",\"packageRelativePath\":\"w\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"hbrnnhjx\",\"publisher\":\"wjh\",\"minVersion\":\"biwetpo\"},{\"dependencyName\":\"c\",\"publisher\":\"iqyhgfse\",\"minVersion\":\"lexbsf\"}],\"version\":\"dynojpziuwfb\",\"lastUpdated\":\"2021-04-01T20:47:50Z\",\"packageApplications\":[{\"appId\":\"hqsycljselp\",\"description\":\"bafvafhlbylcc\",\"appUserModelID\":\"vxrh\",\"friendlyName\":\"d\",\"iconImageName\":\"rsofpltdbmairrh\"},{\"appId\":\"ra\",\"description\":\"npq\",\"appUserModelID\":\"tuujwouh\",\"friendlyName\":\"wsigrbjbxsj\",\"iconImageName\":\"vitvqkjyaz\"}]},\"id\":\"tggmuwdchozfnkfe\",\"name\":\"lv\",\"type\":\"noakiz\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + MsixPackage response = manager.msixPackages() + .define("pkpztrg") + .withExistingHostPool("dm", "rgjfoknubnoi") + .withImagePath("x") + .withPackageName("oqraswugyxpqi") + .withPackageFamilyName("eialwvskb") + .withDisplayName("z") + .withPackageRelativePath("aq") + .withIsRegularRegistration(false) + .withIsActive(false) + .withPackageDependencies(Arrays.asList( + new MsixPackageDependencies().withDependencyName("ujpdsxzak") + .withPublisher("jkmvbi") + .withMinVersion("jofqcvovjufycs"), + new MsixPackageDependencies().withDependencyName("lbemyej") + .withPublisher("iuxegth") + .withMinVersion("tudaw"))) + .withVersion("jfel") + .withLastUpdated(OffsetDateTime.parse("2021-04-18T11:59:41Z")) + .withPackageApplications(Arrays.asList( + new MsixPackageApplications().withAppId("bgqnz") + .withDescription("h") + .withAppUserModelId("lialwcjgckbbcccg") + .withFriendlyName("raoxnyuff") + .withIconImageName("sgftipwc"), + new MsixPackageApplications().withAppId("bh") + .withDescription("dxyurnpnuhza") + .withAppUserModelId("cnuhiigbylbuigv") + .withFriendlyName("atvcrkdlbnbq") + .withIconImageName("h"))) + .create(); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MsixPackage response = - manager - .msixPackages() - .define("hhkuuip") - .withExistingHostPool("wqapfgsdp", "vessm") - .withImagePath("qctekvalb") - .withPackageName("tjqvqyvweht") - .withPackageFamilyName("mxhzzysevus") - .withDisplayName("vzrrryveimi") - .withPackageRelativePath("kdyzatvfuzk") - .withIsRegularRegistration(false) - .withIsActive(false) - .withPackageDependencies( - Arrays - .asList( - new MsixPackageDependencies() - .withDependencyName("xwigsye") - .withPublisher("qdsmjtg") - .withMinVersion("gdgkki"))) - .withVersion("plkcsm") - .withLastUpdated(OffsetDateTime.parse("2021-05-26T00:44:03Z")) - .withPackageApplications( - Arrays - .asList( - new MsixPackageApplications() - .withAppId("baedorvvmqfl") - .withDescription("gbdg") - .withAppUserModelId("mgxdgdhpabgd") - .withFriendlyName("jddvjsaqw") - .withIconImageName("mmwllc"), - new MsixPackageApplications() - .withAppId("sxap") - .withDescription("f") - .withAppUserModelId("xcgjokjljnhvlq") - .withFriendlyName("ek") - .withIconImageName("eksnbksdqhjvyk"), - new MsixPackageApplications() - .withAppId("lkhhu") - .withDescription("cpoq") - .withAppUserModelId("vnwqjwgo") - .withFriendlyName("lejjjkxy") - .withIconImageName("fdb"), - new MsixPackageApplications() - .withAppId("tensvkzykj") - .withDescription("kns") - .withAppUserModelId("wushcdp") - .withFriendlyName("pn") - .withIconImageName("mgjfbpkuwxeoio"))) - .create(); - - Assertions.assertEquals("fz", response.imagePath()); - Assertions.assertEquals("fwxrzxmdew", response.packageName()); - Assertions.assertEquals("sxkrpl", response.packageFamilyName()); - Assertions.assertEquals("aze", response.displayName()); - Assertions.assertEquals("w", response.packageRelativePath()); + Assertions.assertEquals("tmvmmagoaqylkjz", response.imagePath()); + Assertions.assertEquals("iua", response.packageName()); + Assertions.assertEquals("cgm", response.packageFamilyName()); + Assertions.assertEquals("tpfinzcpdltkr", response.displayName()); + Assertions.assertEquals("jmtbd", response.packageRelativePath()); Assertions.assertEquals(false, response.isRegularRegistration()); Assertions.assertEquals(false, response.isActive()); - Assertions.assertEquals("hbrnnhjx", response.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("wjh", response.packageDependencies().get(0).publisher()); - Assertions.assertEquals("biwetpo", response.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("dynojpziuwfb", response.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-01T20:47:50Z"), response.lastUpdated()); - Assertions.assertEquals("hqsycljselp", response.packageApplications().get(0).appId()); - Assertions.assertEquals("bafvafhlbylcc", response.packageApplications().get(0).description()); - Assertions.assertEquals("vxrh", response.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("d", response.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("rsofpltdbmairrh", response.packageApplications().get(0).iconImageName()); + Assertions.assertEquals("zhomp", response.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("qdurelyujlfyoum", response.packageDependencies().get(0).publisher()); + Assertions.assertEquals("kyeclcdigpta", response.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("rzmq", response.version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-01T07:57:22Z"), response.lastUpdated()); + Assertions.assertEquals("joclxiutgjcyzy", response.packageApplications().get(0).appId()); + Assertions.assertEquals("dnrqjbtxj", response.packageApplications().get(0).description()); + Assertions.assertEquals("oqa", response.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("z", response.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("hfw", response.packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java index 49543a692853..aa44e2872f54 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesDeleteWithResponseMockTests.java @@ -6,56 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MsixPackagesDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.msixPackages().deleteWithResponse("rsofpltdbmairrh", "hfnrac", "npq", com.azure.core.util.Context.NONE); - manager.msixPackages().deleteWithResponse("taf", "bzf", "ovwmbjlzqsczpgvd", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java index 822722ac9e80..d9687f3e530b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesGetWithResponseMockTests.java @@ -6,81 +6,50 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MsixPackagesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"imagePath\":\"vsqxfxjelgcmpzqj\",\"packageName\":\"hqxu\",\"packageFamilyName\":\"vcacoyv\",\"displayName\":\"bsizus\",\"packageRelativePath\":\"zlbscmnlziji\",\"isRegularRegistration\":true,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"lnwyvqkxr\",\"publisher\":\"lniylylyfwxz\",\"minVersion\":\"gqztwhghmupgx\"},{\"dependencyName\":\"tcdxabbujftaben\",\"publisher\":\"klqpx\",\"minVersion\":\"cafeddw\"},{\"dependencyName\":\"lzafwxu\",\"publisher\":\"nhgookrtalvnbw\",\"minVersion\":\"bemeluclvd\"},{\"dependencyName\":\"ukyrdnqodxahh\",\"publisher\":\"qfaqnvzoqg\",\"minVersion\":\"pem\"}],\"version\":\"gavsczuejd\",\"lastUpdated\":\"2021-07-06T15:50:57Z\",\"packageApplications\":[{\"appId\":\"h\",\"description\":\"homewjjstliu\",\"appUserModelID\":\"awmo\",\"friendlyName\":\"ancz\",\"iconImageName\":\"odrrslblxyd\"},{\"appId\":\"vvbxiwkgfbqljnq\",\"description\":\"ychocokulehu\",\"appUserModelID\":\"lrqff\",\"friendlyName\":\"eyu\",\"iconImageName\":\"phyjdxravj\"},{\"appId\":\"rxmrgchbapx\",\"description\":\"y\",\"appUserModelID\":\"j\",\"friendlyName\":\"ajb\",\"iconImageName\":\"cgduusio\"}]},\"id\":\"lev\",\"name\":\"mclujyxkyxlzgs\",\"type\":\"gkzz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MsixPackage response = - manager - .msixPackages() - .getWithResponse("xpjb", "ypsjoq", "jenkyh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vsqxfxjelgcmpzqj", response.imagePath()); - Assertions.assertEquals("hqxu", response.packageName()); - Assertions.assertEquals("vcacoyv", response.packageFamilyName()); - Assertions.assertEquals("bsizus", response.displayName()); - Assertions.assertEquals("zlbscmnlziji", response.packageRelativePath()); - Assertions.assertEquals(true, response.isRegularRegistration()); - Assertions.assertEquals(true, response.isActive()); - Assertions.assertEquals("lnwyvqkxr", response.packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("lniylylyfwxz", response.packageDependencies().get(0).publisher()); - Assertions.assertEquals("gqztwhghmupgx", response.packageDependencies().get(0).minVersion()); - Assertions.assertEquals("gavsczuejd", response.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T15:50:57Z"), response.lastUpdated()); - Assertions.assertEquals("h", response.packageApplications().get(0).appId()); - Assertions.assertEquals("homewjjstliu", response.packageApplications().get(0).description()); - Assertions.assertEquals("awmo", response.packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("ancz", response.packageApplications().get(0).friendlyName()); - Assertions.assertEquals("odrrslblxyd", response.packageApplications().get(0).iconImageName()); + String responseStr + = "{\"properties\":{\"imagePath\":\"mmwllc\",\"packageName\":\"srsxaptefh\",\"packageFamilyName\":\"cgjokjljnhvlq\",\"displayName\":\"ek\",\"packageRelativePath\":\"eksnbksdqhjvyk\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"ustcpoq\",\"publisher\":\"vnwqjwgo\",\"minVersion\":\"lejjjkxy\"}],\"version\":\"fdb\",\"lastUpdated\":\"2020-12-26T15:14:09Z\",\"packageApplications\":[{\"appId\":\"nsvk\",\"description\":\"kjtjknsx\",\"appUserModelID\":\"us\",\"friendlyName\":\"dpkupnqrmgjf\",\"iconImageName\":\"kuwxeoiojfizfavk\"},{\"appId\":\"bcyaykmmfzs\",\"description\":\"wxrzxmdewsrsxkrp\",\"appUserModelID\":\"jazejwwviyoyp\",\"friendlyName\":\"hbrnnhjx\",\"iconImageName\":\"wjh\"},{\"appId\":\"wetp\",\"description\":\"ycyqiqyhgfsetzl\",\"appUserModelID\":\"bsfledynojpziu\",\"friendlyName\":\"bzkkd\",\"iconImageName\":\"hqsycljselp\"}]},\"id\":\"fvafh\",\"name\":\"by\",\"type\":\"ccbevxrhyzdf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + MsixPackage response = manager.msixPackages() + .getWithResponse("dorvvmqfloy", "bdgwumgxdgd", "pabgdexjddvjsaqw", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mmwllc", response.imagePath()); + Assertions.assertEquals("srsxaptefh", response.packageName()); + Assertions.assertEquals("cgjokjljnhvlq", response.packageFamilyName()); + Assertions.assertEquals("ek", response.displayName()); + Assertions.assertEquals("eksnbksdqhjvyk", response.packageRelativePath()); + Assertions.assertEquals(false, response.isRegularRegistration()); + Assertions.assertEquals(false, response.isActive()); + Assertions.assertEquals("ustcpoq", response.packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("vnwqjwgo", response.packageDependencies().get(0).publisher()); + Assertions.assertEquals("lejjjkxy", response.packageDependencies().get(0).minVersion()); + Assertions.assertEquals("fdb", response.version()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-26T15:14:09Z"), response.lastUpdated()); + Assertions.assertEquals("nsvk", response.packageApplications().get(0).appId()); + Assertions.assertEquals("kjtjknsx", response.packageApplications().get(0).description()); + Assertions.assertEquals("us", response.packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("dpkupnqrmgjf", response.packageApplications().get(0).friendlyName()); + Assertions.assertEquals("kuwxeoiojfizfavk", response.packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java index ba2f906f4c40..1b811aff2171 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/MsixPackagesListMockTests.java @@ -6,82 +6,52 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.MsixPackage; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MsixPackagesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"imagePath\":\"y\",\"packageName\":\"eseyqr\",\"packageFamilyName\":\"y\",\"displayName\":\"dotjvdk\",\"packageRelativePath\":\"swskuk\",\"isRegularRegistration\":false,\"isActive\":false,\"packageDependencies\":[{\"dependencyName\":\"spkxkdt\",\"publisher\":\"kndlqvtwknvg\",\"minVersion\":\"bugtywatmqa\"},{\"dependencyName\":\"ueatgroe\",\"publisher\":\"oygzcbyfqxkfao\",\"minVersion\":\"ehqpuvjmvqmt\"}],\"version\":\"ckygroejnndljdju\",\"lastUpdated\":\"2021-01-30T20:23Z\",\"packageApplications\":[{\"appId\":\"qyn\",\"description\":\"eysfaqegplw\",\"appUserModelID\":\"shwddkvbxgk\",\"friendlyName\":\"sybwptdaca\",\"iconImageName\":\"vlf\"}]},\"id\":\"mt\",\"name\":\"oiwenazerohzrsq\",\"type\":\"lsxkd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .msixPackages() - .list("napfdqwowftpt", "uwjtks", 162312753, true, 585871352, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("y", response.iterator().next().imagePath()); - Assertions.assertEquals("eseyqr", response.iterator().next().packageName()); - Assertions.assertEquals("y", response.iterator().next().packageFamilyName()); - Assertions.assertEquals("dotjvdk", response.iterator().next().displayName()); - Assertions.assertEquals("swskuk", response.iterator().next().packageRelativePath()); + String responseStr + = "{\"value\":[{\"properties\":{\"imagePath\":\"awsigrbjbxs\",\"packageName\":\"bvitvqkjya\",\"packageFamilyName\":\"umtggmuwdchozfn\",\"displayName\":\"exlvxnoakiz\",\"packageRelativePath\":\"aikn\",\"isRegularRegistration\":false,\"isActive\":true,\"packageDependencies\":[{\"dependencyName\":\"uyxlykwphvxzcw\",\"publisher\":\"mpe\",\"minVersion\":\"lkexaonwivkcqh\"},{\"dependencyName\":\"hxknlccrmmkyupi\",\"publisher\":\"byqjfkakfqfrkem\",\"minVersion\":\"ldudxjascowv\"},{\"dependencyName\":\"jkpdxphlkksnm\",\"publisher\":\"vyfijdkzuqnw\",\"minVersion\":\"thuqolyahluq\"}],\"version\":\"ulsutrjbhxy\",\"lastUpdated\":\"2021-04-27T08:11:25Z\",\"packageApplications\":[{\"appId\":\"zvqqugdrftbcvexr\",\"description\":\"quowtljvfwhrea\",\"appUserModelID\":\"hyxvrqt\",\"friendlyName\":\"czsulmdggl\",\"iconImageName\":\"pjpfseykgs\"}]},\"id\":\"szngafpgyl\",\"name\":\"vecjujcn\",\"type\":\"oady\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.msixPackages().list("g", "uuj", 655695841, false, 1503545228, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("awsigrbjbxs", response.iterator().next().imagePath()); + Assertions.assertEquals("bvitvqkjya", response.iterator().next().packageName()); + Assertions.assertEquals("umtggmuwdchozfn", response.iterator().next().packageFamilyName()); + Assertions.assertEquals("exlvxnoakiz", response.iterator().next().displayName()); + Assertions.assertEquals("aikn", response.iterator().next().packageRelativePath()); Assertions.assertEquals(false, response.iterator().next().isRegularRegistration()); - Assertions.assertEquals(false, response.iterator().next().isActive()); - Assertions.assertEquals("spkxkdt", response.iterator().next().packageDependencies().get(0).dependencyName()); - Assertions.assertEquals("kndlqvtwknvg", response.iterator().next().packageDependencies().get(0).publisher()); - Assertions.assertEquals("bugtywatmqa", response.iterator().next().packageDependencies().get(0).minVersion()); - Assertions.assertEquals("ckygroejnndljdju", response.iterator().next().version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T20:23Z"), response.iterator().next().lastUpdated()); - Assertions.assertEquals("qyn", response.iterator().next().packageApplications().get(0).appId()); - Assertions.assertEquals("eysfaqegplw", response.iterator().next().packageApplications().get(0).description()); - Assertions - .assertEquals("shwddkvbxgk", response.iterator().next().packageApplications().get(0).appUserModelId()); - Assertions.assertEquals("sybwptdaca", response.iterator().next().packageApplications().get(0).friendlyName()); - Assertions.assertEquals("vlf", response.iterator().next().packageApplications().get(0).iconImageName()); + Assertions.assertEquals(true, response.iterator().next().isActive()); + Assertions.assertEquals("uyxlykwphvxzcw", + response.iterator().next().packageDependencies().get(0).dependencyName()); + Assertions.assertEquals("mpe", response.iterator().next().packageDependencies().get(0).publisher()); + Assertions.assertEquals("lkexaonwivkcqh", response.iterator().next().packageDependencies().get(0).minVersion()); + Assertions.assertEquals("ulsutrjbhxy", response.iterator().next().version()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T08:11:25Z"), response.iterator().next().lastUpdated()); + Assertions.assertEquals("zvqqugdrftbcvexr", response.iterator().next().packageApplications().get(0).appId()); + Assertions.assertEquals("quowtljvfwhrea", + response.iterator().next().packageApplications().get(0).description()); + Assertions.assertEquals("hyxvrqt", response.iterator().next().packageApplications().get(0).appUserModelId()); + Assertions.assertEquals("czsulmdggl", response.iterator().next().packageApplications().get(0).friendlyName()); + Assertions.assertEquals("pjpfseykgs", response.iterator().next().packageApplications().get(0).iconImageName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java index 4a64716223f2..42b9e462a2b2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationPropertiesTests.java @@ -14,34 +14,24 @@ public final class OperationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationProperties model = - BinaryData - .fromString( - "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"th\",\"displayName\":\"hab\",\"blobDuration\":\"pikxwczbyscnpqxu\"}]}}") - .toObject(OperationProperties.class); + OperationProperties model = BinaryData.fromString( + "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"th\",\"displayName\":\"hab\",\"blobDuration\":\"pikxwczbyscnpqxu\"}]}}") + .toObject(OperationProperties.class); Assertions.assertEquals("th", model.serviceSpecification().logSpecifications().get(0).name()); Assertions.assertEquals("hab", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions - .assertEquals("pikxwczbyscnpqxu", model.serviceSpecification().logSpecifications().get(0).blobDuration()); + Assertions.assertEquals("pikxwczbyscnpqxu", + model.serviceSpecification().logSpecifications().get(0).blobDuration()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationProperties model = - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications( - Arrays - .asList( - new LogSpecification() - .withName("th") - .withDisplayName("hab") - .withBlobDuration("pikxwczbyscnpqxu")))); + OperationProperties model = new OperationProperties() + .withServiceSpecification(new ServiceSpecification().withLogSpecifications(Arrays.asList( + new LogSpecification().withName("th").withDisplayName("hab").withBlobDuration("pikxwczbyscnpqxu")))); model = BinaryData.fromObject(model).toObject(OperationProperties.class); Assertions.assertEquals("th", model.serviceSpecification().logSpecifications().get(0).name()); Assertions.assertEquals("hab", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions - .assertEquals("pikxwczbyscnpqxu", model.serviceSpecification().logSpecifications().get(0).blobDuration()); + Assertions.assertEquals("pikxwczbyscnpqxu", + model.serviceSpecification().logSpecifications().get(0).blobDuration()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java index 6a1374e24e74..c9184d05c4d3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/OperationsListMockTests.java @@ -6,93 +6,44 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperation; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OperationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"name\":\"anashc\",\"display\":{\"provider\":\"mjerbdk\",\"resource\":\"vidizozsdb\",\"operation\":\"xjmonf\",\"description\":\"nwncypuuw\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"tzenk\",\"displayName\":\"fzzhmkdasv\",\"blobDuration\":\"yhbxcudchxgs\"},{\"name\":\"oldforobw\",\"displayName\":\"vizbfhfo\",\"blobDuration\":\"acqpbtuodxesza\"},{\"name\":\"elawumu\",\"displayName\":\"lzkwrrwoy\",\"blobDuration\":\"ucwyhahno\"}]}}}]}"; - String responseStr = - "{\"value\":[{\"name\":\"vuzhyr\",\"display\":{\"provider\":\"ipmve\",\"resource\":\"xukuqgsj\",\"operation\":\"undxgketw\",\"description\":\"hzjhf\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"gpmuneqsxvmhfbuz\",\"displayName\":\"ihsasb\",\"blobDuration\":\"dyp\"}]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("vuzhyr", response.iterator().next().name()); - Assertions.assertEquals("ipmve", response.iterator().next().display().provider()); - Assertions.assertEquals("xukuqgsj", response.iterator().next().display().resource()); - Assertions.assertEquals("undxgketw", response.iterator().next().display().operation()); - Assertions.assertEquals("hzjhf", response.iterator().next().display().description()); + Assertions.assertEquals("anashc", response.iterator().next().name()); + Assertions.assertEquals("mjerbdk", response.iterator().next().display().provider()); + Assertions.assertEquals("vidizozsdb", response.iterator().next().display().resource()); + Assertions.assertEquals("xjmonf", response.iterator().next().display().operation()); + Assertions.assertEquals("nwncypuuw", response.iterator().next().display().description()); Assertions.assertEquals(true, response.iterator().next().isDataAction()); - Assertions - .assertEquals( - "gpmuneqsxvmhfbuz", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions - .assertEquals( - "ihsasb", - response - .iterator() - .next() - .properties() - .serviceSpecification() - .logSpecifications() - .get(0) - .displayName()); - Assertions - .assertEquals( - "dyp", - response - .iterator() - .next() - .properties() - .serviceSpecification() - .logSpecifications() - .get(0) - .blobDuration()); + Assertions.assertEquals("tzenk", + response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); + Assertions.assertEquals("fzzhmkdasv", + response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); + Assertions.assertEquals("yhbxcudchxgs", + response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).blobDuration()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java index 90da69e1ea07..1ef929ea7256 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionListResultWithSystemDataTests.java @@ -16,50 +16,40 @@ public final class PrivateEndpointConnectionListResultWithSystemDataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResultWithSystemData model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"epgzgqexz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"scpai\",\"actionsRequired\":\"hhbcsglummajtjao\"},\"provisioningState\":\"Failed\"},\"id\":\"bnbdxkqpxokajion\",\"name\":\"imexgstxgcpodgma\",\"type\":\"jrmvdjwzrlo\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"hijco\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"bzaqsqsycbkbfk\",\"actionsRequired\":\"kdkexxp\"},\"provisioningState\":\"Succeeded\"},\"id\":\"mxaxc\",\"name\":\"jpgd\",\"type\":\"toc\"}],\"nextLink\":\"xhvpmoue\"}") - .toObject(PrivateEndpointConnectionListResultWithSystemData.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("scpai", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "hhbcsglummajtjao", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + PrivateEndpointConnectionListResultWithSystemData model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupIds\":[\"jmkljavbqidtqajz\"],\"privateEndpoint\":{\"id\":\"pku\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"lkhbz\",\"actionsRequired\":\"epgzgqexz\"},\"provisioningState\":\"Succeeded\"},\"id\":\"scpai\",\"name\":\"rhhbcs\",\"type\":\"l\"},{\"properties\":{\"groupIds\":[\"jtjaodxobnbdxkq\"],\"privateEndpoint\":{\"id\":\"kajionpim\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"txgcpodgmaajr\",\"actionsRequired\":\"djwzrlov\"},\"provisioningState\":\"Failed\"},\"id\":\"hijco\",\"name\":\"jctbza\",\"type\":\"s\"},{\"properties\":{\"groupIds\":[\"bkbfkgukdkex\",\"ppofmxaxcfjpgdd\"],\"privateEndpoint\":{\"id\":\"jjxhvpmo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"dzxibqeojnxqbzvd\",\"actionsRequired\":\"t\"},\"provisioningState\":\"Deleting\"},\"id\":\"icbtwnpzao\",\"name\":\"vuhrhcffcyddgl\",\"type\":\"jthjqkwpyei\"}],\"nextLink\":\"mqc\"}") + .toObject(PrivateEndpointConnectionListResultWithSystemData.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("lkhbz", model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("epgzgqexz", + model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpointConnectionListResultWithSystemData model = - new PrivateEndpointConnectionListResultWithSystemData() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionWithSystemDataInner() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("scpai") - .withActionsRequired("hhbcsglummajtjao")), - new PrivateEndpointConnectionWithSystemDataInner() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("bzaqsqsycbkbfk") - .withActionsRequired("kdkexxp")))); + PrivateEndpointConnectionListResultWithSystemData model + = new PrivateEndpointConnectionListResultWithSystemData().withValue(Arrays.asList( + new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("lkhbz") + .withActionsRequired("epgzgqexz")), + new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("txgcpodgmaajr") + .withActionsRequired("djwzrlov")), + new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("dzxibqeojnxqbzvd") + .withActionsRequired("t")))); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultWithSystemData.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("scpai", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "hhbcsglummajtjao", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.value().get(0).privateLinkServiceConnectionState().status()); + Assertions.assertEquals("lkhbz", model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("epgzgqexz", + model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java index b5f23de2d3ac..a4bc1c3a4beb 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionPropertiesTests.java @@ -14,33 +14,27 @@ public final class PrivateEndpointConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"xklrypl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"asy\",\"actionsRequired\":\"nddhsgcbacph\"},\"provisioningState\":\"Succeeded\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("asy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("nddhsgcbacph", model.privateLinkServiceConnectionState().actionsRequired()); + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"groupIds\":[\"vkaozwyiftyhxhur\",\"k\"],\"privateEndpoint\":{\"id\":\"xolniwpwcukjfk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"xklrypl\",\"actionsRequired\":\"kbasyypn\"},\"provisioningState\":\"Failed\"}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xklrypl", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("kbasyypn", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) + PrivateEndpointConnectionProperties model + = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("asy") - .withActionsRequired("nddhsgcbacph")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("xklrypl") + .withActionsRequired("kbasyypn")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("asy", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("nddhsgcbacph", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xklrypl", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("kbasyypn", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java index 9eeb10d0eda4..fb567817271b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionTests.java @@ -14,33 +14,26 @@ public final class PrivateEndpointConnectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpointConnection model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"tqxhocdgeab\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"uticndvkaozwyif\",\"actionsRequired\":\"hxh\"},\"provisioningState\":\"Failed\"},\"id\":\"k\",\"name\":\"tyxolniwpwc\",\"type\":\"kjfkg\"}") - .toObject(PrivateEndpointConnection.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("uticndvkaozwyif", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("hxh", model.privateLinkServiceConnectionState().actionsRequired()); + PrivateEndpointConnection model = BinaryData.fromString( + "{\"properties\":{\"groupIds\":[\"qvkoc\",\"cjdkwtnhxbnjbi\",\"sqrglssainq\",\"jwnzlljfmp\"],\"privateEndpoint\":{\"id\":\"bvmgxsabkyqduuji\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"zdzevndh\",\"actionsRequired\":\"wpdappdsbdkv\"},\"provisioningState\":\"Failed\"},\"id\":\"feusnhut\",\"name\":\"eltmrldhugjzzdat\",\"type\":\"xhocdgeablgphuti\"}") + .toObject(PrivateEndpointConnection.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("zdzevndh", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("wpdappdsbdkv", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpointConnection model = - new PrivateEndpointConnection() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("uticndvkaozwyif") - .withActionsRequired("hxh")); + PrivateEndpointConnection model = new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("zdzevndh") + .withActionsRequired("wpdappdsbdkv")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnection.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("uticndvkaozwyif", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("hxh", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("zdzevndh", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("wpdappdsbdkv", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java index 4cec92a7ec25..323409e7db09 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionWithSystemDataInnerTests.java @@ -14,33 +14,27 @@ public final class PrivateEndpointConnectionWithSystemDataInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpointConnectionWithSystemDataInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"i\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"jnxqbzvddntwn\",\"actionsRequired\":\"icbtwnpzao\"},\"provisioningState\":\"Failed\"},\"id\":\"hrhcffcyddglmjth\",\"name\":\"qkwpyeicxmqc\",\"type\":\"wqvhkhixuigdt\"}") - .toObject(PrivateEndpointConnectionWithSystemDataInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jnxqbzvddntwn", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("icbtwnpzao", model.privateLinkServiceConnectionState().actionsRequired()); + PrivateEndpointConnectionWithSystemDataInner model = BinaryData.fromString( + "{\"properties\":{\"groupIds\":[\"hkh\",\"xuigdtopbobj\"],\"privateEndpoint\":{\"id\":\"m\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"m\",\"actionsRequired\":\"hrzayvvtpgvdf\"},\"provisioningState\":\"Failed\"},\"id\":\"kftutqxlngxlefg\",\"name\":\"gnxkrxdqmidtth\",\"type\":\"rvqdra\"}") + .toObject(PrivateEndpointConnectionWithSystemDataInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("m", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("hrzayvvtpgvdf", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpointConnectionWithSystemDataInner model = - new PrivateEndpointConnectionWithSystemDataInner() - .withPrivateEndpoint(new PrivateEndpoint()) + PrivateEndpointConnectionWithSystemDataInner model + = new PrivateEndpointConnectionWithSystemDataInner().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("jnxqbzvddntwn") - .withActionsRequired("icbtwnpzao")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("m") + .withActionsRequired("hrzayvvtpgvdf")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionWithSystemDataInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("jnxqbzvddntwn", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("icbtwnpzao", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("m", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("hrzayvvtpgvdf", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java index 8b9e90820ea8..30498ff7c79a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsDeleteByHostPoolWithResponseMockTests { @Test public void testDeleteByHostPoolWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.privateEndpointConnections() + .deleteByHostPoolWithResponse("aosrxuz", "oamktcq", "os", com.azure.core.util.Context.NONE); - manager - .privateEndpointConnections() - .deleteByHostPoolWithResponse("z", "owxeqocljmy", "vkzqk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java index acd3ab29585c..9fb909047506 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests.java @@ -6,59 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsDeleteByWorkspaceWithResponseMockTests { @Test public void testDeleteByWorkspaceWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.privateEndpointConnections() + .deleteByWorkspaceWithResponse("fy", "sgcrpfbcunezzce", "elfwy", com.azure.core.util.Context.NONE); - manager - .privateEndpointConnections() - .deleteByWorkspaceWithResponse( - "fnmdxotn", "fdgugeyzi", "grkyuizabsnmfpph", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java index 3549829ed2a9..3c836b297f46 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests.java @@ -6,71 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsGetByHostPoolWithResponseMockTests { @Test public void testGetByHostPoolWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"ihsgq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ohsdtmcd\",\"actionsRequired\":\"ufcohdxbz\"},\"provisioningState\":\"Deleting\"},\"id\":\"muapcvhdbevw\",\"name\":\"qxeysko\",\"type\":\"qzinkfkbg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = - manager - .privateEndpointConnections() - .getByHostPoolWithResponse( - "jltfvnzcyjtotpv", "pvpbdbzqgqqiheds", "qwthmky", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.REJECTED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ohsdtmcd", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ufcohdxbz", response.privateLinkServiceConnectionState().actionsRequired()); + String responseStr + = "{\"properties\":{\"groupIds\":[\"y\"],\"privateEndpoint\":{\"id\":\"cjxgrytf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"cil\",\"actionsRequired\":\"caykggnoxuz\"},\"provisioningState\":\"Creating\"},\"id\":\"xwpndfcpf\",\"name\":\"znth\",\"type\":\"twk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() + .getByHostPoolWithResponse("g", "pnpbswveflocc", "rmozihmipgawt", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("cil", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("caykggnoxuz", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java index 4819c76babb5..45fb8225d500 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests.java @@ -6,70 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsGetByWorkspaceWithResponseMockTests { @Test public void testGetByWorkspaceWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"brjtloqxfuoj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"flrzpas\",\"actionsRequired\":\"biuimzdlyjdfq\"},\"provisioningState\":\"Creating\"},\"id\":\"yoqufdvruz\",\"name\":\"lzo\",\"type\":\"hpc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = - manager - .privateEndpointConnections() - .getByWorkspaceWithResponse("jjrcgegydc", "boxjumvq", "olihrra", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("flrzpas", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("biuimzdlyjdfq", response.privateLinkServiceConnectionState().actionsRequired()); + String responseStr + = "{\"properties\":{\"groupIds\":[\"dmstk\"],\"privateEndpoint\":{\"id\":\"v\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"iiznktwfan\",\"actionsRequired\":\"v\"},\"provisioningState\":\"Deleting\"},\"id\":\"mik\",\"name\":\"stbz\",\"type\":\"kiwbuqnyoph\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() + .getByWorkspaceWithResponse("cyrcmjdmspo", "apvu", "rylniofrzg", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("iiznktwfan", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("v", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java index 1abdeb56e325..6e922be429bc 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByHostPoolMockTests.java @@ -6,72 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsListByHostPoolMockTests { @Test public void testListByHostPool() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"prot\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ndm\",\"actionsRequired\":\"hu\"},\"provisioningState\":\"Failed\"},\"id\":\"jkavl\",\"name\":\"or\",\"type\":\"mftpmdtz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .privateEndpointConnections() - .listByHostPool( - "nustgnljh", "mgixhcmavmqfou", 308634203, false, 1053565042, com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ndm", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("hu", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); + String responseStr + = "{\"value\":[{\"properties\":{\"groupIds\":[\"rqbsmswziq\",\"fuhok\",\"ruswhv\"],\"privateEndpoint\":{\"id\":\"znvfbycjsxjww\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"umwmxqhnd\",\"actionsRequired\":\"oamld\"},\"provisioningState\":\"Failed\"},\"id\":\"ohdjhhflzok\",\"name\":\"coxpelnjeta\",\"type\":\"ltsxoatf\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.privateEndpointConnections() + .listByHostPool("xlxqzvn", "rsbycucrwn", 1504797944, false, 174451620, com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + response.iterator().next().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("umwmxqhnd", + response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("oamld", + response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java index 411f06b2986f..6d06ba0d8399 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsListByWorkspaceMockTests.java @@ -6,74 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"kjibnxmysuxswqrn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ijpstte\",\"actionsRequired\":\"qqpwcyyuf\"},\"provisioningState\":\"Failed\"},\"id\":\"uncuw\",\"name\":\"qspkcdqzhlctd\",\"type\":\"unqndyfpchrqb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .privateEndpointConnections() - .listByWorkspace("yb", "wwpgdakchzyvlixq", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("ijpstte", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions - .assertEquals( - "qqpwcyyuf", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); + String responseStr + = "{\"value\":[{\"properties\":{\"groupIds\":[\"winhehfqpo\",\"vwbcblembnkbwv\"],\"privateEndpoint\":{\"id\":\"kdi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ebwtswb\",\"actionsRequired\":\"wfmdurage\"},\"provisioningState\":\"Failed\"},\"id\":\"cjfelisdjubgg\",\"name\":\"qigkx\",\"type\":\"bsazgakg\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.privateEndpointConnections() + .listByWorkspace("xgnxfyqonmpqoxwd", "fdbxiqxeiiqbim", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + response.iterator().next().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ebwtswb", + response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("wfmdurage", + response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java index e17fdb8c0f00..87895d7d1b0e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests.java @@ -6,84 +6,47 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsUpdateByHostPoolWithResponseMockTests { @Test public void testUpdateByHostPoolWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"okayzejnhlbkp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"piljhahzvech\",\"actionsRequired\":\"bnwieholew\"},\"provisioningState\":\"Deleting\"},\"id\":\"uubw\",\"name\":\"fqsfa\",\"type\":\"aqtferr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = - manager - .privateEndpointConnections() - .updateByHostPoolWithResponse( - "jeokbzefezrxccz", - "rtle", - "pqxbkwvzgnzvdf", - new PrivateEndpointConnection() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("jptmcgsbost") - .withActionsRequired("lnd")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("piljhahzvech", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("bnwieholew", response.privateLinkServiceConnectionState().actionsRequired()); + String responseStr + = "{\"properties\":{\"groupIds\":[\"kifmjn\"],\"privateEndpoint\":{\"id\":\"tqabpxuckpgg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"yirdhlisngwflqq\",\"actionsRequired\":\"izruwnpqxpxiwfc\"},\"provisioningState\":\"Succeeded\"},\"id\":\"aas\",\"name\":\"ixtmkzjvkviirhgf\",\"type\":\"rwsdp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() + .updateByHostPoolWithResponse("gbzahgxqdlyr", "ltlaprltzkatbhj", "znnbsoqeqalarvl", + new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("ouwtl") + .withActionsRequired("jyuojqtobaxkjeyt")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("yirdhlisngwflqq", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("izruwnpqxpxiwfc", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java index 950c3c717499..f10e5dbde323 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests.java @@ -6,84 +6,47 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpoint; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData; import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkServiceConnectionState; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateEndpointConnectionsUpdateByWorkspaceWithResponseMockTests { @Test public void testUpdateByWorkspaceWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"faey\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"fgvxirpghriypoqe\",\"actionsRequired\":\"lqhykprlpyz\"},\"provisioningState\":\"Creating\"},\"id\":\"iq\",\"name\":\"smexiitdf\",\"type\":\"xtyasiibmiyb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnectionWithSystemData response = - manager - .privateEndpointConnections() - .updateByWorkspaceWithResponse( - "jee", - "yhyhsgzfczb", - "omfgbeglqgleohib", - new PrivateEndpointConnection() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("acvbmqz") - .withActionsRequired("q")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("fgvxirpghriypoqe", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("lqhykprlpyz", response.privateLinkServiceConnectionState().actionsRequired()); + String responseStr + = "{\"properties\":{\"groupIds\":[\"tdewemxswvruu\",\"zzjgehkfki\",\"rtixokff\"],\"privateEndpoint\":{\"id\":\"nljqepqwhixmons\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"yxgvelfcld\",\"actionsRequired\":\"cb\"},\"provisioningState\":\"Succeeded\"},\"id\":\"vuwcobiegstmnin\",\"name\":\"jizcilnghgs\",\"type\":\"ejjtbxqmul\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnectionWithSystemData response = manager.privateEndpointConnections() + .updateByWorkspaceWithResponse("wl", "xjwet", "psihcla", + new PrivateEndpointConnection().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("fdeqvhpsyl") + .withActionsRequired("shk")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + response.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("yxgvelfcld", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("cb", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java index 28988233d3a7..76c11b22f0fa 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateEndpointTests.java @@ -10,7 +10,7 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"tynqgoul\"}").toObject(PrivateEndpoint.class); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"gcbacphejkot\"}").toObject(PrivateEndpoint.class); } @org.junit.jupiter.api.Test diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java index ff4fefa3ff73..4cda08b4c3a7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceInnerTests.java @@ -12,19 +12,17 @@ public final class PrivateLinkResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"m\",\"requiredMembers\":[\"ofsx\"],\"requiredZoneNames\":[\"v\",\"bmqj\"]},\"id\":\"abcypmivk\",\"name\":\"lzu\",\"type\":\"ccfwnfnbacfion\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("v", model.requiredZoneNames().get(0)); + PrivateLinkResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupId\":\"okeyyienj\",\"requiredMembers\":[\"wtgrhpdjpj\",\"masxazjpqyegu\",\"lhbxxhejjzzvdud\"],\"requiredZoneNames\":[\"slfhotwm\",\"ynpwlbj\",\"pgacftadehxnlty\"]},\"id\":\"oppusuesnzw\",\"name\":\"ej\",\"type\":\"avo\"}") + .toObject(PrivateLinkResourceInner.class); + Assertions.assertEquals("slfhotwm", model.requiredZoneNames().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateLinkResourceInner model = - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("v", "bmqj")); + PrivateLinkResourceInner model = new PrivateLinkResourceInner() + .withRequiredZoneNames(Arrays.asList("slfhotwm", "ynpwlbj", "pgacftadehxnlty")); model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("v", model.requiredZoneNames().get(0)); + Assertions.assertEquals("slfhotwm", model.requiredZoneNames().get(0)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java index 384007368c65..e2f9c7a682cd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourceListResultTests.java @@ -13,25 +13,18 @@ public final class PrivateLinkResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"joghmewuama\",\"requiredMembers\":[\"z\",\"yvvtpgvdfgio\"],\"requiredZoneNames\":[\"tutqxlngxlefgug\",\"xkrxdqmi\",\"tthzrvqd\",\"abhjybi\"]},\"id\":\"ehoqfbowskan\",\"name\":\"ktzlcuiywg\",\"type\":\"ywgndrv\"}],\"nextLink\":\"hzgpphrcgyncocpe\"}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("tutqxlngxlefgug", model.value().get(0).requiredZoneNames().get(0)); + PrivateLinkResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"igeho\",\"requiredMembers\":[\"owskanyktz\",\"cuiywgqyw\"],\"requiredZoneNames\":[\"rvynhzgpph\",\"cgyncocpecf\"]},\"id\":\"mcoo\",\"name\":\"sxlzevgbmqj\",\"type\":\"abcypmivk\"},{\"properties\":{\"groupId\":\"uvcc\",\"requiredMembers\":[\"fnba\",\"fionl\",\"bxetqgtzxdpn\",\"bqqwxrj\"],\"requiredZoneNames\":[\"llnwsubi\"]},\"id\":\"jampmngnzscxaqw\",\"name\":\"ochcbonqvpkvl\",\"type\":\"xnj\"}],\"nextLink\":\"seiphe\"}") + .toObject(PrivateLinkResourceListResult.class); + Assertions.assertEquals("rvynhzgpph", model.value().get(0).requiredZoneNames().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = - new PrivateLinkResourceListResult() - .withValue( - Arrays - .asList( - new PrivateLinkResourceInner() - .withRequiredZoneNames( - Arrays.asList("tutqxlngxlefgug", "xkrxdqmi", "tthzrvqd", "abhjybi")))); + PrivateLinkResourceListResult model = new PrivateLinkResourceListResult().withValue(Arrays.asList( + new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("rvynhzgpph", "cgyncocpecf")), + new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("llnwsubi")))); model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("tutqxlngxlefgug", model.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("rvynhzgpph", model.value().get(0).requiredZoneNames().get(0)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java index 8d54c2c6485d..f4d9469c32a2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcePropertiesTests.java @@ -12,19 +12,17 @@ public final class PrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"bxetqgtzxdpn\",\"requiredMembers\":[\"qwxrjfeallnw\"],\"requiredZoneNames\":[\"isnjampmngnz\",\"c\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("isnjampmngnz", model.requiredZoneNames().get(0)); + PrivateLinkResourceProperties model = BinaryData.fromString( + "{\"groupId\":\"zdmohctbqvu\",\"requiredMembers\":[\"dndnvow\"],\"requiredZoneNames\":[\"jugwdkcglhsl\",\"zj\",\"yggdtjixh\",\"kuofqweykhme\"]}") + .toObject(PrivateLinkResourceProperties.class); + Assertions.assertEquals("jugwdkcglhsl", model.requiredZoneNames().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("isnjampmngnz", "c")); + PrivateLinkResourceProperties model = new PrivateLinkResourceProperties() + .withRequiredZoneNames(Arrays.asList("jugwdkcglhsl", "zj", "yggdtjixh", "kuofqweykhme")); model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("isnjampmngnz", model.requiredZoneNames().get(0)); + Assertions.assertEquals("jugwdkcglhsl", model.requiredZoneNames().get(0)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java index 310cc730aebd..3df1871045b9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByHostPoolMockTests.java @@ -6,65 +6,34 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateLinkResourcesListByHostPoolMockTests { @Test public void testListByHostPool() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"z\",\"requiredMembers\":[\"knlqwzdvpiwhxqsz\",\"tmaaj\",\"uhuxylrjvmtyg\"],\"requiredZoneNames\":[\"zyos\",\"spshckfkyjp\",\"sp\"]},\"id\":\"ssdfpp\",\"name\":\"ogtieyujtvczkcny\",\"type\":\"rxmunjdxvgln\"}]}"; - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"sovwxznptgoeiyb\",\"requiredMembers\":[\"pfhvfslk\"],\"requiredZoneNames\":[\"jlrigjkskyrioovz\",\"dsxwaab\",\"mifrygznmma\"]},\"id\":\"ri\",\"name\":\"kzobgopxlhsln\",\"type\":\"lxieixynllxecwcr\"}]}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + PagedIterable response = manager.privateLinkResources() + .listByHostPool("mr", "ddoui", 2056652975, true, 758569628, com.azure.core.util.Context.NONE); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .privateLinkResources() - .listByHostPool("l", "qryxyn", 620085605, true, 356071455, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jlrigjkskyrioovz", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("zyos", response.iterator().next().requiredZoneNames().get(0)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java index 73f81c17a520..9c5de40c4ec3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkResourcesListByWorkspaceMockTests.java @@ -6,71 +6,34 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PrivateLinkResourcesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"rxkjzwrgxffmshk\",\"requiredMembers\":[\"kgozxwop\",\"bydpizqaclnapxb\",\"yg\",\"ugjknf\"],\"requiredZoneNames\":[\"cttuxuu\",\"i\",\"flqo\",\"quvre\"]},\"id\":\"rnjhvsujztczytqj\",\"name\":\"w\",\"type\":\"auunfprnjletlx\"}]}"; - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"sqbuc\",\"requiredMembers\":[\"kyexaoguyaipi\",\"sdaultxij\",\"um\"],\"requiredZoneNames\":[\"azlnqnmcjngzqdqx\"]},\"id\":\"bjwgnyfus\",\"name\":\"zsvtuikzhajqgl\",\"type\":\"fh\"}]}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + PagedIterable response = manager.privateLinkResources() + .listByWorkspace("ra", "zvzbglbyv", 388698901, true, 1693700335, com.azure.core.util.Context.NONE); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .privateLinkResources() - .listByWorkspace( - "wexjkmfxapjwogq", - "nobpudcdabtqwpw", - 2010443445, - true, - 1935612973, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("azlnqnmcjngzqdqx", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("cttuxuu", response.iterator().next().requiredZoneNames().get(0)); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java index 19b55b77a5a3..56a2dc8dc723 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/PrivateLinkServiceConnectionStateTests.java @@ -12,25 +12,24 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = - BinaryData - .fromString("{\"status\":\"Approved\",\"description\":\"i\",\"actionsRequired\":\"yqkgfg\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("i", model.description()); - Assertions.assertEquals("yqkgfg", model.actionsRequired()); + PrivateLinkServiceConnectionState model = BinaryData + .fromString( + "{\"status\":\"Pending\",\"description\":\"oulzndlikwyq\",\"actionsRequired\":\"fgibmadgakeq\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("oulzndlikwyq", model.description()); + Assertions.assertEquals("fgibmadgakeq", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("i") - .withActionsRequired("yqkgfg"); + PrivateLinkServiceConnectionState model + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("oulzndlikwyq") + .withActionsRequired("fgibmadgakeq"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("i", model.description()); - Assertions.assertEquals("yqkgfg", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("oulzndlikwyq", model.description()); + Assertions.assertEquals("fgibmadgakeq", model.actionsRequired()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java index a0dff4b8f7ec..38ac7af2217e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetIdentityTests.java @@ -12,18 +12,16 @@ public final class ResourceModelWithAllowedPropertySetIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceModelWithAllowedPropertySetIdentity model = - BinaryData - .fromString( - "{\"principalId\":\"uvfqawrlyxwj\",\"tenantId\":\"prbnwbxgjvtbv\",\"type\":\"SystemAssigned\"}") - .toObject(ResourceModelWithAllowedPropertySetIdentity.class); + ResourceModelWithAllowedPropertySetIdentity model = BinaryData.fromString( + "{\"principalId\":\"b42f0b73-54cb-4b9b-b456-86179d5350ce\",\"tenantId\":\"716b4aed-7682-468d-94e1-c77157a20f23\",\"type\":\"SystemAssigned\"}") + .toObject(ResourceModelWithAllowedPropertySetIdentity.class); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceModelWithAllowedPropertySetIdentity model = - new ResourceModelWithAllowedPropertySetIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); + ResourceModelWithAllowedPropertySetIdentity model + = new ResourceModelWithAllowedPropertySetIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); model = BinaryData.fromObject(model).toObject(ResourceModelWithAllowedPropertySetIdentity.class); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java index a49af105d066..581fa8c1e1c6 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceModelWithAllowedPropertySetSkuTests.java @@ -12,32 +12,29 @@ public final class ResourceModelWithAllowedPropertySetSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceModelWithAllowedPropertySetSku model = - BinaryData - .fromString( - "{\"name\":\"muouqfp\",\"tier\":\"Free\",\"size\":\"bngui\",\"family\":\"wu\",\"capacity\":1403075438}") - .toObject(ResourceModelWithAllowedPropertySetSku.class); - Assertions.assertEquals("muouqfp", model.name()); + ResourceModelWithAllowedPropertySetSku model = BinaryData.fromString( + "{\"name\":\"psalgbqux\",\"tier\":\"Free\",\"size\":\"jgzjaoyfhrtx\",\"family\":\"n\",\"capacity\":1275359394}") + .toObject(ResourceModelWithAllowedPropertySetSku.class); + Assertions.assertEquals("psalgbqux", model.name()); Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("bngui", model.size()); - Assertions.assertEquals("wu", model.family()); - Assertions.assertEquals(1403075438, model.capacity()); + Assertions.assertEquals("jgzjaoyfhrtx", model.size()); + Assertions.assertEquals("n", model.family()); + Assertions.assertEquals(1275359394, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceModelWithAllowedPropertySetSku model = - new ResourceModelWithAllowedPropertySetSku() - .withName("muouqfp") + ResourceModelWithAllowedPropertySetSku model + = new ResourceModelWithAllowedPropertySetSku().withName("psalgbqux") .withTier(SkuTier.FREE) - .withSize("bngui") - .withFamily("wu") - .withCapacity(1403075438); + .withSize("jgzjaoyfhrtx") + .withFamily("n") + .withCapacity(1275359394); model = BinaryData.fromObject(model).toObject(ResourceModelWithAllowedPropertySetSku.class); - Assertions.assertEquals("muouqfp", model.name()); + Assertions.assertEquals("psalgbqux", model.name()); Assertions.assertEquals(SkuTier.FREE, model.tier()); - Assertions.assertEquals("bngui", model.size()); - Assertions.assertEquals("wu", model.family()); - Assertions.assertEquals(1403075438, model.capacity()); + Assertions.assertEquals("jgzjaoyfhrtx", model.size()); + Assertions.assertEquals("n", model.family()); + Assertions.assertEquals(1275359394, model.capacity()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java index eecce71c09a8..38235be40fa0 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationDisplayTests.java @@ -11,11 +11,9 @@ public final class ResourceProviderOperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceProviderOperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"ryrtihfxtijbpzv\",\"resource\":\"wzsymglzufcy\",\"operation\":\"ohdbihanufh\",\"description\":\"bj\"}") - .toObject(ResourceProviderOperationDisplay.class); + ResourceProviderOperationDisplay model = BinaryData.fromString( + "{\"provider\":\"ryrtihfxtijbpzv\",\"resource\":\"wzsymglzufcy\",\"operation\":\"ohdbihanufh\",\"description\":\"bj\"}") + .toObject(ResourceProviderOperationDisplay.class); Assertions.assertEquals("ryrtihfxtijbpzv", model.provider()); Assertions.assertEquals("wzsymglzufcy", model.resource()); Assertions.assertEquals("ohdbihanufh", model.operation()); @@ -24,12 +22,10 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceProviderOperationDisplay model = - new ResourceProviderOperationDisplay() - .withProvider("ryrtihfxtijbpzv") - .withResource("wzsymglzufcy") - .withOperation("ohdbihanufh") - .withDescription("bj"); + ResourceProviderOperationDisplay model = new ResourceProviderOperationDisplay().withProvider("ryrtihfxtijbpzv") + .withResource("wzsymglzufcy") + .withOperation("ohdbihanufh") + .withDescription("bj"); model = BinaryData.fromObject(model).toObject(ResourceProviderOperationDisplay.class); Assertions.assertEquals("ryrtihfxtijbpzv", model.provider()); Assertions.assertEquals("wzsymglzufcy", model.resource()); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java index 50d45216eaf7..ae983468e237 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationInnerTests.java @@ -16,50 +16,35 @@ public final class ResourceProviderOperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceProviderOperationInner model = - BinaryData - .fromString( - "{\"name\":\"jddeqsrdeupewnw\",\"display\":{\"provider\":\"tjzyflus\",\"resource\":\"hmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"mparcryuanzw\",\"displayName\":\"zdxtayrlhmwhf\",\"blobDuration\":\"rqobmtuk\"}]}}}") - .toObject(ResourceProviderOperationInner.class); + ResourceProviderOperationInner model = BinaryData.fromString( + "{\"name\":\"jddeqsrdeupewnw\",\"display\":{\"provider\":\"tjzyflus\",\"resource\":\"hmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"mparcryuanzw\",\"displayName\":\"zdxtayrlhmwhf\",\"blobDuration\":\"rqobmtuk\"}]}}}") + .toObject(ResourceProviderOperationInner.class); Assertions.assertEquals("jddeqsrdeupewnw", model.name()); Assertions.assertEquals("tjzyflus", model.display().provider()); Assertions.assertEquals("hmofc", model.display().resource()); Assertions.assertEquals("smy", model.display().operation()); Assertions.assertEquals("kdtmlxhekuk", model.display().description()); Assertions.assertEquals(false, model.isDataAction()); - Assertions - .assertEquals("mparcryuanzw", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions - .assertEquals( - "zdxtayrlhmwhf", model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions - .assertEquals( - "rqobmtuk", model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); + Assertions.assertEquals("mparcryuanzw", + model.properties().serviceSpecification().logSpecifications().get(0).name()); + Assertions.assertEquals("zdxtayrlhmwhf", + model.properties().serviceSpecification().logSpecifications().get(0).displayName()); + Assertions.assertEquals("rqobmtuk", + model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceProviderOperationInner model = - new ResourceProviderOperationInner() - .withName("jddeqsrdeupewnw") - .withDisplay( - new ResourceProviderOperationDisplay() - .withProvider("tjzyflus") - .withResource("hmofc") - .withOperation("smy") - .withDescription("kdtmlxhekuk")) - .withIsDataAction(false) - .withProperties( - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications( - Arrays - .asList( - new LogSpecification() - .withName("mparcryuanzw") - .withDisplayName("zdxtayrlhmwhf") - .withBlobDuration("rqobmtuk"))))); + ResourceProviderOperationInner model = new ResourceProviderOperationInner().withName("jddeqsrdeupewnw") + .withDisplay(new ResourceProviderOperationDisplay().withProvider("tjzyflus") + .withResource("hmofc") + .withOperation("smy") + .withDescription("kdtmlxhekuk")) + .withIsDataAction(false) + .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() + .withLogSpecifications(Arrays.asList(new LogSpecification().withName("mparcryuanzw") + .withDisplayName("zdxtayrlhmwhf") + .withBlobDuration("rqobmtuk"))))); model = BinaryData.fromObject(model).toObject(ResourceProviderOperationInner.class); Assertions.assertEquals("jddeqsrdeupewnw", model.name()); Assertions.assertEquals("tjzyflus", model.display().provider()); @@ -67,13 +52,11 @@ public void testSerialize() throws Exception { Assertions.assertEquals("smy", model.display().operation()); Assertions.assertEquals("kdtmlxhekuk", model.display().description()); Assertions.assertEquals(false, model.isDataAction()); - Assertions - .assertEquals("mparcryuanzw", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions - .assertEquals( - "zdxtayrlhmwhf", model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions - .assertEquals( - "rqobmtuk", model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); + Assertions.assertEquals("mparcryuanzw", + model.properties().serviceSpecification().logSpecifications().get(0).name()); + Assertions.assertEquals("zdxtayrlhmwhf", + model.properties().serviceSpecification().logSpecifications().get(0).displayName()); + Assertions.assertEquals("rqobmtuk", + model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java index e4131c6ffa54..41e67e7cfbb1 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ResourceProviderOperationListTests.java @@ -17,11 +17,9 @@ public final class ResourceProviderOperationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceProviderOperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"hwlrx\",\"display\":{\"provider\":\"soqijg\",\"resource\":\"mbpazlobcufpdzn\",\"operation\":\"t\",\"description\":\"qjnqglhqgnufoooj\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"aagdfmg\",\"display\":{\"provider\":\"hjxri\",\"resource\":\"wmrvktsizntocipa\",\"operation\":\"ajpsquc\",\"description\":\"o\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{},{},{}]}}}],\"nextLink\":\"nygj\"}") - .toObject(ResourceProviderOperationList.class); + ResourceProviderOperationList model = BinaryData.fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"hwlrx\",\"display\":{\"provider\":\"soqijg\",\"resource\":\"mbpazlobcufpdzn\",\"operation\":\"t\",\"description\":\"qjnqglhqgnufoooj\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}]}}},{\"name\":\"aagdfmg\",\"display\":{\"provider\":\"hjxri\",\"resource\":\"wmrvktsizntocipa\",\"operation\":\"ajpsquc\",\"description\":\"o\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{},{},{}]}}}],\"nextLink\":\"nygj\"}") + .toObject(ResourceProviderOperationList.class); Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); @@ -32,61 +30,32 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceProviderOperationList model = - new ResourceProviderOperationList() - .withValue( - Arrays - .asList( - new ResourceProviderOperationInner() - .withName("quvgjxpybczme") - .withDisplay( - new ResourceProviderOperationDisplay() - .withProvider("zopbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")) - .withIsDataAction(false) - .withProperties( - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications( - Arrays.asList(new LogSpecification(), new LogSpecification())))), - new ResourceProviderOperationInner() - .withName("hwlrx") - .withDisplay( - new ResourceProviderOperationDisplay() - .withProvider("soqijg") - .withResource("mbpazlobcufpdzn") - .withOperation("t") - .withDescription("qjnqglhqgnufoooj")) - .withIsDataAction(true) - .withProperties( - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications( - Arrays.asList(new LogSpecification(), new LogSpecification())))), - new ResourceProviderOperationInner() - .withName("aagdfmg") - .withDisplay( - new ResourceProviderOperationDisplay() - .withProvider("hjxri") - .withResource("wmrvktsizntocipa") - .withOperation("ajpsquc") - .withDescription("o")) - .withIsDataAction(false) - .withProperties( - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications( - Arrays - .asList( - new LogSpecification(), - new LogSpecification(), - new LogSpecification(), - new LogSpecification())))))); + ResourceProviderOperationList model = new ResourceProviderOperationList().withValue(Arrays.asList( + new ResourceProviderOperationInner().withName("quvgjxpybczme") + .withDisplay(new ResourceProviderOperationDisplay().withProvider("zopbsphrupidgs") + .withResource("bejhphoycmsxa") + .withOperation("hdxbmtqio") + .withDescription("zehtbmu")) + .withIsDataAction(false) + .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() + .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())))), + new ResourceProviderOperationInner().withName("hwlrx") + .withDisplay(new ResourceProviderOperationDisplay().withProvider("soqijg") + .withResource("mbpazlobcufpdzn") + .withOperation("t") + .withDescription("qjnqglhqgnufoooj")) + .withIsDataAction(true) + .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() + .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())))), + new ResourceProviderOperationInner().withName("aagdfmg") + .withDisplay(new ResourceProviderOperationDisplay().withProvider("hjxri") + .withResource("wmrvktsizntocipa") + .withOperation("ajpsquc") + .withDescription("o")) + .withIsDataAction(false) + .withProperties(new OperationProperties().withServiceSpecification( + new ServiceSpecification().withLogSpecifications(Arrays.asList(new LogSpecification(), + new LogSpecification(), new LogSpecification(), new LogSpecification())))))); model = BinaryData.fromObject(model).toObject(ResourceProviderOperationList.class); Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); Assertions.assertEquals("zopbsphrupidgs", model.value().get(0).display().provider()); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java index f416874c518d..a8e76a440867 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingHostPoolReferenceTests.java @@ -11,20 +11,19 @@ public final class ScalingHostPoolReferenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingHostPoolReference model = - BinaryData - .fromString("{\"hostPoolArmPath\":\"yav\",\"scalingPlanEnabled\":false}") + ScalingHostPoolReference model + = BinaryData.fromString("{\"hostPoolArmPath\":\"babphlwrqlfk\",\"scalingPlanEnabled\":false}") .toObject(ScalingHostPoolReference.class); - Assertions.assertEquals("yav", model.hostPoolArmPath()); + Assertions.assertEquals("babphlwrqlfk", model.hostPoolArmPath()); Assertions.assertEquals(false, model.scalingPlanEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingHostPoolReference model = - new ScalingHostPoolReference().withHostPoolArmPath("yav").withScalingPlanEnabled(false); + ScalingHostPoolReference model + = new ScalingHostPoolReference().withHostPoolArmPath("babphlwrqlfk").withScalingPlanEnabled(false); model = BinaryData.fromObject(model).toObject(ScalingHostPoolReference.class); - Assertions.assertEquals("yav", model.hostPoolArmPath()); + Assertions.assertEquals("babphlwrqlfk", model.hostPoolArmPath()); Assertions.assertEquals(false, model.scalingPlanEnabled()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java index 95fff0227cac..56ce0e27b381 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchPropertiesTests.java @@ -18,176 +18,108 @@ public final class ScalingPlanPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPatchProperties model = - BinaryData - .fromString( - "{\"description\":\"axdbabph\",\"friendlyName\":\"rqlfktsthsucocmn\",\"timeZone\":\"azt\",\"exclusionTag\":\"twwrqp\",\"schedules\":[{\"name\":\"kzywbiex\",\"daysOfWeek\":[\"Monday\",\"Saturday\",\"Tuesday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":537783371,\"minute\":712970145},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1757218598,\"rampUpCapacityThresholdPct\":954772002,\"peakStartTime\":{\"hour\":913520848,\"minute\":2089644825},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1122495677,\"minute\":978941807},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1637273093,\"rampDownCapacityThresholdPct\":556709719,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":539118010,\"rampDownNotificationMessage\":\"xrhdwbavxbniwdjs\",\"offPeakStartTime\":{\"hour\":1721819579,\"minute\":44682703},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"gnxytxhpzxbz\",\"daysOfWeek\":[\"Tuesday\",\"Saturday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":687811406,\"minute\":2112719993},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1070511980,\"rampUpCapacityThresholdPct\":767485321,\"peakStartTime\":{\"hour\":683096645,\"minute\":228169976},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1091212098,\"minute\":1229662931},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":507562638,\"rampDownCapacityThresholdPct\":1271650742,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":338198941,\"rampDownNotificationMessage\":\"osvmk\",\"offPeakStartTime\":{\"hour\":979826416,\"minute\":941863244},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"kfplgmgsxnk\",\"daysOfWeek\":[\"Friday\"],\"rampUpStartTime\":{\"hour\":1802573976,\"minute\":1649575445},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":909915522,\"rampUpCapacityThresholdPct\":566835679,\"peakStartTime\":{\"hour\":1665401728,\"minute\":1601345404},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":2017228559,\"minute\":1973154307},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1060544654,\"rampDownCapacityThresholdPct\":413325201,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1370468424,\"rampDownNotificationMessage\":\"nyqupedeojnabck\",\"offPeakStartTime\":{\"hour\":598884844,\"minute\":611656940},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"btfhvpesaps\",\"scalingPlanEnabled\":false}]}") - .toObject(ScalingPlanPatchProperties.class); - Assertions.assertEquals("axdbabph", model.description()); - Assertions.assertEquals("rqlfktsthsucocmn", model.friendlyName()); - Assertions.assertEquals("azt", model.timeZone()); - Assertions.assertEquals("twwrqp", model.exclusionTag()); - Assertions.assertEquals("kzywbiex", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.MONDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(537783371, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(712970145, model.schedules().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1757218598, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(954772002, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(913520848, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(2089644825, model.schedules().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1122495677, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(978941807, model.schedules().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1637273093, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(556709719, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(539118010, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("xrhdwbavxbniwdjs", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(1721819579, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(44682703, model.schedules().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("btfhvpesaps", model.hostPoolReferences().get(0).hostPoolArmPath()); + ScalingPlanPatchProperties model = BinaryData.fromString( + "{\"description\":\"vpesapskrdqmhjjd\",\"friendlyName\":\"ldwkyzxuutkn\",\"timeZone\":\"scwsv\",\"exclusionTag\":\"otogtwrupqs\",\"schedules\":[{\"name\":\"i\",\"daysOfWeek\":[\"Tuesday\",\"Thursday\",\"Friday\",\"Monday\"],\"rampUpStartTime\":{\"hour\":579723655,\"minute\":1739821364},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1344905503,\"rampUpCapacityThresholdPct\":2133356892,\"peakStartTime\":{\"hour\":297433861,\"minute\":1073138726},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1358891927,\"minute\":625040434},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":74427835,\"rampDownCapacityThresholdPct\":95653514,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":59412891,\"rampDownNotificationMessage\":\"wpn\",\"offPeakStartTime\":{\"hour\":224051014,\"minute\":597860603},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"clfp\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"xus\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"bgyepsbj\",\"scalingPlanEnabled\":false}]}") + .toObject(ScalingPlanPatchProperties.class); + Assertions.assertEquals("vpesapskrdqmhjjd", model.description()); + Assertions.assertEquals("ldwkyzxuutkn", model.friendlyName()); + Assertions.assertEquals("scwsv", model.timeZone()); + Assertions.assertEquals("otogtwrupqs", model.exclusionTag()); + Assertions.assertEquals("i", model.schedules().get(0).name()); + Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(579723655, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1739821364, model.schedules().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1344905503, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(2133356892, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(297433861, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(1073138726, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1358891927, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(625040434, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(74427835, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(95653514, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals(true, model.schedules().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); + Assertions.assertEquals(59412891, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("wpn", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(224051014, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(597860603, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("clfp", model.hostPoolReferences().get(0).hostPoolArmPath()); Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPatchProperties model = - new ScalingPlanPatchProperties() - .withDescription("axdbabph") - .withFriendlyName("rqlfktsthsucocmn") - .withTimeZone("azt") - .withExclusionTag("twwrqp") + ScalingPlanPatchProperties model + = new ScalingPlanPatchProperties().withDescription("vpesapskrdqmhjjd") + .withFriendlyName("ldwkyzxuutkn") + .withTimeZone("scwsv") + .withExclusionTag("otogtwrupqs") .withSchedules( Arrays - .asList( - new ScalingSchedule() - .withName("kzywbiex") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY)) - .withRampUpStartTime(new Time().withHour(537783371).withMinute(712970145)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(1757218598) - .withRampUpCapacityThresholdPct(954772002) - .withPeakStartTime(new Time().withHour(913520848).withMinute(2089644825)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(1122495677).withMinute(978941807)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1637273093) - .withRampDownCapacityThresholdPct(556709719) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(539118010) - .withRampDownNotificationMessage("xrhdwbavxbniwdjs") - .withOffPeakStartTime(new Time().withHour(1721819579).withMinute(44682703)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule() - .withName("gnxytxhpzxbz") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY, - ScalingScheduleDaysOfWeekItem.SUNDAY)) - .withRampUpStartTime(new Time().withHour(687811406).withMinute(2112719993)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1070511980) - .withRampUpCapacityThresholdPct(767485321) - .withPeakStartTime(new Time().withHour(683096645).withMinute(228169976)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(1091212098).withMinute(1229662931)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(507562638) - .withRampDownCapacityThresholdPct(1271650742) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(338198941) - .withRampDownNotificationMessage("osvmk") - .withOffPeakStartTime(new Time().withHour(979826416).withMinute(941863244)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), - new ScalingSchedule() - .withName("kfplgmgsxnk") - .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(1802573976).withMinute(1649575445)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(909915522) - .withRampUpCapacityThresholdPct(566835679) - .withPeakStartTime(new Time().withHour(1665401728).withMinute(1601345404)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(2017228559).withMinute(1973154307)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1060544654) - .withRampDownCapacityThresholdPct(413325201) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1370468424) - .withRampDownNotificationMessage("nyqupedeojnabck") - .withOffPeakStartTime(new Time().withHour(598884844).withMinute(611656940)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences( - Arrays - .asList( - new ScalingHostPoolReference() - .withHostPoolArmPath("btfhvpesaps") - .withScalingPlanEnabled(false))); + .asList(new ScalingSchedule().withName("i") + .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, + ScalingScheduleDaysOfWeekItem.THURSDAY, ScalingScheduleDaysOfWeekItem.FRIDAY, + ScalingScheduleDaysOfWeekItem.MONDAY)) + .withRampUpStartTime(new Time().withHour(579723655).withMinute(1739821364)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1344905503) + .withRampUpCapacityThresholdPct(2133356892) + .withPeakStartTime(new Time().withHour(297433861).withMinute(1073138726)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1358891927).withMinute(625040434)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(74427835) + .withRampDownCapacityThresholdPct(95653514) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) + .withRampDownWaitTimeMinutes(59412891) + .withRampDownNotificationMessage("wpn") + .withOffPeakStartTime(new Time().withHour(224051014).withMinute(597860603)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) + .withHostPoolReferences(Arrays.asList( + new ScalingHostPoolReference().withHostPoolArmPath("clfp").withScalingPlanEnabled(false), + new ScalingHostPoolReference().withHostPoolArmPath("xus").withScalingPlanEnabled(false), + new ScalingHostPoolReference().withHostPoolArmPath("bgyepsbj").withScalingPlanEnabled(false))); model = BinaryData.fromObject(model).toObject(ScalingPlanPatchProperties.class); - Assertions.assertEquals("axdbabph", model.description()); - Assertions.assertEquals("rqlfktsthsucocmn", model.friendlyName()); - Assertions.assertEquals("azt", model.timeZone()); - Assertions.assertEquals("twwrqp", model.exclusionTag()); - Assertions.assertEquals("kzywbiex", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.MONDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(537783371, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(712970145, model.schedules().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1757218598, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(954772002, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(913520848, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(2089644825, model.schedules().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1122495677, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(978941807, model.schedules().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1637273093, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(556709719, model.schedules().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(false, model.schedules().get(0).rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(539118010, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("xrhdwbavxbniwdjs", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(1721819579, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(44682703, model.schedules().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("btfhvpesaps", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertEquals("vpesapskrdqmhjjd", model.description()); + Assertions.assertEquals("ldwkyzxuutkn", model.friendlyName()); + Assertions.assertEquals("scwsv", model.timeZone()); + Assertions.assertEquals("otogtwrupqs", model.exclusionTag()); + Assertions.assertEquals("i", model.schedules().get(0).name()); + Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(579723655, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1739821364, model.schedules().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1344905503, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(2133356892, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(297433861, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(1073138726, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1358891927, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(625040434, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(74427835, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(95653514, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals(true, model.schedules().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); + Assertions.assertEquals(59412891, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("wpn", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(224051014, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(597860603, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("clfp", model.hostPoolReferences().get(0).hostPoolArmPath()); Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java index fa499c36509c..3115e9dd3b44 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPatchTests.java @@ -20,209 +20,109 @@ public final class ScalingPlanPatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPatch model = - BinaryData - .fromString( - "{\"tags\":{\"cukoklyaxuconu\":\"nmmqhgyxzkon\",\"pewr\":\"szfkbe\"},\"properties\":{\"description\":\"wv\",\"friendlyName\":\"ektcxsen\",\"timeZone\":\"lrsf\",\"exclusionTag\":\"zpwv\",\"schedules\":[{\"name\":\"gbiqylihkaet\",\"daysOfWeek\":[\"Thursday\",\"Thursday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":493965696,\"minute\":533172139},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1486569340,\"rampUpCapacityThresholdPct\":5394429,\"peakStartTime\":{\"hour\":1059821653,\"minute\":2064900799},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1887113058,\"minute\":1657324555},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1278137451,\"rampDownCapacityThresholdPct\":156873727,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":112236140,\"rampDownNotificationMessage\":\"txfvjrbirph\",\"offPeakStartTime\":{\"hour\":1482882841,\"minute\":99482426},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"hfnljkyq\",\"daysOfWeek\":[\"Saturday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":1054022835,\"minute\":1970519416},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":552165564,\"rampUpCapacityThresholdPct\":2084359484,\"peakStartTime\":{\"hour\":10143119,\"minute\":1108075171},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":649555961,\"minute\":1685542215},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1059812914,\"rampDownCapacityThresholdPct\":1745548413,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":630804167,\"rampDownNotificationMessage\":\"zz\",\"offPeakStartTime\":{\"hour\":1537141479,\"minute\":1755265349},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"fvgxbfsmxneh\",\"daysOfWeek\":[\"Wednesday\",\"Wednesday\",\"Sunday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":1976417253,\"minute\":68854326},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":398257944,\"rampUpCapacityThresholdPct\":156663672,\"peakStartTime\":{\"hour\":1961052031,\"minute\":1123544345},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":175699877,\"minute\":481409327},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1920273783,\"rampDownCapacityThresholdPct\":905507147,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1728715445,\"rampDownNotificationMessage\":\"cispnqzahmgkbr\",\"offPeakStartTime\":{\"hour\":188498280,\"minute\":1687540865},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"nuqqkpikadrgvt\",\"daysOfWeek\":[\"Tuesday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":122504841,\"minute\":855671205},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":508085674,\"rampUpCapacityThresholdPct\":834922568,\"peakStartTime\":{\"hour\":698240356,\"minute\":23060626},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":600405260,\"minute\":1045715770},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":2136509867,\"rampDownCapacityThresholdPct\":1477198207,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":282629437,\"rampDownNotificationMessage\":\"runmp\",\"offPeakStartTime\":{\"hour\":18555434,\"minute\":808779778},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"l\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"myskpbhenbtkcxy\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"nrs\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"idybyxczf\",\"scalingPlanEnabled\":true}]}}") - .toObject(ScalingPlanPatch.class); - Assertions.assertEquals("nmmqhgyxzkon", model.tags().get("cukoklyaxuconu")); - Assertions.assertEquals("wv", model.description()); - Assertions.assertEquals("ektcxsen", model.friendlyName()); - Assertions.assertEquals("lrsf", model.timeZone()); - Assertions.assertEquals("zpwv", model.exclusionTag()); - Assertions.assertEquals("gbiqylihkaet", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.THURSDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(493965696, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(533172139, model.schedules().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1486569340, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(5394429, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1059821653, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(2064900799, model.schedules().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1887113058, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1657324555, model.schedules().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1278137451, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(156873727, model.schedules().get(0).rampDownCapacityThresholdPct()); + ScalingPlanPatch model = BinaryData.fromString( + "{\"tags\":{\"nyyazttbtwwrqpue\":\"ucoc\",\"xibxujwbhqwalm\":\"ckzywbiexzfeyue\",\"ux\":\"zyoxaepdkzjan\",\"zt\":\"hdwbavxbniwdjs\"},\"properties\":{\"description\":\"pgn\",\"friendlyName\":\"txhp\",\"timeZone\":\"bzpfzab\",\"exclusionTag\":\"cuh\",\"schedules\":[{\"name\":\"tyq\",\"daysOfWeek\":[\"Tuesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":2077643232,\"minute\":946920071},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1271650742,\"rampUpCapacityThresholdPct\":2103179015,\"peakStartTime\":{\"hour\":1239569697,\"minute\":35212160},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":615952432,\"minute\":230150141},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":439757511,\"rampDownCapacityThresholdPct\":941863244,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":74448491,\"rampDownNotificationMessage\":\"gmgsxnkjzkde\",\"offPeakStartTime\":{\"hour\":1710407502,\"minute\":571941714},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"yighxpk\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"aiuebbaumnyqu\",\"scalingPlanEnabled\":false},{\"hostPoolArmPath\":\"ojnabckhsmtxpsie\",\"scalingPlanEnabled\":true}]}}") + .toObject(ScalingPlanPatch.class); + Assertions.assertEquals("ucoc", model.tags().get("nyyazttbtwwrqpue")); + Assertions.assertEquals("pgn", model.description()); + Assertions.assertEquals("txhp", model.friendlyName()); + Assertions.assertEquals("bzpfzab", model.timeZone()); + Assertions.assertEquals("cuh", model.exclusionTag()); + Assertions.assertEquals("tyq", model.schedules().get(0).name()); + Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(2077643232, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(946920071, model.schedules().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1271650742, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(2103179015, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(1239569697, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(35212160, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(615952432, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(230150141, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(439757511, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(941863244, model.schedules().get(0).rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.schedules().get(0).rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(112236140, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("txfvjrbirph", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(1482882841, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(99482426, model.schedules().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("l", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertEquals(74448491, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("gmgsxnkjzkde", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(1710407502, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(571941714, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("yighxpk", model.hostPoolReferences().get(0).hostPoolArmPath()); Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPatch model = - new ScalingPlanPatch() - .withTags(mapOf("cukoklyaxuconu", "nmmqhgyxzkon", "pewr", "szfkbe")) - .withDescription("wv") - .withFriendlyName("ektcxsen") - .withTimeZone("lrsf") - .withExclusionTag("zpwv") - .withSchedules( - Arrays - .asList( - new ScalingSchedule() - .withName("gbiqylihkaet") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.SUNDAY)) - .withRampUpStartTime(new Time().withHour(493965696).withMinute(533172139)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1486569340) - .withRampUpCapacityThresholdPct(5394429) - .withPeakStartTime(new Time().withHour(1059821653).withMinute(2064900799)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(1887113058).withMinute(1657324555)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1278137451) - .withRampDownCapacityThresholdPct(156873727) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(112236140) - .withRampDownNotificationMessage("txfvjrbirph") - .withOffPeakStartTime(new Time().withHour(1482882841).withMinute(99482426)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule() - .withName("hfnljkyq") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.SATURDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY)) - .withRampUpStartTime(new Time().withHour(1054022835).withMinute(1970519416)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(552165564) - .withRampUpCapacityThresholdPct(2084359484) - .withPeakStartTime(new Time().withHour(10143119).withMinute(1108075171)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(649555961).withMinute(1685542215)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1059812914) - .withRampDownCapacityThresholdPct(1745548413) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(630804167) - .withRampDownNotificationMessage("zz") - .withOffPeakStartTime(new Time().withHour(1537141479).withMinute(1755265349)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule() - .withName("fvgxbfsmxneh") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.SUNDAY, - ScalingScheduleDaysOfWeekItem.SUNDAY)) - .withRampUpStartTime(new Time().withHour(1976417253).withMinute(68854326)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(398257944) - .withRampUpCapacityThresholdPct(156663672) - .withPeakStartTime(new Time().withHour(1961052031).withMinute(1123544345)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(175699877).withMinute(481409327)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1920273783) - .withRampDownCapacityThresholdPct(905507147) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(1728715445) - .withRampDownNotificationMessage("cispnqzahmgkbr") - .withOffPeakStartTime(new Time().withHour(188498280).withMinute(1687540865)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), - new ScalingSchedule() - .withName("nuqqkpikadrgvt") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY)) - .withRampUpStartTime(new Time().withHour(122504841).withMinute(855671205)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(508085674) - .withRampUpCapacityThresholdPct(834922568) - .withPeakStartTime(new Time().withHour(698240356).withMinute(23060626)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(600405260).withMinute(1045715770)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(2136509867) - .withRampDownCapacityThresholdPct(1477198207) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(282629437) - .withRampDownNotificationMessage("runmp") - .withOffPeakStartTime(new Time().withHour(18555434).withMinute(808779778)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))) - .withHostPoolReferences( - Arrays - .asList( - new ScalingHostPoolReference().withHostPoolArmPath("l").withScalingPlanEnabled(false), - new ScalingHostPoolReference() - .withHostPoolArmPath("myskpbhenbtkcxy") - .withScalingPlanEnabled(false), - new ScalingHostPoolReference().withHostPoolArmPath("nrs").withScalingPlanEnabled(false), - new ScalingHostPoolReference() - .withHostPoolArmPath("idybyxczf") - .withScalingPlanEnabled(true))); + ScalingPlanPatch model = new ScalingPlanPatch() + .withTags(mapOf("nyyazttbtwwrqpue", "ucoc", "xibxujwbhqwalm", "ckzywbiexzfeyue", "ux", "zyoxaepdkzjan", + "zt", "hdwbavxbniwdjs")) + .withDescription("pgn") + .withFriendlyName("txhp") + .withTimeZone("bzpfzab") + .withExclusionTag("cuh") + .withSchedules(Arrays.asList(new ScalingSchedule().withName("tyq") + .withDaysOfWeek( + Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.TUESDAY)) + .withRampUpStartTime(new Time().withHour(2077643232).withMinute(946920071)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1271650742) + .withRampUpCapacityThresholdPct(2103179015) + .withPeakStartTime(new Time().withHour(1239569697).withMinute(35212160)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(615952432).withMinute(230150141)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(439757511) + .withRampDownCapacityThresholdPct(941863244) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) + .withRampDownWaitTimeMinutes(74448491) + .withRampDownNotificationMessage("gmgsxnkjzkde") + .withOffPeakStartTime(new Time().withHour(1710407502).withMinute(571941714)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) + .withHostPoolReferences(Arrays.asList( + new ScalingHostPoolReference().withHostPoolArmPath("yighxpk").withScalingPlanEnabled(false), + new ScalingHostPoolReference().withHostPoolArmPath("aiuebbaumnyqu").withScalingPlanEnabled(false), + new ScalingHostPoolReference().withHostPoolArmPath("ojnabckhsmtxpsie").withScalingPlanEnabled(true))); model = BinaryData.fromObject(model).toObject(ScalingPlanPatch.class); - Assertions.assertEquals("nmmqhgyxzkon", model.tags().get("cukoklyaxuconu")); - Assertions.assertEquals("wv", model.description()); - Assertions.assertEquals("ektcxsen", model.friendlyName()); - Assertions.assertEquals("lrsf", model.timeZone()); - Assertions.assertEquals("zpwv", model.exclusionTag()); - Assertions.assertEquals("gbiqylihkaet", model.schedules().get(0).name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.THURSDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(493965696, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(533172139, model.schedules().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1486569340, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(5394429, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1059821653, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(2064900799, model.schedules().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1887113058, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1657324555, model.schedules().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1278137451, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(156873727, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals("ucoc", model.tags().get("nyyazttbtwwrqpue")); + Assertions.assertEquals("pgn", model.description()); + Assertions.assertEquals("txhp", model.friendlyName()); + Assertions.assertEquals("bzpfzab", model.timeZone()); + Assertions.assertEquals("cuh", model.exclusionTag()); + Assertions.assertEquals("tyq", model.schedules().get(0).name()); + Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.schedules().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(2077643232, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(946920071, model.schedules().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1271650742, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(2103179015, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(1239569697, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(35212160, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(615952432, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(230150141, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(439757511, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(941863244, model.schedules().get(0).rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.schedules().get(0).rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(112236140, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("txfvjrbirph", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(1482882841, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(99482426, model.schedules().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("l", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertEquals(74448491, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("gmgsxnkjzkde", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(1710407502, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(571941714, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("yighxpk", model.hostPoolReferences().get(0).hostPoolArmPath()); Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java index 3c3849a056fe..4add9625990c 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleInnerTests.java @@ -17,103 +17,100 @@ public final class ScalingPlanPersonalScheduleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPersonalScheduleInner model = - BinaryData - .fromString( - "{\"properties\":{\"daysOfWeek\":[\"Monday\",\"Friday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":1500766151,\"minute\":1796159221},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":1230471233,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":2000011197,\"peakStartTime\":{\"hour\":1573909011,\"minute\":2050375248},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":613009021,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":119641642,\"rampDownStartTime\":{\"hour\":939730908,\"minute\":1520557842},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":282783230,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":538641166,\"offPeakStartTime\":{\"hour\":1437797215,\"minute\":953152084},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":591532413,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":994320059},\"id\":\"t\",\"name\":\"oellwp\",\"type\":\"fdygpfqbuaceopz\"}") - .toObject(ScalingPlanPersonalScheduleInner.class); - Assertions.assertEquals(DayOfWeek.MONDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1500766151, model.rampUpStartTime().hour()); - Assertions.assertEquals(1796159221, model.rampUpStartTime().minute()); + ScalingPlanPersonalScheduleInner model = BinaryData.fromString( + "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Tuesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":1065588244,\"minute\":661321063},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1576761958,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":221682106,\"peakStartTime\":{\"hour\":1461039431,\"minute\":478088407},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":351399226,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":1602354627,\"rampDownStartTime\":{\"hour\":1547170393,\"minute\":1804869047},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":855265021,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":1314959549,\"offPeakStartTime\":{\"hour\":2090636723,\"minute\":668834645},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":34322019,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":1757404890},\"id\":\"vetvt\",\"name\":\"qaqtdoqmcbxvwvxy\",\"type\":\"lqbhsf\"}") + .toObject(ScalingPlanPersonalScheduleInner.class); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(1065588244, model.rampUpStartTime().hour()); + Assertions.assertEquals(661321063, model.rampUpStartTime().minute()); Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1230471233, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(1576761958, model.rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(2000011197, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1573909011, model.peakStartTime().hour()); - Assertions.assertEquals(2050375248, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnDisconnect()); - Assertions.assertEquals(613009021, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnLogoff()); - Assertions.assertEquals(119641642, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(939730908, model.rampDownStartTime().hour()); - Assertions.assertEquals(1520557842, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(282783230, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(538641166, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1437797215, model.offPeakStartTime().hour()); - Assertions.assertEquals(953152084, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(591532413, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(221682106, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(1461039431, model.peakStartTime().hour()); + Assertions.assertEquals(478088407, model.peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(351399226, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); + Assertions.assertEquals(1602354627, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1547170393, model.rampDownStartTime().hour()); + Assertions.assertEquals(1804869047, model.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(855265021, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(1314959549, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(2090636723, model.offPeakStartTime().hour()); + Assertions.assertEquals(668834645, model.offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(34322019, model.offPeakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(994320059, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1757404890, model.offPeakMinutesToWaitOnLogoff()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPersonalScheduleInner model = - new ScalingPlanPersonalScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.FRIDAY, DayOfWeek.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(1500766151).withMinute(1796159221)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(1230471233) - .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampUpMinutesToWaitOnLogoff(2000011197) - .withPeakStartTime(new Time().withHour(1573909011).withMinute(2050375248)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(613009021) - .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnLogoff(119641642) - .withRampDownStartTime(new Time().withHour(939730908).withMinute(1520557842)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnDisconnect(282783230) - .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnLogoff(538641166) - .withOffPeakStartTime(new Time().withHour(1437797215).withMinute(953152084)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(591532413) - .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnLogoff(994320059); + ScalingPlanPersonalScheduleInner model = new ScalingPlanPersonalScheduleInner() + .withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.TUESDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(1065588244).withMinute(661321063)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnDisconnect(1576761958) + .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampUpMinutesToWaitOnLogoff(221682106) + .withPeakStartTime(new Time().withHour(1461039431).withMinute(478088407)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnDisconnect(351399226) + .withPeakActionOnLogoff(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnLogoff(1602354627) + .withRampDownStartTime(new Time().withHour(1547170393).withMinute(1804869047)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnDisconnect(855265021) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(1314959549) + .withOffPeakStartTime(new Time().withHour(2090636723).withMinute(668834645)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnDisconnect(34322019) + .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnLogoff(1757404890); model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalScheduleInner.class); - Assertions.assertEquals(DayOfWeek.MONDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1500766151, model.rampUpStartTime().hour()); - Assertions.assertEquals(1796159221, model.rampUpStartTime().minute()); + Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(1065588244, model.rampUpStartTime().hour()); + Assertions.assertEquals(661321063, model.rampUpStartTime().minute()); Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1230471233, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(1576761958, model.rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(2000011197, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1573909011, model.peakStartTime().hour()); - Assertions.assertEquals(2050375248, model.peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnDisconnect()); - Assertions.assertEquals(613009021, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnLogoff()); - Assertions.assertEquals(119641642, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(939730908, model.rampDownStartTime().hour()); - Assertions.assertEquals(1520557842, model.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(282783230, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(538641166, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1437797215, model.offPeakStartTime().hour()); - Assertions.assertEquals(953152084, model.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(591532413, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(221682106, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(1461039431, model.peakStartTime().hour()); + Assertions.assertEquals(478088407, model.peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(351399226, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); + Assertions.assertEquals(1602354627, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1547170393, model.rampDownStartTime().hour()); + Assertions.assertEquals(1804869047, model.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(855265021, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(1314959549, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(2090636723, model.offPeakStartTime().hour()); + Assertions.assertEquals(668834645, model.offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(34322019, model.offPeakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(994320059, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1757404890, model.offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java index 9da203c65086..c7d3a679a976 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalScheduleListTests.java @@ -18,137 +18,101 @@ public final class ScalingPlanPersonalScheduleListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPersonalScheduleList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Tuesday\",\"Tuesday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":1296787469,\"minute\":693295515},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":1336387683,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":520113589,\"peakStartTime\":{\"hour\":1577221415,\"minute\":1359376561},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":932797807,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":567516658,\"rampDownStartTime\":{\"hour\":475216783,\"minute\":392993819},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":249445305,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1060545026,\"offPeakStartTime\":{\"hour\":181665784,\"minute\":94266347},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Deallocate\",\"offPeakMinutesToWaitOnDisconnect\":655886827,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":794984845},\"id\":\"jbi\",\"name\":\"xb\",\"type\":\"ybsrfbjfdtwss\"},{\"properties\":{\"daysOfWeek\":[\"Friday\",\"Tuesday\",\"Monday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":1933405011,\"minute\":1814798864},\"rampUpAutoStartHosts\":\"WithAssignedUser\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":267122524,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1827654965,\"peakStartTime\":{\"hour\":1651928304,\"minute\":600094153},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":623539244,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":994022828,\"rampDownStartTime\":{\"hour\":2112344615,\"minute\":1589023977},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":778428037,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":524895743,\"offPeakStartTime\":{\"hour\":1598094804,\"minute\":2026519653},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":1059734695,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":432099850},\"id\":\"pehindoygm\",\"name\":\"fthnzdn\",\"type\":\"sl\"}],\"nextLink\":\"ayqigynduhav\"}") - .toObject(ScalingPlanPersonalScheduleList.class); + ScalingPlanPersonalScheduleList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Tuesday\",\"Saturday\",\"Monday\"],\"rampUpStartTime\":{\"hour\":1130044611,\"minute\":1074784162},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":432099850,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1479768723,\"peakStartTime\":{\"hour\":681452902,\"minute\":1729172335},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":1126761283,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":132200951,\"rampDownStartTime\":{\"hour\":1800612686,\"minute\":294736838},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":782103033,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1427716289,\"offPeakStartTime\":{\"hour\":1655484798,\"minute\":2047683473},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1924710891,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":1117250592},\"id\":\"qolbgyc\",\"name\":\"uie\",\"type\":\"tgccymvaolpss\"}],\"nextLink\":\"lfmmdnbbglzpswi\"}") + .toObject(ScalingPlanPersonalScheduleList.class); Assertions.assertEquals(DayOfWeek.TUESDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(1296787469, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(693295515, model.value().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.value().get(0).rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).rampUpStartVMOnConnect()); + Assertions.assertEquals(1130044611, model.value().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1074784162, model.value().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.value().get(0).rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).rampUpStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampUpActionOnDisconnect()); - Assertions.assertEquals(1336387683, model.value().get(0).rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(432099850, model.value().get(0).rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).rampUpActionOnLogoff()); - Assertions.assertEquals(520113589, model.value().get(0).rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1577221415, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(1359376561, model.value().get(0).peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).peakActionOnDisconnect()); - Assertions.assertEquals(932797807, model.value().get(0).peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).peakActionOnLogoff()); - Assertions.assertEquals(567516658, model.value().get(0).peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(475216783, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(392993819, model.value().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampDownActionOnDisconnect()); - Assertions.assertEquals(249445305, model.value().get(0).rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(1479768723, model.value().get(0).rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(681452902, model.value().get(0).peakStartTime().hour()); + Assertions.assertEquals(1729172335, model.value().get(0).peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).peakActionOnDisconnect()); + Assertions.assertEquals(1126761283, model.value().get(0).peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).peakActionOnLogoff()); + Assertions.assertEquals(132200951, model.value().get(0).peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1800612686, model.value().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(294736838, model.value().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).rampDownActionOnDisconnect()); + Assertions.assertEquals(782103033, model.value().get(0).rampDownMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampDownActionOnLogoff()); - Assertions.assertEquals(1060545026, model.value().get(0).rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(181665784, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(94266347, model.value().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(1427716289, model.value().get(0).rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1655484798, model.value().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(2047683473, model.value().get(0).offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).offPeakActionOnDisconnect()); - Assertions.assertEquals(655886827, model.value().get(0).offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).offPeakActionOnLogoff()); - Assertions.assertEquals(794984845, model.value().get(0).offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).offPeakActionOnDisconnect()); + Assertions.assertEquals(1924710891, model.value().get(0).offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).offPeakActionOnLogoff()); + Assertions.assertEquals(1117250592, model.value().get(0).offPeakMinutesToWaitOnLogoff()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPersonalScheduleList model = - new ScalingPlanPersonalScheduleList() - .withValue( - Arrays - .asList( - new ScalingPlanPersonalScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY, DayOfWeek.TUESDAY, DayOfWeek.THURSDAY)) - .withRampUpStartTime(new Time().withHour(1296787469).withMinute(693295515)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(1336387683) - .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampUpMinutesToWaitOnLogoff(520113589) - .withPeakStartTime(new Time().withHour(1577221415).withMinute(1359376561)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnDisconnect(932797807) - .withPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnLogoff(567516658) - .withRampDownStartTime(new Time().withHour(475216783).withMinute(392993819)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(249445305) - .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnLogoff(1060545026) - .withOffPeakStartTime(new Time().withHour(181665784).withMinute(94266347)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnDisconnect(655886827) - .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnLogoff(794984845), - new ScalingPlanPersonalScheduleInner() - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.FRIDAY, DayOfWeek.TUESDAY, DayOfWeek.MONDAY, DayOfWeek.SUNDAY)) - .withRampUpStartTime(new Time().withHour(1933405011).withMinute(1814798864)) - .withRampUpAutoStartHosts(StartupBehavior.WITH_ASSIGNED_USER) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(267122524) - .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampUpMinutesToWaitOnLogoff(1827654965) - .withPeakStartTime(new Time().withHour(1651928304).withMinute(600094153)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(623539244) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(994022828) - .withRampDownStartTime(new Time().withHour(2112344615).withMinute(1589023977)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(778428037) - .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnLogoff(524895743) - .withOffPeakStartTime(new Time().withHour(1598094804).withMinute(2026519653)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(1059734695) - .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnLogoff(432099850))); + ScalingPlanPersonalScheduleList model + = new ScalingPlanPersonalScheduleList().withValue(Arrays.asList(new ScalingPlanPersonalScheduleInner() + .withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY, DayOfWeek.SATURDAY, DayOfWeek.MONDAY)) + .withRampUpStartTime(new Time().withHour(1130044611).withMinute(1074784162)) + .withRampUpAutoStartHosts(StartupBehavior.NONE) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampUpMinutesToWaitOnDisconnect(432099850) + .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampUpMinutesToWaitOnLogoff(1479768723) + .withPeakStartTime(new Time().withHour(681452902).withMinute(1729172335)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(1126761283) + .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnLogoff(132200951) + .withRampDownStartTime(new Time().withHour(1800612686).withMinute(294736838)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnDisconnect(782103033) + .withRampDownActionOnLogoff(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnLogoff(1427716289) + .withOffPeakStartTime(new Time().withHour(1655484798).withMinute(2047683473)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnDisconnect(1924710891) + .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withOffPeakMinutesToWaitOnLogoff(1117250592))); model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalScheduleList.class); Assertions.assertEquals(DayOfWeek.TUESDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(1296787469, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(693295515, model.value().get(0).rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.value().get(0).rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).rampUpStartVMOnConnect()); + Assertions.assertEquals(1130044611, model.value().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1074784162, model.value().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.value().get(0).rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).rampUpStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampUpActionOnDisconnect()); - Assertions.assertEquals(1336387683, model.value().get(0).rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(432099850, model.value().get(0).rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).rampUpActionOnLogoff()); - Assertions.assertEquals(520113589, model.value().get(0).rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1577221415, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(1359376561, model.value().get(0).peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).peakActionOnDisconnect()); - Assertions.assertEquals(932797807, model.value().get(0).peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).peakActionOnLogoff()); - Assertions.assertEquals(567516658, model.value().get(0).peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(475216783, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(392993819, model.value().get(0).rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.value().get(0).rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampDownActionOnDisconnect()); - Assertions.assertEquals(249445305, model.value().get(0).rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(1479768723, model.value().get(0).rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(681452902, model.value().get(0).peakStartTime().hour()); + Assertions.assertEquals(1729172335, model.value().get(0).peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).peakActionOnDisconnect()); + Assertions.assertEquals(1126761283, model.value().get(0).peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).peakActionOnLogoff()); + Assertions.assertEquals(132200951, model.value().get(0).peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1800612686, model.value().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(294736838, model.value().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).rampDownActionOnDisconnect()); + Assertions.assertEquals(782103033, model.value().get(0).rampDownMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.value().get(0).rampDownActionOnLogoff()); - Assertions.assertEquals(1060545026, model.value().get(0).rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(181665784, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(94266347, model.value().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(1427716289, model.value().get(0).rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1655484798, model.value().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(2047683473, model.value().get(0).offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.value().get(0).offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).offPeakActionOnDisconnect()); - Assertions.assertEquals(655886827, model.value().get(0).offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).offPeakActionOnLogoff()); - Assertions.assertEquals(794984845, model.value().get(0).offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.value().get(0).offPeakActionOnDisconnect()); + Assertions.assertEquals(1924710891, model.value().get(0).offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.value().get(0).offPeakActionOnLogoff()); + Assertions.assertEquals(1117250592, model.value().get(0).offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java index 8660dc9d93da..387b767cce66 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePatchTests.java @@ -17,103 +17,100 @@ public final class ScalingPlanPersonalSchedulePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPersonalSchedulePatch model = - BinaryData - .fromString( - "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":256415791,\"minute\":1905459835},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":258725864,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1042702068,\"peakStartTime\":{\"hour\":1688847935,\"minute\":1314959549},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":928593835,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":2022160914,\"rampDownStartTime\":{\"hour\":1631327314,\"minute\":1757404890},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":43385515,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":928990245,\"offPeakStartTime\":{\"hour\":1261594790,\"minute\":1493412527},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Deallocate\",\"offPeakMinutesToWaitOnDisconnect\":1076611714,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":76309450}}") - .toObject(ScalingPlanPersonalSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(256415791, model.rampUpStartTime().hour()); - Assertions.assertEquals(1905459835, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); + ScalingPlanPersonalSchedulePatch model = BinaryData.fromString( + "{\"properties\":{\"daysOfWeek\":[\"Friday\",\"Monday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":2111014163,\"minute\":716024879},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":1365200524,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1553831435,\"peakStartTime\":{\"hour\":874148827,\"minute\":1616367631},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":1579331831,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":2126872967,\"rampDownStartTime\":{\"hour\":1133541665,\"minute\":956114198},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":1787439694,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":477944589,\"offPeakStartTime\":{\"hour\":1477938118,\"minute\":1757000388},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"None\",\"offPeakMinutesToWaitOnDisconnect\":1420775781,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":734102755}}") + .toObject(ScalingPlanPersonalSchedulePatch.class); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(2111014163, model.rampUpStartTime().hour()); + Assertions.assertEquals(716024879, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(258725864, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(1365200524, model.rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(1042702068, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1688847935, model.peakStartTime().hour()); - Assertions.assertEquals(1314959549, model.peakStartTime().minute()); + Assertions.assertEquals(1553831435, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(874148827, model.peakStartTime().hour()); + Assertions.assertEquals(1616367631, model.peakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(928593835, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnLogoff()); - Assertions.assertEquals(2022160914, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1631327314, model.rampDownStartTime().hour()); - Assertions.assertEquals(1757404890, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(1579331831, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); + Assertions.assertEquals(2126872967, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1133541665, model.rampDownStartTime().hour()); + Assertions.assertEquals(956114198, model.rampDownStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(43385515, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(928990245, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1261594790, model.offPeakStartTime().hour()); - Assertions.assertEquals(1493412527, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(1787439694, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(477944589, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1477938118, model.offPeakStartTime().hour()); + Assertions.assertEquals(1757000388, model.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1076611714, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(76309450, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(1420775781, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); + Assertions.assertEquals(734102755, model.offPeakMinutesToWaitOnLogoff()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPersonalSchedulePatch model = - new ScalingPlanPersonalSchedulePatch() - .withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(256415791).withMinute(1905459835)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(258725864) - .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnLogoff(1042702068) - .withPeakStartTime(new Time().withHour(1688847935).withMinute(1314959549)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnDisconnect(928593835) - .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnLogoff(2022160914) - .withRampDownStartTime(new Time().withHour(1631327314).withMinute(1757404890)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(43385515) - .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnLogoff(928990245) - .withOffPeakStartTime(new Time().withHour(1261594790).withMinute(1493412527)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnDisconnect(1076611714) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(76309450); + ScalingPlanPersonalSchedulePatch model = new ScalingPlanPersonalSchedulePatch() + .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.MONDAY, DayOfWeek.SATURDAY)) + .withRampUpStartTime(new Time().withHour(2111014163).withMinute(716024879)) + .withRampUpAutoStartHosts(StartupBehavior.NONE) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnDisconnect(1365200524) + .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnLogoff(1553831435) + .withPeakStartTime(new Time().withHour(874148827).withMinute(1616367631)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withPeakMinutesToWaitOnDisconnect(1579331831) + .withPeakActionOnLogoff(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnLogoff(2126872967) + .withRampDownStartTime(new Time().withHour(1133541665).withMinute(956114198)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnDisconnect(1787439694) + .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampDownMinutesToWaitOnLogoff(477944589) + .withOffPeakStartTime(new Time().withHour(1477938118).withMinute(1757000388)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withOffPeakMinutesToWaitOnDisconnect(1420775781) + .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnLogoff(734102755); model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(256415791, model.rampUpStartTime().hour()); - Assertions.assertEquals(1905459835, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); + Assertions.assertEquals(DayOfWeek.FRIDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(2111014163, model.rampUpStartTime().hour()); + Assertions.assertEquals(716024879, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(258725864, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(1365200524, model.rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(1042702068, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(1688847935, model.peakStartTime().hour()); - Assertions.assertEquals(1314959549, model.peakStartTime().minute()); + Assertions.assertEquals(1553831435, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(874148827, model.peakStartTime().hour()); + Assertions.assertEquals(1616367631, model.peakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(928593835, model.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnLogoff()); - Assertions.assertEquals(2022160914, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1631327314, model.rampDownStartTime().hour()); - Assertions.assertEquals(1757404890, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.peakActionOnDisconnect()); + Assertions.assertEquals(1579331831, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); + Assertions.assertEquals(2126872967, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1133541665, model.rampDownStartTime().hour()); + Assertions.assertEquals(956114198, model.rampDownStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(43385515, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(928990245, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(1261594790, model.offPeakStartTime().hour()); - Assertions.assertEquals(1493412527, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(1787439694, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(477944589, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1477938118, model.offPeakStartTime().hour()); + Assertions.assertEquals(1757000388, model.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.offPeakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(1076611714, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(76309450, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnDisconnect()); + Assertions.assertEquals(1420775781, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); + Assertions.assertEquals(734102755, model.offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java index 325afcc7611b..5c17c0cf5a26 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulePropertiesTests.java @@ -17,104 +17,100 @@ public final class ScalingPlanPersonalSchedulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPersonalScheduleProperties model = - BinaryData - .fromString( - "{\"daysOfWeek\":[\"Thursday\",\"Monday\",\"Wednesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":90973381,\"minute\":284689658},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":1990032205,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":1114534772,\"peakStartTime\":{\"hour\":883110642,\"minute\":1247520399},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":1114721091,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":1356840761,\"rampDownStartTime\":{\"hour\":1358257343,\"minute\":2138169830},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":919813735,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":159831897,\"offPeakStartTime\":{\"hour\":527212463,\"minute\":1504791861},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":529783276,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":478088407}") - .toObject(ScalingPlanPersonalScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(90973381, model.rampUpStartTime().hour()); - Assertions.assertEquals(284689658, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1990032205, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(1114534772, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(883110642, model.peakStartTime().hour()); - Assertions.assertEquals(1247520399, model.peakStartTime().minute()); + ScalingPlanPersonalScheduleProperties model = BinaryData.fromString( + "{\"daysOfWeek\":[\"Tuesday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":97190015,\"minute\":2053949685},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Deallocate\",\"rampUpMinutesToWaitOnDisconnect\":520113589,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1139203375,\"peakStartTime\":{\"hour\":910036850,\"minute\":237271167},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":567516658,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":1216343785,\"rampDownStartTime\":{\"hour\":1861824237,\"minute\":1416358219},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":1060545026,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":1893739141,\"offPeakStartTime\":{\"hour\":1393923794,\"minute\":818264004},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":794984845,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1379318840}") + .toObject(ScalingPlanPersonalScheduleProperties.class); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(97190015, model.rampUpStartTime().hour()); + Assertions.assertEquals(2053949685, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(520113589, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); + Assertions.assertEquals(1139203375, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(910036850, model.peakStartTime().hour()); + Assertions.assertEquals(237271167, model.peakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(1114721091, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnDisconnect()); + Assertions.assertEquals(567516658, model.peakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(1356840761, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1358257343, model.rampDownStartTime().hour()); - Assertions.assertEquals(2138169830, model.rampDownStartTime().minute()); + Assertions.assertEquals(1216343785, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1861824237, model.rampDownStartTime().hour()); + Assertions.assertEquals(1416358219, model.rampDownStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(919813735, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(159831897, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(527212463, model.offPeakStartTime().hour()); - Assertions.assertEquals(1504791861, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(1060545026, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(1893739141, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1393923794, model.offPeakStartTime().hour()); + Assertions.assertEquals(818264004, model.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.offPeakStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(529783276, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(478088407, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(794984845, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); + Assertions.assertEquals(1379318840, model.offPeakMinutesToWaitOnLogoff()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPersonalScheduleProperties model = - new ScalingPlanPersonalScheduleProperties() - .withDaysOfWeek( - Arrays.asList(DayOfWeek.THURSDAY, DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(90973381).withMinute(284689658)) - .withRampUpAutoStartHosts(StartupBehavior.ALL) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnDisconnect(1990032205) - .withRampUpActionOnLogoff(SessionHandlingOperation.NONE) - .withRampUpMinutesToWaitOnLogoff(1114534772) - .withPeakStartTime(new Time().withHour(883110642).withMinute(1247520399)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withPeakMinutesToWaitOnDisconnect(1114721091) - .withPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnLogoff(1356840761) - .withRampDownStartTime(new Time().withHour(1358257343).withMinute(2138169830)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampDownMinutesToWaitOnDisconnect(919813735) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(159831897) - .withOffPeakStartTime(new Time().withHour(527212463).withMinute(1504791861)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withOffPeakMinutesToWaitOnDisconnect(529783276) - .withOffPeakActionOnLogoff(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnLogoff(478088407); + ScalingPlanPersonalScheduleProperties model = new ScalingPlanPersonalScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY, DayOfWeek.THURSDAY)) + .withRampUpStartTime(new Time().withHour(97190015).withMinute(2053949685)) + .withRampUpAutoStartHosts(StartupBehavior.NONE) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.DEALLOCATE) + .withRampUpMinutesToWaitOnDisconnect(520113589) + .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnLogoff(1139203375) + .withPeakStartTime(new Time().withHour(910036850).withMinute(237271167)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnDisconnect(567516658) + .withPeakActionOnLogoff(SessionHandlingOperation.NONE) + .withPeakMinutesToWaitOnLogoff(1216343785) + .withRampDownStartTime(new Time().withHour(1861824237).withMinute(1416358219)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(1060545026) + .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnLogoff(1893739141) + .withOffPeakStartTime(new Time().withHour(1393923794).withMinute(818264004)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnDisconnect(794984845) + .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnLogoff(1379318840); model = BinaryData.fromObject(model).toObject(ScalingPlanPersonalScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.THURSDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(90973381, model.rampUpStartTime().hour()); - Assertions.assertEquals(284689658, model.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, model.rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnDisconnect()); - Assertions.assertEquals(1990032205, model.rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampUpActionOnLogoff()); - Assertions.assertEquals(1114534772, model.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(883110642, model.peakStartTime().hour()); - Assertions.assertEquals(1247520399, model.peakStartTime().minute()); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(97190015, model.rampUpStartTime().hour()); + Assertions.assertEquals(2053949685, model.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, model.rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampUpActionOnDisconnect()); + Assertions.assertEquals(520113589, model.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampUpActionOnLogoff()); + Assertions.assertEquals(1139203375, model.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(910036850, model.peakStartTime().hour()); + Assertions.assertEquals(237271167, model.peakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.peakActionOnDisconnect()); - Assertions.assertEquals(1114721091, model.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnDisconnect()); + Assertions.assertEquals(567516658, model.peakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.NONE, model.peakActionOnLogoff()); - Assertions.assertEquals(1356840761, model.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(1358257343, model.rampDownStartTime().hour()); - Assertions.assertEquals(2138169830, model.rampDownStartTime().minute()); + Assertions.assertEquals(1216343785, model.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1861824237, model.rampDownStartTime().hour()); + Assertions.assertEquals(1416358219, model.rampDownStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, model.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnDisconnect()); - Assertions.assertEquals(919813735, model.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, model.rampDownActionOnLogoff()); - Assertions.assertEquals(159831897, model.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(527212463, model.offPeakStartTime().hour()); - Assertions.assertEquals(1504791861, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.NONE, model.rampDownActionOnDisconnect()); + Assertions.assertEquals(1060545026, model.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.rampDownActionOnLogoff()); + Assertions.assertEquals(1893739141, model.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1393923794, model.offPeakStartTime().hour()); + Assertions.assertEquals(818264004, model.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, model.offPeakStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnDisconnect()); - Assertions.assertEquals(529783276, model.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, model.offPeakActionOnLogoff()); - Assertions.assertEquals(478088407, model.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(794984845, model.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, model.offPeakActionOnLogoff()); + Assertions.assertEquals(1379318840, model.offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java index e2540474a270..b14ff1062419 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesCreateWithResponseMockTests.java @@ -6,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; @@ -18,116 +16,86 @@ import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPersonalSchedulesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"daysOfWeek\":[\"Friday\"],\"rampUpStartTime\":{\"hour\":410887908,\"minute\":1078545272},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Deallocate\",\"rampUpMinutesToWaitOnDisconnect\":584168937,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1034337618,\"peakStartTime\":{\"hour\":310367728,\"minute\":2099611502},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":1763617442,\"peakActionOnLogoff\":\"None\",\"peakMinutesToWaitOnLogoff\":547069832,\"rampDownStartTime\":{\"hour\":401939336,\"minute\":485663577},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":834235749,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":1413642651,\"offPeakStartTime\":{\"hour\":1232350365,\"minute\":656399594},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":489491649,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":824374091},\"id\":\"s\",\"name\":\"qwjksghudgz\",\"type\":\"xog\"}"; - String responseStr = - "{\"properties\":{\"daysOfWeek\":[\"Thursday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":474729802,\"minute\":513283107},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"None\",\"rampUpMinutesToWaitOnDisconnect\":120570270,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1801029414,\"peakStartTime\":{\"hour\":2013893290,\"minute\":728731016},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":956531866,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":1159295504,\"rampDownStartTime\":{\"hour\":881600617,\"minute\":323271862},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Hibernate\",\"rampDownMinutesToWaitOnDisconnect\":643996998,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1995436037,\"offPeakStartTime\":{\"hour\":429676827,\"minute\":550582192},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":420064622,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":617111065},\"id\":\"iroqbosh\",\"name\":\"ragapyyrmfsvbp\",\"type\":\"vbopfppdbwnu\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + ScalingPlanPersonalSchedule response = manager.scalingPlanPersonalSchedules() + .define("rwgdnqzbrfks") + .withExistingScalingPlan("mzegjon", "hj") + .withDaysOfWeek(Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.SATURDAY)) + .withRampUpStartTime(new Time().withHour(523241538).withMinute(794113784)) + .withRampUpAutoStartHosts(StartupBehavior.ALL) + .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withRampUpMinutesToWaitOnDisconnect(1846207781) + .withRampUpActionOnLogoff(SessionHandlingOperation.DEALLOCATE) + .withRampUpMinutesToWaitOnLogoff(2086929658) + .withPeakStartTime(new Time().withHour(1354192290).withMinute(2141124487)) + .withPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnDisconnect(918177081) + .withPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withPeakMinutesToWaitOnLogoff(1908248061) + .withRampDownStartTime(new Time().withHour(1256156886).withMinute(2004448547)) + .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) + .withRampDownMinutesToWaitOnDisconnect(2002444871) + .withRampDownActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withRampDownMinutesToWaitOnLogoff(1777257386) + .withOffPeakStartTime(new Time().withHour(1822893044).withMinute(563407576)) + .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) + .withOffPeakActionOnDisconnect(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnDisconnect(1511444784) + .withOffPeakActionOnLogoff(SessionHandlingOperation.HIBERNATE) + .withOffPeakMinutesToWaitOnLogoff(835259898) + .create(); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPersonalSchedule response = - manager - .scalingPlanPersonalSchedules() - .define("tlyo") - .withExistingScalingPlan("xbannovvoxc", "ytprwnwvroev") - .withDaysOfWeek( - Arrays.asList(DayOfWeek.FRIDAY, DayOfWeek.MONDAY, DayOfWeek.WEDNESDAY, DayOfWeek.MONDAY)) - .withRampUpStartTime(new Time().withHour(725083050).withMinute(1442660338)) - .withRampUpAutoStartHosts(StartupBehavior.NONE) - .withRampUpStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampUpActionOnDisconnect(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnDisconnect(251649293) - .withRampUpActionOnLogoff(SessionHandlingOperation.HIBERNATE) - .withRampUpMinutesToWaitOnLogoff(1458275962) - .withPeakStartTime(new Time().withHour(952405971).withMinute(1835764964)) - .withPeakStartVMOnConnect(SetStartVMOnConnect.ENABLE) - .withPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withPeakMinutesToWaitOnDisconnect(61809023) - .withPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withPeakMinutesToWaitOnLogoff(552291505) - .withRampDownStartTime(new Time().withHour(796000684).withMinute(312997434)) - .withRampDownStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withRampDownActionOnDisconnect(SessionHandlingOperation.NONE) - .withRampDownMinutesToWaitOnDisconnect(1195443779) - .withRampDownActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withRampDownMinutesToWaitOnLogoff(1597074926) - .withOffPeakStartTime(new Time().withHour(1352836682).withMinute(315314299)) - .withOffPeakStartVMOnConnect(SetStartVMOnConnect.DISABLE) - .withOffPeakActionOnDisconnect(SessionHandlingOperation.NONE) - .withOffPeakMinutesToWaitOnDisconnect(265709427) - .withOffPeakActionOnLogoff(SessionHandlingOperation.DEALLOCATE) - .withOffPeakMinutesToWaitOnLogoff(347000614) - .create(); - - Assertions.assertEquals(DayOfWeek.THURSDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(474729802, response.rampUpStartTime().hour()); - Assertions.assertEquals(513283107, response.rampUpStartTime().minute()); + Assertions.assertEquals(DayOfWeek.FRIDAY, response.daysOfWeek().get(0)); + Assertions.assertEquals(410887908, response.rampUpStartTime().hour()); + Assertions.assertEquals(1078545272, response.rampUpStartTime().minute()); Assertions.assertEquals(StartupBehavior.ALL, response.rampUpAutoStartHosts()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.rampUpStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampUpActionOnDisconnect()); - Assertions.assertEquals(120570270, response.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampUpActionOnDisconnect()); + Assertions.assertEquals(584168937, response.rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampUpActionOnLogoff()); - Assertions.assertEquals(1801029414, response.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(2013893290, response.peakStartTime().hour()); - Assertions.assertEquals(728731016, response.peakStartTime().minute()); + Assertions.assertEquals(1034337618, response.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(310367728, response.peakStartTime().hour()); + Assertions.assertEquals(2099611502, response.peakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.peakActionOnDisconnect()); - Assertions.assertEquals(956531866, response.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.peakActionOnLogoff()); - Assertions.assertEquals(1159295504, response.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(881600617, response.rampDownStartTime().hour()); - Assertions.assertEquals(323271862, response.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.peakActionOnDisconnect()); + Assertions.assertEquals(1763617442, response.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.peakActionOnLogoff()); + Assertions.assertEquals(547069832, response.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(401939336, response.rampDownStartTime().hour()); + Assertions.assertEquals(485663577, response.rampDownStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.rampDownActionOnDisconnect()); - Assertions.assertEquals(643996998, response.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampDownActionOnLogoff()); - Assertions.assertEquals(1995436037, response.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(429676827, response.offPeakStartTime().hour()); - Assertions.assertEquals(550582192, response.offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampDownActionOnDisconnect()); + Assertions.assertEquals(834235749, response.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampDownActionOnLogoff()); + Assertions.assertEquals(1413642651, response.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1232350365, response.offPeakStartTime().hour()); + Assertions.assertEquals(656399594, response.offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.offPeakStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.offPeakActionOnDisconnect()); - Assertions.assertEquals(420064622, response.offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.offPeakActionOnLogoff()); - Assertions.assertEquals(617111065, response.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(489491649, response.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.offPeakActionOnLogoff()); + Assertions.assertEquals(824374091, response.offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java index b29aa469df05..d9dc22556fe7 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesDeleteWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPersonalSchedulesDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.scalingPlanPersonalSchedules() + .deleteWithResponse("whmozusgzvlnsnnj", "fpafolpymwamxq", "rag", com.azure.core.util.Context.NONE); - manager - .scalingPlanPersonalSchedules() - .deleteWithResponse("qwtehtuevr", "rljyoogwxhnsdu", "gwbsreurf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java index e9d386b188d2..2301f163164e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesGetWithResponseMockTests.java @@ -6,98 +6,67 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPersonalSchedulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"daysOfWeek\":[\"Saturday\",\"Saturday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":1280282209,\"minute\":87714602},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":2014573492,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1515961977,\"peakStartTime\":{\"hour\":1015093902,\"minute\":1169828149},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Deallocate\",\"peakMinutesToWaitOnDisconnect\":926245450,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":1688935370,\"rampDownStartTime\":{\"hour\":1415978839,\"minute\":958462215},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":1099673066,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":1760855054,\"offPeakStartTime\":{\"hour\":980512005,\"minute\":1991575166},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":1928813132,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":243221217},\"id\":\"dxfzzzwyjaf\",\"name\":\"tlhguynuchl\",\"type\":\"mltx\"}"; - String responseStr = - "{\"properties\":{\"daysOfWeek\":[\"Wednesday\"],\"rampUpStartTime\":{\"hour\":504276200,\"minute\":273714552},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":837661803,\"rampUpActionOnLogoff\":\"Hibernate\",\"rampUpMinutesToWaitOnLogoff\":1248753250,\"peakStartTime\":{\"hour\":442073665,\"minute\":2020150927},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":792139303,\"peakActionOnLogoff\":\"Deallocate\",\"peakMinutesToWaitOnLogoff\":381107449,\"rampDownStartTime\":{\"hour\":639293987,\"minute\":685959660},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":1539061935,\"rampDownActionOnLogoff\":\"Hibernate\",\"rampDownMinutesToWaitOnLogoff\":1692137412,\"offPeakStartTime\":{\"hour\":45100221,\"minute\":758863003},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":2055999585,\"offPeakActionOnLogoff\":\"Hibernate\",\"offPeakMinutesToWaitOnLogoff\":1093469503},\"id\":\"hfhpfp\",\"name\":\"zjzoywjxhpdul\",\"type\":\"ntacn\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + ScalingPlanPersonalSchedule response = manager.scalingPlanPersonalSchedules() + .getWithResponse("lkujrllfojui", "jpu", "yjucejikzoeo", com.azure.core.util.Context.NONE) + .getValue(); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPersonalSchedule response = - manager - .scalingPlanPersonalSchedules() - .getWithResponse("byrplrohkpig", "fusuckzmkwklsno", "axmqeqal", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(DayOfWeek.WEDNESDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(504276200, response.rampUpStartTime().hour()); - Assertions.assertEquals(273714552, response.rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.ALL, response.rampUpAutoStartHosts()); + Assertions.assertEquals(DayOfWeek.SATURDAY, response.daysOfWeek().get(0)); + Assertions.assertEquals(1280282209, response.rampUpStartTime().hour()); + Assertions.assertEquals(87714602, response.rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.NONE, response.rampUpAutoStartHosts()); Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.rampUpStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.rampUpActionOnDisconnect()); - Assertions.assertEquals(837661803, response.rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(2014573492, response.rampUpMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.rampUpActionOnLogoff()); - Assertions.assertEquals(1248753250, response.rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(442073665, response.peakStartTime().hour()); - Assertions.assertEquals(2020150927, response.peakStartTime().minute()); + Assertions.assertEquals(1515961977, response.rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(1015093902, response.peakStartTime().hour()); + Assertions.assertEquals(1169828149, response.peakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.peakStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.peakActionOnDisconnect()); - Assertions.assertEquals(792139303, response.peakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.peakActionOnLogoff()); - Assertions.assertEquals(381107449, response.peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(639293987, response.rampDownStartTime().hour()); - Assertions.assertEquals(685959660, response.rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.rampDownActionOnDisconnect()); - Assertions.assertEquals(1539061935, response.rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.rampDownActionOnLogoff()); - Assertions.assertEquals(1692137412, response.rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(45100221, response.offPeakStartTime().hour()); - Assertions.assertEquals(758863003, response.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.peakActionOnDisconnect()); + Assertions.assertEquals(926245450, response.peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.peakActionOnLogoff()); + Assertions.assertEquals(1688935370, response.peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1415978839, response.rampDownStartTime().hour()); + Assertions.assertEquals(958462215, response.rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampDownActionOnDisconnect()); + Assertions.assertEquals(1099673066, response.rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.rampDownActionOnLogoff()); + Assertions.assertEquals(1760855054, response.rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(980512005, response.offPeakStartTime().hour()); + Assertions.assertEquals(1991575166, response.offPeakStartTime().minute()); Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.offPeakStartVMOnConnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.offPeakActionOnDisconnect()); - Assertions.assertEquals(2055999585, response.offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(1928813132, response.offPeakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.offPeakActionOnLogoff()); - Assertions.assertEquals(1093469503, response.offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(243221217, response.offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java index 2d5671df4cc3..28981bee30e2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPersonalSchedulesListMockTests.java @@ -6,101 +6,72 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation; import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect; import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPersonalSchedulesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Saturday\",\"Tuesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":2073233936,\"minute\":1865328530},\"rampUpAutoStartHosts\":\"All\",\"rampUpStartVMOnConnect\":\"Disable\",\"rampUpActionOnDisconnect\":\"Hibernate\",\"rampUpMinutesToWaitOnDisconnect\":794094890,\"rampUpActionOnLogoff\":\"None\",\"rampUpMinutesToWaitOnLogoff\":192074742,\"peakStartTime\":{\"hour\":794571898,\"minute\":1290986457},\"peakStartVMOnConnect\":\"Enable\",\"peakActionOnDisconnect\":\"None\",\"peakMinutesToWaitOnDisconnect\":1598896306,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":1282661494,\"rampDownStartTime\":{\"hour\":369643942,\"minute\":1501101823},\"rampDownStartVMOnConnect\":\"Disable\",\"rampDownActionOnDisconnect\":\"Deallocate\",\"rampDownMinutesToWaitOnDisconnect\":257622462,\"rampDownActionOnLogoff\":\"Deallocate\",\"rampDownMinutesToWaitOnLogoff\":457713777,\"offPeakStartTime\":{\"hour\":1945539207,\"minute\":1241650566},\"offPeakStartVMOnConnect\":\"Disable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":988758793,\"offPeakActionOnLogoff\":\"Deallocate\",\"offPeakMinutesToWaitOnLogoff\":1259722437},\"id\":\"hqvlnnpxybafiqg\",\"name\":\"aarbgjekg\",\"type\":\"klbyulidwcw\"}]}"; - String responseStr = - "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Saturday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":1124530948,\"minute\":499319607},\"rampUpAutoStartHosts\":\"None\",\"rampUpStartVMOnConnect\":\"Enable\",\"rampUpActionOnDisconnect\":\"Deallocate\",\"rampUpMinutesToWaitOnDisconnect\":1014248956,\"rampUpActionOnLogoff\":\"Deallocate\",\"rampUpMinutesToWaitOnLogoff\":1964077679,\"peakStartTime\":{\"hour\":325210544,\"minute\":2124129380},\"peakStartVMOnConnect\":\"Disable\",\"peakActionOnDisconnect\":\"Hibernate\",\"peakMinutesToWaitOnDisconnect\":543218524,\"peakActionOnLogoff\":\"Hibernate\",\"peakMinutesToWaitOnLogoff\":150528067,\"rampDownStartTime\":{\"hour\":20952661,\"minute\":1138832682},\"rampDownStartVMOnConnect\":\"Enable\",\"rampDownActionOnDisconnect\":\"None\",\"rampDownMinutesToWaitOnDisconnect\":996292120,\"rampDownActionOnLogoff\":\"None\",\"rampDownMinutesToWaitOnLogoff\":988577798,\"offPeakStartTime\":{\"hour\":290904524,\"minute\":1604128038},\"offPeakStartVMOnConnect\":\"Enable\",\"offPeakActionOnDisconnect\":\"Hibernate\",\"offPeakMinutesToWaitOnDisconnect\":709462942,\"offPeakActionOnLogoff\":\"None\",\"offPeakMinutesToWaitOnLogoff\":1900039321},\"id\":\"rqctmxxdtdd\",\"name\":\"flhuytxzv\",\"type\":\"zna\"}]}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .scalingPlanPersonalSchedules() - .list("kfuarenlv", "htkln", 1009916095, false, 672713653, com.azure.core.util.Context.NONE); + PagedIterable response = manager.scalingPlanPersonalSchedules() + .list("gdphtvdula", "vl", 1390786576, false, 748558129, com.azure.core.util.Context.NONE); Assertions.assertEquals(DayOfWeek.SATURDAY, response.iterator().next().daysOfWeek().get(0)); - Assertions.assertEquals(1124530948, response.iterator().next().rampUpStartTime().hour()); - Assertions.assertEquals(499319607, response.iterator().next().rampUpStartTime().minute()); - Assertions.assertEquals(StartupBehavior.NONE, response.iterator().next().rampUpAutoStartHosts()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.iterator().next().rampUpStartVMOnConnect()); - Assertions - .assertEquals(SessionHandlingOperation.DEALLOCATE, response.iterator().next().rampUpActionOnDisconnect()); - Assertions.assertEquals(1014248956, response.iterator().next().rampUpMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, response.iterator().next().rampUpActionOnLogoff()); - Assertions.assertEquals(1964077679, response.iterator().next().rampUpMinutesToWaitOnLogoff()); - Assertions.assertEquals(325210544, response.iterator().next().peakStartTime().hour()); - Assertions.assertEquals(2124129380, response.iterator().next().peakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().peakStartVMOnConnect()); - Assertions - .assertEquals(SessionHandlingOperation.HIBERNATE, response.iterator().next().peakActionOnDisconnect()); - Assertions.assertEquals(543218524, response.iterator().next().peakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(2073233936, response.iterator().next().rampUpStartTime().hour()); + Assertions.assertEquals(1865328530, response.iterator().next().rampUpStartTime().minute()); + Assertions.assertEquals(StartupBehavior.ALL, response.iterator().next().rampUpAutoStartHosts()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().rampUpStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, + response.iterator().next().rampUpActionOnDisconnect()); + Assertions.assertEquals(794094890, response.iterator().next().rampUpMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().rampUpActionOnLogoff()); + Assertions.assertEquals(192074742, response.iterator().next().rampUpMinutesToWaitOnLogoff()); + Assertions.assertEquals(794571898, response.iterator().next().peakStartTime().hour()); + Assertions.assertEquals(1290986457, response.iterator().next().peakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.iterator().next().peakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().peakActionOnDisconnect()); + Assertions.assertEquals(1598896306, response.iterator().next().peakMinutesToWaitOnDisconnect()); Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, response.iterator().next().peakActionOnLogoff()); - Assertions.assertEquals(150528067, response.iterator().next().peakMinutesToWaitOnLogoff()); - Assertions.assertEquals(20952661, response.iterator().next().rampDownStartTime().hour()); - Assertions.assertEquals(1138832682, response.iterator().next().rampDownStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.iterator().next().rampDownStartVMOnConnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().rampDownActionOnDisconnect()); - Assertions.assertEquals(996292120, response.iterator().next().rampDownMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().rampDownActionOnLogoff()); - Assertions.assertEquals(988577798, response.iterator().next().rampDownMinutesToWaitOnLogoff()); - Assertions.assertEquals(290904524, response.iterator().next().offPeakStartTime().hour()); - Assertions.assertEquals(1604128038, response.iterator().next().offPeakStartTime().minute()); - Assertions.assertEquals(SetStartVMOnConnect.ENABLE, response.iterator().next().offPeakStartVMOnConnect()); - Assertions - .assertEquals(SessionHandlingOperation.HIBERNATE, response.iterator().next().offPeakActionOnDisconnect()); - Assertions.assertEquals(709462942, response.iterator().next().offPeakMinutesToWaitOnDisconnect()); - Assertions.assertEquals(SessionHandlingOperation.NONE, response.iterator().next().offPeakActionOnLogoff()); - Assertions.assertEquals(1900039321, response.iterator().next().offPeakMinutesToWaitOnLogoff()); + Assertions.assertEquals(1282661494, response.iterator().next().peakMinutesToWaitOnLogoff()); + Assertions.assertEquals(369643942, response.iterator().next().rampDownStartTime().hour()); + Assertions.assertEquals(1501101823, response.iterator().next().rampDownStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().rampDownStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + response.iterator().next().rampDownActionOnDisconnect()); + Assertions.assertEquals(257622462, response.iterator().next().rampDownMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + response.iterator().next().rampDownActionOnLogoff()); + Assertions.assertEquals(457713777, response.iterator().next().rampDownMinutesToWaitOnLogoff()); + Assertions.assertEquals(1945539207, response.iterator().next().offPeakStartTime().hour()); + Assertions.assertEquals(1241650566, response.iterator().next().offPeakStartTime().minute()); + Assertions.assertEquals(SetStartVMOnConnect.DISABLE, response.iterator().next().offPeakStartVMOnConnect()); + Assertions.assertEquals(SessionHandlingOperation.HIBERNATE, + response.iterator().next().offPeakActionOnDisconnect()); + Assertions.assertEquals(988758793, response.iterator().next().offPeakMinutesToWaitOnDisconnect()); + Assertions.assertEquals(SessionHandlingOperation.DEALLOCATE, + response.iterator().next().offPeakActionOnLogoff()); + Assertions.assertEquals(1259722437, response.iterator().next().offPeakMinutesToWaitOnLogoff()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java index b6faeacb1666..6025a9313840 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleInnerTests.java @@ -16,78 +16,73 @@ public final class ScalingPlanPooledScheduleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPooledScheduleInner model = - BinaryData - .fromString( - "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":1990735678,\"minute\":876126569},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":138354171,\"rampUpCapacityThresholdPct\":1131914831,\"peakStartTime\":{\"hour\":1267034334,\"minute\":872540735},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":284483918,\"minute\":31023932},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1662245915,\"rampDownCapacityThresholdPct\":1149825898,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":990417532,\"rampDownNotificationMessage\":\"pjmkhfxobbc\",\"offPeakStartTime\":{\"hour\":198742016,\"minute\":1117876876},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"}") - .toObject(ScalingPlanPooledScheduleInner.class); + ScalingPlanPooledScheduleInner model = BinaryData.fromString( + "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":1999029226,\"minute\":53245710},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":47396428,\"rampUpCapacityThresholdPct\":598094792,\"peakStartTime\":{\"hour\":1235130312,\"minute\":957944639},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":2086388671,\"minute\":1242740761},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1391077197,\"rampDownCapacityThresholdPct\":1151721891,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":92762624,\"rampDownNotificationMessage\":\"rknftguvriuhprwm\",\"offPeakStartTime\":{\"hour\":1883973857,\"minute\":628006410},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"yriwwroyqb\",\"name\":\"xrmcqibycnojvk\",\"type\":\"mefqsgzvahapjyzh\"}") + .toObject(ScalingPlanPooledScheduleInner.class); Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1990735678, model.rampUpStartTime().hour()); - Assertions.assertEquals(876126569, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(138354171, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(1131914831, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1267034334, model.peakStartTime().hour()); - Assertions.assertEquals(872540735, model.peakStartTime().minute()); + Assertions.assertEquals(1999029226, model.rampUpStartTime().hour()); + Assertions.assertEquals(53245710, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(47396428, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(598094792, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1235130312, model.peakStartTime().hour()); + Assertions.assertEquals(957944639, model.peakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(284483918, model.rampDownStartTime().hour()); - Assertions.assertEquals(31023932, model.rampDownStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1662245915, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1149825898, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(2086388671, model.rampDownStartTime().hour()); + Assertions.assertEquals(1242740761, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1391077197, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(1151721891, model.rampDownCapacityThresholdPct()); Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(990417532, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("pjmkhfxobbc", model.rampDownNotificationMessage()); - Assertions.assertEquals(198742016, model.offPeakStartTime().hour()); - Assertions.assertEquals(1117876876, model.offPeakStartTime().minute()); + Assertions.assertEquals(92762624, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("rknftguvriuhprwm", model.rampDownNotificationMessage()); + Assertions.assertEquals(1883973857, model.offPeakStartTime().hour()); + Assertions.assertEquals(628006410, model.offPeakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPooledScheduleInner model = - new ScalingPlanPooledScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(1990735678).withMinute(876126569)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(138354171) - .withRampUpCapacityThresholdPct(1131914831) - .withPeakStartTime(new Time().withHour(1267034334).withMinute(872540735)) + ScalingPlanPooledScheduleInner model + = new ScalingPlanPooledScheduleInner().withDaysOfWeek(Arrays.asList(DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) + .withRampUpStartTime(new Time().withHour(1999029226).withMinute(53245710)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(47396428) + .withRampUpCapacityThresholdPct(598094792) + .withPeakStartTime(new Time().withHour(1235130312).withMinute(957944639)) .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(284483918).withMinute(31023932)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(1662245915) - .withRampDownCapacityThresholdPct(1149825898) + .withRampDownStartTime(new Time().withHour(2086388671).withMinute(1242740761)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(1391077197) + .withRampDownCapacityThresholdPct(1151721891) .withRampDownForceLogoffUsers(false) .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(990417532) - .withRampDownNotificationMessage("pjmkhfxobbc") - .withOffPeakStartTime(new Time().withHour(198742016).withMinute(1117876876)) + .withRampDownWaitTimeMinutes(92762624) + .withRampDownNotificationMessage("rknftguvriuhprwm") + .withOffPeakStartTime(new Time().withHour(1883973857).withMinute(628006410)) .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST); model = BinaryData.fromObject(model).toObject(ScalingPlanPooledScheduleInner.class); Assertions.assertEquals(DayOfWeek.WEDNESDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1990735678, model.rampUpStartTime().hour()); - Assertions.assertEquals(876126569, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(138354171, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(1131914831, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1267034334, model.peakStartTime().hour()); - Assertions.assertEquals(872540735, model.peakStartTime().minute()); + Assertions.assertEquals(1999029226, model.rampUpStartTime().hour()); + Assertions.assertEquals(53245710, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(47396428, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(598094792, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1235130312, model.peakStartTime().hour()); + Assertions.assertEquals(957944639, model.peakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(284483918, model.rampDownStartTime().hour()); - Assertions.assertEquals(31023932, model.rampDownStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1662245915, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1149825898, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(2086388671, model.rampDownStartTime().hour()); + Assertions.assertEquals(1242740761, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1391077197, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(1151721891, model.rampDownCapacityThresholdPct()); Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(990417532, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("pjmkhfxobbc", model.rampDownNotificationMessage()); - Assertions.assertEquals(198742016, model.offPeakStartTime().hour()); - Assertions.assertEquals(1117876876, model.offPeakStartTime().minute()); + Assertions.assertEquals(92762624, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("rknftguvriuhprwm", model.rampDownNotificationMessage()); + Assertions.assertEquals(1883973857, model.offPeakStartTime().hour()); + Assertions.assertEquals(628006410, model.offPeakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java index d748fc4e1ed8..17ee015e47a5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledScheduleListTests.java @@ -17,120 +17,104 @@ public final class ScalingPlanPooledScheduleListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPooledScheduleList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Saturday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":141640204,\"minute\":256612038},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1243580735,\"rampUpCapacityThresholdPct\":1207917179,\"peakStartTime\":{\"hour\":1413734297,\"minute\":1151827085},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":413444138,\"minute\":1967682720},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":693329650,\"rampDownCapacityThresholdPct\":1596436522,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":2073757128,\"rampDownNotificationMessage\":\"uthnnprnxipeilpj\",\"offPeakStartTime\":{\"hour\":1074564233,\"minute\":115468496},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"dultskz\",\"name\":\"btdzumveekg\",\"type\":\"wozuhkf\"},{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Tuesday\",\"Wednesday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":568244971,\"minute\":519560547},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1856979158,\"rampUpCapacityThresholdPct\":1422945070,\"peakStartTime\":{\"hour\":1252528512,\"minute\":1713449860},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":2116291824,\"minute\":2085364549},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":628545796,\"rampDownCapacityThresholdPct\":643648278,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1393240700,\"rampDownNotificationMessage\":\"sflhhca\",\"offPeakStartTime\":{\"hour\":131354519,\"minute\":2013755278},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"isxyawjoyaqcslyj\",\"name\":\"kiidzyex\",\"type\":\"nelixhnrztfo\"}],\"nextLink\":\"bnxknalaulppg\"}") - .toObject(ScalingPlanPooledScheduleList.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(141640204, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(256612038, model.value().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.value().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1243580735, model.value().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(1207917179, model.value().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1413734297, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(1151827085, model.value().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.value().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(413444138, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1967682720, model.value().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.value().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(693329650, model.value().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1596436522, model.value().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.value().get(0).rampDownForceLogoffUsers()); + ScalingPlanPooledScheduleList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Tuesday\",\"Saturday\",\"Thursday\",\"Monday\"],\"rampUpStartTime\":{\"hour\":628335164,\"minute\":1772436776},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":2113030944,\"rampUpCapacityThresholdPct\":2033382031,\"peakStartTime\":{\"hour\":1793705984,\"minute\":888543440},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1211885049,\"minute\":1841035114},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1984552254,\"rampDownCapacityThresholdPct\":1911330715,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":231705927,\"rampDownNotificationMessage\":\"hb\",\"offPeakStartTime\":{\"hour\":297001975,\"minute\":245214837},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"ulppggdtpnapnyir\",\"name\":\"pu\",\"type\":\"pigvpgylgqgitx\"},{\"properties\":{\"daysOfWeek\":[\"Sunday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":229566097,\"minute\":939730908},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":598877873,\"rampUpCapacityThresholdPct\":745098113,\"peakStartTime\":{\"hour\":785152893,\"minute\":261774364},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1437797215,\"minute\":953152084},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":45036784,\"rampDownCapacityThresholdPct\":591532413,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1324416407,\"rampDownNotificationMessage\":\"ellwptfdy\",\"offPeakStartTime\":{\"hour\":622690283,\"minute\":975485251},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"ceopzfqrhhuaopp\",\"name\":\"cq\",\"type\":\"qxolzdahzx\"}],\"nextLink\":\"obgbkdmoizp\"}") + .toObject(ScalingPlanPooledScheduleList.class); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.value().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(628335164, model.value().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1772436776, model.value().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(2113030944, model.value().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(2033382031, model.value().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(1793705984, model.value().get(0).peakStartTime().hour()); + Assertions.assertEquals(888543440, model.value().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1211885049, model.value().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(1841035114, model.value().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1984552254, model.value().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(1911330715, model.value().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals(false, model.value().get(0).rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.value().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(2073757128, model.value().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("uthnnprnxipeilpj", model.value().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(1074564233, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(115468496, model.value().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.value().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(231705927, model.value().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("hb", model.value().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(297001975, model.value().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(245214837, model.value().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).offPeakLoadBalancingAlgorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPooledScheduleList model = - new ScalingPlanPooledScheduleList() + ScalingPlanPooledScheduleList model + = new ScalingPlanPooledScheduleList() .withValue( - Arrays - .asList( - new ScalingPlanPooledScheduleInner() - .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.THURSDAY)) - .withRampUpStartTime(new Time().withHour(141640204).withMinute(256612038)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1243580735) - .withRampUpCapacityThresholdPct(1207917179) - .withPeakStartTime(new Time().withHour(1413734297).withMinute(1151827085)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(413444138).withMinute(1967682720)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(693329650) - .withRampDownCapacityThresholdPct(1596436522) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(2073757128) - .withRampDownNotificationMessage("uthnnprnxipeilpj") - .withOffPeakStartTime(new Time().withHour(1074564233).withMinute(115468496)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingPlanPooledScheduleInner() - .withDaysOfWeek( - Arrays - .asList( - DayOfWeek.WEDNESDAY, - DayOfWeek.TUESDAY, - DayOfWeek.WEDNESDAY, - DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(568244971).withMinute(519560547)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(1856979158) - .withRampUpCapacityThresholdPct(1422945070) - .withPeakStartTime(new Time().withHour(1252528512).withMinute(1713449860)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(2116291824).withMinute(2085364549)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(628545796) - .withRampDownCapacityThresholdPct(643648278) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1393240700) - .withRampDownNotificationMessage("sflhhca") - .withOffPeakStartTime(new Time().withHour(131354519).withMinute(2013755278)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))); + Arrays.asList( + new ScalingPlanPooledScheduleInner() + .withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY, DayOfWeek.SATURDAY, DayOfWeek.THURSDAY, + DayOfWeek.MONDAY)) + .withRampUpStartTime(new Time().withHour(628335164).withMinute(1772436776)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(2113030944) + .withRampUpCapacityThresholdPct(2033382031) + .withPeakStartTime(new Time().withHour(1793705984).withMinute(888543440)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(1211885049).withMinute(1841035114)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1984552254) + .withRampDownCapacityThresholdPct(1911330715) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(231705927) + .withRampDownNotificationMessage("hb") + .withOffPeakStartTime(new Time().withHour(297001975).withMinute(245214837)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), + new ScalingPlanPooledScheduleInner() + .withDaysOfWeek(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.SATURDAY)) + .withRampUpStartTime(new Time().withHour(229566097).withMinute(939730908)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(598877873) + .withRampUpCapacityThresholdPct(745098113) + .withPeakStartTime(new Time().withHour(785152893).withMinute(261774364)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(1437797215).withMinute(953152084)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(45036784) + .withRampDownCapacityThresholdPct(591532413) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(1324416407) + .withRampDownNotificationMessage("ellwptfdy") + .withOffPeakStartTime(new Time().withHour(622690283).withMinute(975485251)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST))); model = BinaryData.fromObject(model).toObject(ScalingPlanPooledScheduleList.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.value().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(141640204, model.value().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(256612038, model.value().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.value().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1243580735, model.value().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(1207917179, model.value().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1413734297, model.value().get(0).peakStartTime().hour()); - Assertions.assertEquals(1151827085, model.value().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.value().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(413444138, model.value().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(1967682720, model.value().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.value().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(693329650, model.value().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1596436522, model.value().get(0).rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.value().get(0).rampDownForceLogoffUsers()); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.value().get(0).daysOfWeek().get(0)); + Assertions.assertEquals(628335164, model.value().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1772436776, model.value().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(2113030944, model.value().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(2033382031, model.value().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(1793705984, model.value().get(0).peakStartTime().hour()); + Assertions.assertEquals(888543440, model.value().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1211885049, model.value().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(1841035114, model.value().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1984552254, model.value().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(1911330715, model.value().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals(false, model.value().get(0).rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.value().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(2073757128, model.value().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("uthnnprnxipeilpj", model.value().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(1074564233, model.value().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(115468496, model.value().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.value().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(231705927, model.value().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("hb", model.value().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(297001975, model.value().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(245214837, model.value().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.value().get(0).offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java index b57bbe5f73b8..f7c192908ce9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePatchTests.java @@ -16,76 +16,75 @@ public final class ScalingPlanPooledSchedulePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPooledSchedulePatch model = - BinaryData - .fromString( - "{\"properties\":{\"daysOfWeek\":[\"Saturday\"],\"rampUpStartTime\":{\"hour\":391776168,\"minute\":2086388671},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":2051758056,\"rampUpCapacityThresholdPct\":1378087535,\"peakStartTime\":{\"hour\":439169956,\"minute\":1264115895},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":92762624,\"minute\":63686383},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1220568259,\"rampDownCapacityThresholdPct\":810124654,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":2067966148,\"rampDownNotificationMessage\":\"rwmdyvxqtay\",\"offPeakStartTime\":{\"hour\":357638492,\"minute\":1013122573},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"yqbexrmcqibycno\",\"name\":\"v\",\"type\":\"nmefqsgzvahapj\"}") - .toObject(ScalingPlanPooledSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(391776168, model.rampUpStartTime().hour()); - Assertions.assertEquals(2086388671, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(2051758056, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(1378087535, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(439169956, model.peakStartTime().hour()); - Assertions.assertEquals(1264115895, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(92762624, model.rampDownStartTime().hour()); - Assertions.assertEquals(63686383, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1220568259, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(810124654, model.rampDownCapacityThresholdPct()); + ScalingPlanPooledSchedulePatch model = BinaryData.fromString( + "{\"properties\":{\"daysOfWeek\":[\"Tuesday\",\"Saturday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":478789870,\"minute\":618241707},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1777523774,\"rampUpCapacityThresholdPct\":1391640173,\"peakStartTime\":{\"hour\":794147493,\"minute\":1487921664},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1817395780,\"minute\":911348001},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":733253816,\"rampDownCapacityThresholdPct\":2020416091,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1295774959,\"rampDownNotificationMessage\":\"luu\",\"offPeakStartTime\":{\"hour\":1856979158,\"minute\":578093218},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"aboekqv\",\"name\":\"elnsmvbxw\",\"type\":\"jsflhhcaalnjix\"}") + .toObject(ScalingPlanPooledSchedulePatch.class); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(478789870, model.rampUpStartTime().hour()); + Assertions.assertEquals(618241707, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1777523774, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1391640173, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(794147493, model.peakStartTime().hour()); + Assertions.assertEquals(1487921664, model.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1817395780, model.rampDownStartTime().hour()); + Assertions.assertEquals(911348001, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(733253816, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(2020416091, model.rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(2067966148, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("rwmdyvxqtay", model.rampDownNotificationMessage()); - Assertions.assertEquals(357638492, model.offPeakStartTime().hour()); - Assertions.assertEquals(1013122573, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); + Assertions.assertEquals(1295774959, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("luu", model.rampDownNotificationMessage()); + Assertions.assertEquals(1856979158, model.offPeakStartTime().hour()); + Assertions.assertEquals(578093218, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPooledSchedulePatch model = - new ScalingPlanPooledSchedulePatch() - .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY)) - .withRampUpStartTime(new Time().withHour(391776168).withMinute(2086388671)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(2051758056) - .withRampUpCapacityThresholdPct(1378087535) - .withPeakStartTime(new Time().withHour(439169956).withMinute(1264115895)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(92762624).withMinute(63686383)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1220568259) - .withRampDownCapacityThresholdPct(810124654) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(2067966148) - .withRampDownNotificationMessage("rwmdyvxqtay") - .withOffPeakStartTime(new Time().withHour(357638492).withMinute(1013122573)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); + ScalingPlanPooledSchedulePatch model = new ScalingPlanPooledSchedulePatch() + .withDaysOfWeek(Arrays.asList(DayOfWeek.TUESDAY, DayOfWeek.SATURDAY, DayOfWeek.SATURDAY)) + .withRampUpStartTime(new Time().withHour(478789870).withMinute(618241707)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1777523774) + .withRampUpCapacityThresholdPct(1391640173) + .withPeakStartTime(new Time().withHour(794147493).withMinute(1487921664)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(1817395780).withMinute(911348001)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(733253816) + .withRampDownCapacityThresholdPct(2020416091) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(1295774959) + .withRampDownNotificationMessage("luu") + .withOffPeakStartTime(new Time().withHour(1856979158).withMinute(578093218)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST); model = BinaryData.fromObject(model).toObject(ScalingPlanPooledSchedulePatch.class); - Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(391776168, model.rampUpStartTime().hour()); - Assertions.assertEquals(2086388671, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(2051758056, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(1378087535, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(439169956, model.peakStartTime().hour()); - Assertions.assertEquals(1264115895, model.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(92762624, model.rampDownStartTime().hour()); - Assertions.assertEquals(63686383, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1220568259, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(810124654, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(DayOfWeek.TUESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(478789870, model.rampUpStartTime().hour()); + Assertions.assertEquals(618241707, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1777523774, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1391640173, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(794147493, model.peakStartTime().hour()); + Assertions.assertEquals(1487921664, model.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1817395780, model.rampDownStartTime().hour()); + Assertions.assertEquals(911348001, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(733253816, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(2020416091, model.rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(2067966148, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("rwmdyvxqtay", model.rampDownNotificationMessage()); - Assertions.assertEquals(357638492, model.offPeakStartTime().hour()); - Assertions.assertEquals(1013122573, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); + Assertions.assertEquals(1295774959, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("luu", model.rampDownNotificationMessage()); + Assertions.assertEquals(1856979158, model.offPeakStartTime().hour()); + Assertions.assertEquals(578093218, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java index 351569ba4904..ccd48d0c4fd9 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulePropertiesTests.java @@ -16,77 +16,73 @@ public final class ScalingPlanPooledSchedulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanPooledScheduleProperties model = - BinaryData - .fromString( - "{\"daysOfWeek\":[\"Sunday\",\"Sunday\",\"Wednesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":1837116433,\"minute\":2103137599},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1432172672,\"rampUpCapacityThresholdPct\":795071177,\"peakStartTime\":{\"hour\":1806292295,\"minute\":1451066007},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1742737473,\"minute\":1258750458},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1232796575,\"rampDownCapacityThresholdPct\":1519275761,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1428727987,\"rampDownNotificationMessage\":\"j\",\"offPeakStartTime\":{\"hour\":1115460475,\"minute\":47396428},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}") - .toObject(ScalingPlanPooledScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1837116433, model.rampUpStartTime().hour()); - Assertions.assertEquals(2103137599, model.rampUpStartTime().minute()); + ScalingPlanPooledScheduleProperties model = BinaryData.fromString( + "{\"daysOfWeek\":[\"Saturday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":141640204,\"minute\":256612038},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1243580735,\"rampUpCapacityThresholdPct\":1207917179,\"peakStartTime\":{\"hour\":1413734297,\"minute\":1151827085},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":413444138,\"minute\":1967682720},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":693329650,\"rampDownCapacityThresholdPct\":1596436522,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":2073757128,\"rampDownNotificationMessage\":\"uthnnprnxipeilpj\",\"offPeakStartTime\":{\"hour\":1074564233,\"minute\":115468496},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}") + .toObject(ScalingPlanPooledScheduleProperties.class); + Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(141640204, model.rampUpStartTime().hour()); + Assertions.assertEquals(256612038, model.rampUpStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1432172672, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(795071177, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1806292295, model.peakStartTime().hour()); - Assertions.assertEquals(1451066007, model.peakStartTime().minute()); + Assertions.assertEquals(1243580735, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1207917179, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1413734297, model.peakStartTime().hour()); + Assertions.assertEquals(1151827085, model.peakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1742737473, model.rampDownStartTime().hour()); - Assertions.assertEquals(1258750458, model.rampDownStartTime().minute()); + Assertions.assertEquals(413444138, model.rampDownStartTime().hour()); + Assertions.assertEquals(1967682720, model.rampDownStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1232796575, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1519275761, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(693329650, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(1596436522, model.rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(1428727987, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("j", model.rampDownNotificationMessage()); - Assertions.assertEquals(1115460475, model.offPeakStartTime().hour()); - Assertions.assertEquals(47396428, model.offPeakStartTime().minute()); + Assertions.assertEquals(2073757128, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("uthnnprnxipeilpj", model.rampDownNotificationMessage()); + Assertions.assertEquals(1074564233, model.offPeakStartTime().hour()); + Assertions.assertEquals(115468496, model.offPeakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanPooledScheduleProperties model = - new ScalingPlanPooledScheduleProperties() - .withDaysOfWeek( - Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.SUNDAY, DayOfWeek.WEDNESDAY, DayOfWeek.FRIDAY)) - .withRampUpStartTime(new Time().withHour(1837116433).withMinute(2103137599)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1432172672) - .withRampUpCapacityThresholdPct(795071177) - .withPeakStartTime(new Time().withHour(1806292295).withMinute(1451066007)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(1742737473).withMinute(1258750458)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1232796575) - .withRampDownCapacityThresholdPct(1519275761) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(1428727987) - .withRampDownNotificationMessage("j") - .withOffPeakStartTime(new Time().withHour(1115460475).withMinute(47396428)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); + ScalingPlanPooledScheduleProperties model = new ScalingPlanPooledScheduleProperties() + .withDaysOfWeek(Arrays.asList(DayOfWeek.SATURDAY, DayOfWeek.THURSDAY)) + .withRampUpStartTime(new Time().withHour(141640204).withMinute(256612038)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1243580735) + .withRampUpCapacityThresholdPct(1207917179) + .withPeakStartTime(new Time().withHour(1413734297).withMinute(1151827085)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(413444138).withMinute(1967682720)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(693329650) + .withRampDownCapacityThresholdPct(1596436522) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(2073757128) + .withRampDownNotificationMessage("uthnnprnxipeilpj") + .withOffPeakStartTime(new Time().withHour(1074564233).withMinute(115468496)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); model = BinaryData.fromObject(model).toObject(ScalingPlanPooledScheduleProperties.class); - Assertions.assertEquals(DayOfWeek.SUNDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(1837116433, model.rampUpStartTime().hour()); - Assertions.assertEquals(2103137599, model.rampUpStartTime().minute()); + Assertions.assertEquals(DayOfWeek.SATURDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(141640204, model.rampUpStartTime().hour()); + Assertions.assertEquals(256612038, model.rampUpStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1432172672, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(795071177, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1806292295, model.peakStartTime().hour()); - Assertions.assertEquals(1451066007, model.peakStartTime().minute()); + Assertions.assertEquals(1243580735, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1207917179, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1413734297, model.peakStartTime().hour()); + Assertions.assertEquals(1151827085, model.peakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1742737473, model.rampDownStartTime().hour()); - Assertions.assertEquals(1258750458, model.rampDownStartTime().minute()); + Assertions.assertEquals(413444138, model.rampDownStartTime().hour()); + Assertions.assertEquals(1967682720, model.rampDownStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1232796575, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(1519275761, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(693329650, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(1596436522, model.rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(1428727987, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("j", model.rampDownNotificationMessage()); - Assertions.assertEquals(1115460475, model.offPeakStartTime().hour()); - Assertions.assertEquals(47396428, model.offPeakStartTime().minute()); + Assertions.assertEquals(2073757128, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("uthnnprnxipeilpj", model.rampDownNotificationMessage()); + Assertions.assertEquals(1074564233, model.offPeakStartTime().hour()); + Assertions.assertEquals(115468496, model.offPeakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java index 6bbca30e8f37..b5bfac336cd3 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesCreateWithResponseMockTests.java @@ -6,112 +6,80 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; import com.azure.resourcemanager.desktopvirtualization.models.Time; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPooledSchedulesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"daysOfWeek\":[\"Thursday\"],\"rampUpStartTime\":{\"hour\":1468160039,\"minute\":1632066505},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":966764042,\"rampUpCapacityThresholdPct\":771556133,\"peakStartTime\":{\"hour\":1743083802,\"minute\":761308188},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1990405862,\"minute\":1925288663},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":807094173,\"rampDownCapacityThresholdPct\":1845774986,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":982791914,\"rampDownNotificationMessage\":\"bjpsfxsfuztlvtm\",\"offPeakStartTime\":{\"hour\":175189485,\"minute\":1490631232},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"qlvh\",\"name\":\"koveof\",\"type\":\"zrvjfnmjmvlwyzgi\"}"; - String responseStr = - "{\"properties\":{\"daysOfWeek\":[\"Monday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":1533653283,\"minute\":1984178161},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":830964876,\"rampUpCapacityThresholdPct\":1152619521,\"peakStartTime\":{\"hour\":1614916869,\"minute\":1479987429},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":915914475,\"minute\":875433562},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":817459269,\"rampDownCapacityThresholdPct\":449882255,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":689120218,\"rampDownNotificationMessage\":\"rsxypruuu\",\"offPeakStartTime\":{\"hour\":694984034,\"minute\":1409089319},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"szizoyuelyetndnb\",\"name\":\"qyggagfl\",\"type\":\"lgmtrwahzjmucf\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + ScalingPlanPooledSchedule response = manager.scalingPlanPooledSchedules() + .define("lpxuzzjgnrefq") + .withExistingScalingPlan("dnigrfihot", "e") + .withDaysOfWeek(Arrays.asList(DayOfWeek.SUNDAY, DayOfWeek.FRIDAY, DayOfWeek.FRIDAY, DayOfWeek.THURSDAY)) + .withRampUpStartTime(new Time().withHour(773254967).withMinute(1642476072)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(595468584) + .withRampUpCapacityThresholdPct(376876153) + .withPeakStartTime(new Time().withHour(143556698).withMinute(1733569114)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(587303890).withMinute(1946832159)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1216566407) + .withRampDownCapacityThresholdPct(1983000193) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(334230788) + .withRampDownNotificationMessage("sipi") + .withOffPeakStartTime(new Time().withHour(1379010451).withMinute(1553413277)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .create(); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPooledSchedule response = - manager - .scalingPlanPooledSchedules() - .define("n") - .withExistingScalingPlan("wkffdjkt", "ysidfvclgl") - .withDaysOfWeek( - Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.SATURDAY, DayOfWeek.THURSDAY, DayOfWeek.TUESDAY)) - .withRampUpStartTime(new Time().withHour(1043687593).withMinute(939102144)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(1112160542) - .withRampUpCapacityThresholdPct(1510144840) - .withPeakStartTime(new Time().withHour(869245621).withMinute(1717573357)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(1168191195).withMinute(1139641337)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownMinimumHostsPct(312700114) - .withRampDownCapacityThresholdPct(972711473) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(846546082) - .withRampDownNotificationMessage("tvwkpqhjpenu") - .withOffPeakStartTime(new Time().withHour(1710915481).withMinute(1781943414)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .create(); - - Assertions.assertEquals(DayOfWeek.MONDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(1533653283, response.rampUpStartTime().hour()); - Assertions.assertEquals(1984178161, response.rampUpStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(830964876, response.rampUpMinimumHostsPct()); - Assertions.assertEquals(1152619521, response.rampUpCapacityThresholdPct()); - Assertions.assertEquals(1614916869, response.peakStartTime().hour()); - Assertions.assertEquals(1479987429, response.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(915914475, response.rampDownStartTime().hour()); - Assertions.assertEquals(875433562, response.rampDownStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, response.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(817459269, response.rampDownMinimumHostsPct()); - Assertions.assertEquals(449882255, response.rampDownCapacityThresholdPct()); + Assertions.assertEquals(DayOfWeek.THURSDAY, response.daysOfWeek().get(0)); + Assertions.assertEquals(1468160039, response.rampUpStartTime().hour()); + Assertions.assertEquals(1632066505, response.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(966764042, response.rampUpMinimumHostsPct()); + Assertions.assertEquals(771556133, response.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1743083802, response.peakStartTime().hour()); + Assertions.assertEquals(761308188, response.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, response.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1990405862, response.rampDownStartTime().hour()); + Assertions.assertEquals(1925288663, response.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(807094173, response.rampDownMinimumHostsPct()); + Assertions.assertEquals(1845774986, response.rampDownCapacityThresholdPct()); Assertions.assertEquals(false, response.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, response.rampDownStopHostsWhen()); - Assertions.assertEquals(689120218, response.rampDownWaitTimeMinutes()); - Assertions.assertEquals("rsxypruuu", response.rampDownNotificationMessage()); - Assertions.assertEquals(694984034, response.offPeakStartTime().hour()); - Assertions.assertEquals(1409089319, response.offPeakStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, response.rampDownStopHostsWhen()); + Assertions.assertEquals(982791914, response.rampDownWaitTimeMinutes()); + Assertions.assertEquals("bjpsfxsfuztlvtm", response.rampDownNotificationMessage()); + Assertions.assertEquals(175189485, response.offPeakStartTime().hour()); + Assertions.assertEquals(1490631232, response.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java index 5f6819bded3a..bff16bf4c955 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesDeleteWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPooledSchedulesDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.scalingPlanPooledSchedules() + .deleteWithResponse("dfjmzsyzfhotlh", "k", "yych", com.azure.core.util.Context.NONE); - manager - .scalingPlanPooledSchedules() - .deleteWithResponse("qzeqyjleziunjxdf", "antkwcegyamlbns", "qa", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java index 7b7cf668e24b..ec09401d3fe5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesGetWithResponseMockTests.java @@ -6,91 +6,60 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPooledSchedulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"daysOfWeek\":[\"Thursday\",\"Friday\",\"Tuesday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":1526203754,\"minute\":1675375189},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1013116019,\"rampUpCapacityThresholdPct\":1704403658,\"peakStartTime\":{\"hour\":1953914585,\"minute\":1615975796},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1350156714,\"minute\":614051045},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1052879653,\"rampDownCapacityThresholdPct\":951068709,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1119182836,\"rampDownNotificationMessage\":\"ydsx\",\"offPeakStartTime\":{\"hour\":322305993,\"minute\":923461198},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},\"id\":\"bvopwndyqle\",\"name\":\"llklmtk\",\"type\":\"lowkxxpvb\"}"; - String responseStr = - "{\"properties\":{\"daysOfWeek\":[\"Wednesday\",\"Tuesday\",\"Tuesday\",\"Sunday\"],\"rampUpStartTime\":{\"hour\":808082616,\"minute\":146690608},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1751850154,\"rampUpCapacityThresholdPct\":612007503,\"peakStartTime\":{\"hour\":2085427407,\"minute\":928121621},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":844035132,\"minute\":1145439736},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1395211030,\"rampDownCapacityThresholdPct\":97372344,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":1945298143,\"rampDownNotificationMessage\":\"gtdysnaqu\",\"offPeakStartTime\":{\"hour\":1842048438,\"minute\":1011075581},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"q\",\"name\":\"amz\",\"type\":\"rwd\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + ScalingPlanPooledSchedule response = manager.scalingPlanPooledSchedules() + .getWithResponse("siowlkjxnqpv", "gf", "tmhqykiz", com.azure.core.util.Context.NONE) + .getValue(); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScalingPlanPooledSchedule response = - manager - .scalingPlanPooledSchedules() - .getWithResponse("wnjlxu", "rhwpus", "jbaqehgpdoh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(DayOfWeek.WEDNESDAY, response.daysOfWeek().get(0)); - Assertions.assertEquals(808082616, response.rampUpStartTime().hour()); - Assertions.assertEquals(146690608, response.rampUpStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1751850154, response.rampUpMinimumHostsPct()); - Assertions.assertEquals(612007503, response.rampUpCapacityThresholdPct()); - Assertions.assertEquals(2085427407, response.peakStartTime().hour()); - Assertions.assertEquals(928121621, response.peakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, response.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(844035132, response.rampDownStartTime().hour()); - Assertions.assertEquals(1145439736, response.rampDownStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1395211030, response.rampDownMinimumHostsPct()); - Assertions.assertEquals(97372344, response.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, response.rampDownForceLogoffUsers()); + Assertions.assertEquals(DayOfWeek.THURSDAY, response.daysOfWeek().get(0)); + Assertions.assertEquals(1526203754, response.rampUpStartTime().hour()); + Assertions.assertEquals(1675375189, response.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1013116019, response.rampUpMinimumHostsPct()); + Assertions.assertEquals(1704403658, response.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1953914585, response.peakStartTime().hour()); + Assertions.assertEquals(1615975796, response.peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, response.peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1350156714, response.rampDownStartTime().hour()); + Assertions.assertEquals(614051045, response.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1052879653, response.rampDownMinimumHostsPct()); + Assertions.assertEquals(951068709, response.rampDownCapacityThresholdPct()); + Assertions.assertEquals(false, response.rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, response.rampDownStopHostsWhen()); - Assertions.assertEquals(1945298143, response.rampDownWaitTimeMinutes()); - Assertions.assertEquals("gtdysnaqu", response.rampDownNotificationMessage()); - Assertions.assertEquals(1842048438, response.offPeakStartTime().hour()); - Assertions.assertEquals(1011075581, response.offPeakStartTime().minute()); - Assertions - .assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, response.offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(1119182836, response.rampDownWaitTimeMinutes()); + Assertions.assertEquals("ydsx", response.rampDownNotificationMessage()); + Assertions.assertEquals(322305993, response.offPeakStartTime().hour()); + Assertions.assertEquals(923461198, response.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java index 7d660e00180e..365103741fd2 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPooledSchedulesListMockTests.java @@ -6,100 +6,61 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek; import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedule; import com.azure.resourcemanager.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm; import com.azure.resourcemanager.desktopvirtualization.models.StopHostsWhen; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlanPooledSchedulesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Friday\",\"Tuesday\",\"Wednesday\",\"Monday\"],\"rampUpStartTime\":{\"hour\":1314772316,\"minute\":860870754},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":118504398,\"rampUpCapacityThresholdPct\":1140037970,\"peakStartTime\":{\"hour\":1699127103,\"minute\":1126783291},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":591587350,\"minute\":1739999630},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":2059938924,\"rampDownCapacityThresholdPct\":1104352328,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1284227714,\"rampDownNotificationMessage\":\"mhoocl\",\"offPeakStartTime\":{\"hour\":195400750,\"minute\":1149950699},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"mczjkm\",\"name\":\"ykyujxsg\",\"type\":\"hsrrryejylmbkz\"}]}"; - String responseStr = - "{\"value\":[{\"properties\":{\"daysOfWeek\":[\"Sunday\",\"Thursday\",\"Thursday\"],\"rampUpStartTime\":{\"hour\":1749280590,\"minute\":720786123},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1489010807,\"rampUpCapacityThresholdPct\":1872407270,\"peakStartTime\":{\"hour\":807818343,\"minute\":468087914},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1329198912,\"minute\":1292218152},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1596109972,\"rampDownCapacityThresholdPct\":148028664,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":41278512,\"rampDownNotificationMessage\":\"cjkgdirazftxej\",\"offPeakStartTime\":{\"hour\":1368771016,\"minute\":1529285659},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},\"id\":\"jtmvc\",\"name\":\"pexcmjurbuhh\",\"type\":\"kyqltqsrogt\"}]}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + PagedIterable response = manager.scalingPlanPooledSchedules() + .list("nsjlpjrtws", "hv", 672942547, true, 56804817, com.azure.core.util.Context.NONE); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .scalingPlanPooledSchedules() - .list("jjvpilguooqja", "m", 1068210919, false, 1892935943, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(DayOfWeek.SUNDAY, response.iterator().next().daysOfWeek().get(0)); - Assertions.assertEquals(1749280590, response.iterator().next().rampUpStartTime().hour()); - Assertions.assertEquals(720786123, response.iterator().next().rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.iterator().next().rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(1489010807, response.iterator().next().rampUpMinimumHostsPct()); - Assertions.assertEquals(1872407270, response.iterator().next().rampUpCapacityThresholdPct()); - Assertions.assertEquals(807818343, response.iterator().next().peakStartTime().hour()); - Assertions.assertEquals(468087914, response.iterator().next().peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.iterator().next().peakLoadBalancingAlgorithm()); - Assertions.assertEquals(1329198912, response.iterator().next().rampDownStartTime().hour()); - Assertions.assertEquals(1292218152, response.iterator().next().rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - response.iterator().next().rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1596109972, response.iterator().next().rampDownMinimumHostsPct()); - Assertions.assertEquals(148028664, response.iterator().next().rampDownCapacityThresholdPct()); + Assertions.assertEquals(DayOfWeek.FRIDAY, response.iterator().next().daysOfWeek().get(0)); + Assertions.assertEquals(1314772316, response.iterator().next().rampUpStartTime().hour()); + Assertions.assertEquals(860870754, response.iterator().next().rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + response.iterator().next().rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(118504398, response.iterator().next().rampUpMinimumHostsPct()); + Assertions.assertEquals(1140037970, response.iterator().next().rampUpCapacityThresholdPct()); + Assertions.assertEquals(1699127103, response.iterator().next().peakStartTime().hour()); + Assertions.assertEquals(1126783291, response.iterator().next().peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.iterator().next().peakLoadBalancingAlgorithm()); + Assertions.assertEquals(591587350, response.iterator().next().rampDownStartTime().hour()); + Assertions.assertEquals(1739999630, response.iterator().next().rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + response.iterator().next().rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(2059938924, response.iterator().next().rampDownMinimumHostsPct()); + Assertions.assertEquals(1104352328, response.iterator().next().rampDownCapacityThresholdPct()); Assertions.assertEquals(false, response.iterator().next().rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, response.iterator().next().rampDownStopHostsWhen()); - Assertions.assertEquals(41278512, response.iterator().next().rampDownWaitTimeMinutes()); - Assertions.assertEquals("cjkgdirazftxej", response.iterator().next().rampDownNotificationMessage()); - Assertions.assertEquals(1368771016, response.iterator().next().offPeakStartTime().hour()); - Assertions.assertEquals(1529285659, response.iterator().next().offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - response.iterator().next().offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, response.iterator().next().rampDownStopHostsWhen()); + Assertions.assertEquals(1284227714, response.iterator().next().rampDownWaitTimeMinutes()); + Assertions.assertEquals("mhoocl", response.iterator().next().rampDownNotificationMessage()); + Assertions.assertEquals(195400750, response.iterator().next().offPeakStartTime().hour()); + Assertions.assertEquals(1149950699, response.iterator().next().offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + response.iterator().next().offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java index 75dca3835473..917cf5d15108 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlanPropertiesTests.java @@ -19,182 +19,167 @@ public final class ScalingPlanPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingPlanProperties model = - BinaryData - .fromString( - "{\"objectId\":\"aos\",\"description\":\"xc\",\"friendlyName\":\"npc\",\"timeZone\":\"hocohslkev\",\"hostPoolType\":\"Pooled\",\"exclusionTag\":\"zfbuhf\",\"schedules\":[{\"name\":\"x\",\"daysOfWeek\":[\"Sunday\",\"Saturday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":378191098,\"minute\":1914432251},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":511745945,\"rampUpCapacityThresholdPct\":72720177,\"peakStartTime\":{\"hour\":1090911341,\"minute\":516508763},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":2099560460,\"minute\":63743502},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":852408036,\"rampDownCapacityThresholdPct\":1533389693,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":849896725,\"rampDownNotificationMessage\":\"jx\",\"offPeakStartTime\":{\"hour\":2030028307,\"minute\":953955678},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"ptkoenkoukn\",\"daysOfWeek\":[\"Monday\",\"Saturday\",\"Thursday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":133898645,\"minute\":45967354},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":969530861,\"rampUpCapacityThresholdPct\":626726522,\"peakStartTime\":{\"hour\":1997522468,\"minute\":655680628},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":1866473569,\"minute\":212177726},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":862594448,\"rampDownCapacityThresholdPct\":157234884,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1142457061,\"rampDownNotificationMessage\":\"gevqznty\",\"offPeakStartTime\":{\"hour\":1534766868,\"minute\":1785806943},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"c\",\"daysOfWeek\":[\"Tuesday\",\"Wednesday\",\"Friday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":2075884745,\"minute\":1295210131},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":229483686,\"rampUpCapacityThresholdPct\":1665159346,\"peakStartTime\":{\"hour\":856772857,\"minute\":403055260},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":170373532,\"minute\":1718564660},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1909902819,\"rampDownCapacityThresholdPct\":362966046,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":22083476,\"rampDownNotificationMessage\":\"bkh\",\"offPeakStartTime\":{\"hour\":2127806039,\"minute\":1192393079},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"p\",\"scalingPlanEnabled\":false}]}") - .toObject(ScalingPlanProperties.class); - Assertions.assertEquals("xc", model.description()); - Assertions.assertEquals("npc", model.friendlyName()); - Assertions.assertEquals("hocohslkev", model.timeZone()); + ScalingPlanProperties model = BinaryData.fromString( + "{\"objectId\":\"avwhheunm\",\"description\":\"hgyxzkonoc\",\"friendlyName\":\"oklyaxuconuq\",\"timeZone\":\"zf\",\"hostPoolType\":\"Pooled\",\"exclusionTag\":\"pewr\",\"schedules\":[{\"name\":\"vvjektcxsenhwlrs\",\"daysOfWeek\":[\"Sunday\",\"Sunday\",\"Monday\",\"Tuesday\"],\"rampUpStartTime\":{\"hour\":1497747183,\"minute\":1792150681},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1034850835,\"rampUpCapacityThresholdPct\":629213684,\"peakStartTime\":{\"hour\":878153378,\"minute\":579974713},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1408996613,\"minute\":2117678486},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":385263599,\"rampDownCapacityThresholdPct\":1351604805,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1486569340,\"rampDownNotificationMessage\":\"uctqhjfbe\",\"offPeakStartTime\":{\"hour\":75168662,\"minute\":1278137451},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"fuwutttxf\",\"daysOfWeek\":[\"Tuesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":709039667,\"minute\":1236632858},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":99482426,\"rampUpCapacityThresholdPct\":1103023268,\"peakStartTime\":{\"hour\":1901169400,\"minute\":1504948811},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1999582411,\"minute\":442214208},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1238878906,\"rampDownCapacityThresholdPct\":1975532924,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":528662531,\"rampDownNotificationMessage\":\"gjljyoxgvc\",\"offPeakStartTime\":{\"hour\":1773557410,\"minute\":1059812914},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"},{\"name\":\"ghkjeszzhbi\",\"daysOfWeek\":[\"Tuesday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":502156658,\"minute\":749525568},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":1787736845,\"rampUpCapacityThresholdPct\":215474399,\"peakStartTime\":{\"hour\":1703122052,\"minute\":1543510738},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1083472425,\"minute\":1566120849},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":68854326,\"rampDownCapacityThresholdPct\":1209438571,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":1961052031,\"rampDownNotificationMessage\":\"ukgri\",\"offPeakStartTime\":{\"hour\":390168051,\"minute\":1920273783},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"},{\"name\":\"xzpuzycisp\",\"daysOfWeek\":[\"Wednesday\",\"Saturday\",\"Friday\",\"Friday\"],\"rampUpStartTime\":{\"hour\":2016688773,\"minute\":318334591},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":1687540865,\"rampUpCapacityThresholdPct\":380689806,\"peakStartTime\":{\"hour\":1421404379,\"minute\":1877210635},\"peakLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownStartTime\":{\"hour\":1122159032,\"minute\":500953055},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1684029730,\"rampDownCapacityThresholdPct\":627657952,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":424672875,\"rampDownNotificationMessage\":\"ynhijggme\",\"offPeakStartTime\":{\"hour\":983171059,\"minute\":930561644},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}],\"hostPoolReferences\":[{\"hostPoolArmPath\":\"rcvpnazzmhjrunmp\",\"scalingPlanEnabled\":true}]}") + .toObject(ScalingPlanProperties.class); + Assertions.assertEquals("hgyxzkonoc", model.description()); + Assertions.assertEquals("oklyaxuconuq", model.friendlyName()); + Assertions.assertEquals("zf", model.timeZone()); Assertions.assertEquals(ScalingHostPoolType.POOLED, model.hostPoolType()); - Assertions.assertEquals("zfbuhf", model.exclusionTag()); - Assertions.assertEquals("x", model.schedules().get(0).name()); + Assertions.assertEquals("pewr", model.exclusionTag()); + Assertions.assertEquals("vvjektcxsenhwlrs", model.schedules().get(0).name()); Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.SUNDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(378191098, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(1914432251, model.schedules().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(511745945, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(72720177, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1090911341, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(516508763, model.schedules().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(2099560460, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(63743502, model.schedules().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(852408036, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1533389693, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals(1497747183, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1792150681, model.schedules().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1034850835, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(629213684, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(878153378, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(579974713, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1408996613, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(2117678486, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(385263599, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(1351604805, model.schedules().get(0).rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.schedules().get(0).rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(849896725, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("jx", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(2030028307, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(953955678, model.schedules().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("p", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); + Assertions.assertEquals(1486569340, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("uctqhjfbe", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(75168662, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(1278137451, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("rcvpnazzmhjrunmp", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertEquals(true, model.hostPoolReferences().get(0).scalingPlanEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingPlanProperties model = - new ScalingPlanProperties() - .withDescription("xc") - .withFriendlyName("npc") - .withTimeZone("hocohslkev") + ScalingPlanProperties model + = new ScalingPlanProperties().withDescription("hgyxzkonoc") + .withFriendlyName("oklyaxuconuq") + .withTimeZone("zf") .withHostPoolType(ScalingHostPoolType.POOLED) - .withExclusionTag("zfbuhf") - .withSchedules( - Arrays - .asList( - new ScalingSchedule() - .withName("x") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.SUNDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY)) - .withRampUpStartTime(new Time().withHour(378191098).withMinute(1914432251)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(511745945) - .withRampUpCapacityThresholdPct(72720177) - .withPeakStartTime(new Time().withHour(1090911341).withMinute(516508763)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(2099560460).withMinute(63743502)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(852408036) - .withRampDownCapacityThresholdPct(1533389693) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(849896725) - .withRampDownNotificationMessage("jx") - .withOffPeakStartTime(new Time().withHour(2030028307).withMinute(953955678)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), - new ScalingSchedule() - .withName("ptkoenkoukn") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.MONDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY, - ScalingScheduleDaysOfWeekItem.THURSDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY)) - .withRampUpStartTime(new Time().withHour(133898645).withMinute(45967354)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(969530861) - .withRampUpCapacityThresholdPct(626726522) - .withPeakStartTime(new Time().withHour(1997522468).withMinute(655680628)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(1866473569).withMinute(212177726)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(862594448) - .withRampDownCapacityThresholdPct(157234884) - .withRampDownForceLogoffUsers(false) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(1142457061) - .withRampDownNotificationMessage("gevqznty") - .withOffPeakStartTime(new Time().withHour(1534766868).withMinute(1785806943)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), - new ScalingSchedule() - .withName("c") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.FRIDAY, - ScalingScheduleDaysOfWeekItem.FRIDAY)) - .withRampUpStartTime(new Time().withHour(2075884745).withMinute(1295210131)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampUpMinimumHostsPct(229483686) - .withRampUpCapacityThresholdPct(1665159346) - .withPeakStartTime(new Time().withHour(856772857).withMinute(403055260)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownStartTime(new Time().withHour(170373532).withMinute(1718564660)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1909902819) - .withRampDownCapacityThresholdPct(362966046) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) - .withRampDownWaitTimeMinutes(22083476) - .withRampDownNotificationMessage("bkh") - .withOffPeakStartTime(new Time().withHour(2127806039).withMinute(1192393079)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) + .withExclusionTag("pewr") + .withSchedules(Arrays.asList( + new ScalingSchedule().withName("vvjektcxsenhwlrs") + .withDaysOfWeek( + Arrays.asList(ScalingScheduleDaysOfWeekItem.SUNDAY, ScalingScheduleDaysOfWeekItem.SUNDAY, + ScalingScheduleDaysOfWeekItem.MONDAY, ScalingScheduleDaysOfWeekItem.TUESDAY)) + .withRampUpStartTime(new Time().withHour(1497747183).withMinute(1792150681)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1034850835) + .withRampUpCapacityThresholdPct(629213684) + .withPeakStartTime(new Time().withHour(878153378).withMinute(579974713)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1408996613).withMinute(2117678486)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(385263599) + .withRampDownCapacityThresholdPct(1351604805) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) + .withRampDownWaitTimeMinutes(1486569340) + .withRampDownNotificationMessage("uctqhjfbe") + .withOffPeakStartTime(new Time().withHour(75168662).withMinute(1278137451)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), + new ScalingSchedule().withName("fuwutttxf") + .withDaysOfWeek( + Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) + .withRampUpStartTime(new Time().withHour(709039667).withMinute(1236632858)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(99482426) + .withRampUpCapacityThresholdPct(1103023268) + .withPeakStartTime(new Time().withHour(1901169400).withMinute(1504948811)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1999582411).withMinute(442214208)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(1238878906) + .withRampDownCapacityThresholdPct(1975532924) + .withRampDownForceLogoffUsers(true) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(528662531) + .withRampDownNotificationMessage("gjljyoxgvc") + .withOffPeakStartTime(new Time().withHour(1773557410).withMinute(1059812914)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST), + new ScalingSchedule().withName("ghkjeszzhbi") + .withDaysOfWeek( + Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, ScalingScheduleDaysOfWeekItem.FRIDAY)) + .withRampUpStartTime(new Time().withHour(502156658).withMinute(749525568)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampUpMinimumHostsPct(1787736845) + .withRampUpCapacityThresholdPct(215474399) + .withPeakStartTime(new Time().withHour(1703122052).withMinute(1543510738)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1083472425).withMinute(1566120849)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownMinimumHostsPct(68854326) + .withRampDownCapacityThresholdPct(1209438571) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) + .withRampDownWaitTimeMinutes(1961052031) + .withRampDownNotificationMessage("ukgri") + .withOffPeakStartTime(new Time().withHour(390168051).withMinute(1920273783)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST), + new ScalingSchedule().withName("xzpuzycisp") + .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.WEDNESDAY, + ScalingScheduleDaysOfWeekItem.SATURDAY, ScalingScheduleDaysOfWeekItem.FRIDAY, + ScalingScheduleDaysOfWeekItem.FRIDAY)) + .withRampUpStartTime(new Time().withHour(2016688773).withMinute(318334591)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(1687540865) + .withRampUpCapacityThresholdPct(380689806) + .withPeakStartTime(new Time().withHour(1421404379).withMinute(1877210635)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampDownStartTime(new Time().withHour(1122159032).withMinute(500953055)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1684029730) + .withRampDownCapacityThresholdPct(627657952) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(424672875) + .withRampDownNotificationMessage("ynhijggme") + .withOffPeakStartTime(new Time().withHour(983171059).withMinute(930561644)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST))) .withHostPoolReferences( - Arrays - .asList(new ScalingHostPoolReference().withHostPoolArmPath("p").withScalingPlanEnabled(false))); + Arrays.asList(new ScalingHostPoolReference().withHostPoolArmPath("rcvpnazzmhjrunmp") + .withScalingPlanEnabled(true))); model = BinaryData.fromObject(model).toObject(ScalingPlanProperties.class); - Assertions.assertEquals("xc", model.description()); - Assertions.assertEquals("npc", model.friendlyName()); - Assertions.assertEquals("hocohslkev", model.timeZone()); + Assertions.assertEquals("hgyxzkonoc", model.description()); + Assertions.assertEquals("oklyaxuconuq", model.friendlyName()); + Assertions.assertEquals("zf", model.timeZone()); Assertions.assertEquals(ScalingHostPoolType.POOLED, model.hostPoolType()); - Assertions.assertEquals("zfbuhf", model.exclusionTag()); - Assertions.assertEquals("x", model.schedules().get(0).name()); + Assertions.assertEquals("pewr", model.exclusionTag()); + Assertions.assertEquals("vvjektcxsenhwlrs", model.schedules().get(0).name()); Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.SUNDAY, model.schedules().get(0).daysOfWeek().get(0)); - Assertions.assertEquals(378191098, model.schedules().get(0).rampUpStartTime().hour()); - Assertions.assertEquals(1914432251, model.schedules().get(0).rampUpStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(511745945, model.schedules().get(0).rampUpMinimumHostsPct()); - Assertions.assertEquals(72720177, model.schedules().get(0).rampUpCapacityThresholdPct()); - Assertions.assertEquals(1090911341, model.schedules().get(0).peakStartTime().hour()); - Assertions.assertEquals(516508763, model.schedules().get(0).peakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.schedules().get(0).peakLoadBalancingAlgorithm()); - Assertions.assertEquals(2099560460, model.schedules().get(0).rampDownStartTime().hour()); - Assertions.assertEquals(63743502, model.schedules().get(0).rampDownStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, - model.schedules().get(0).rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(852408036, model.schedules().get(0).rampDownMinimumHostsPct()); - Assertions.assertEquals(1533389693, model.schedules().get(0).rampDownCapacityThresholdPct()); + Assertions.assertEquals(1497747183, model.schedules().get(0).rampUpStartTime().hour()); + Assertions.assertEquals(1792150681, model.schedules().get(0).rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(1034850835, model.schedules().get(0).rampUpMinimumHostsPct()); + Assertions.assertEquals(629213684, model.schedules().get(0).rampUpCapacityThresholdPct()); + Assertions.assertEquals(878153378, model.schedules().get(0).peakStartTime().hour()); + Assertions.assertEquals(579974713, model.schedules().get(0).peakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).peakLoadBalancingAlgorithm()); + Assertions.assertEquals(1408996613, model.schedules().get(0).rampDownStartTime().hour()); + Assertions.assertEquals(2117678486, model.schedules().get(0).rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(385263599, model.schedules().get(0).rampDownMinimumHostsPct()); + Assertions.assertEquals(1351604805, model.schedules().get(0).rampDownCapacityThresholdPct()); Assertions.assertEquals(true, model.schedules().get(0).rampDownForceLogoffUsers()); Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.schedules().get(0).rampDownStopHostsWhen()); - Assertions.assertEquals(849896725, model.schedules().get(0).rampDownWaitTimeMinutes()); - Assertions.assertEquals("jx", model.schedules().get(0).rampDownNotificationMessage()); - Assertions.assertEquals(2030028307, model.schedules().get(0).offPeakStartTime().hour()); - Assertions.assertEquals(953955678, model.schedules().get(0).offPeakStartTime().minute()); - Assertions - .assertEquals( - SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, - model.schedules().get(0).offPeakLoadBalancingAlgorithm()); - Assertions.assertEquals("p", model.hostPoolReferences().get(0).hostPoolArmPath()); - Assertions.assertEquals(false, model.hostPoolReferences().get(0).scalingPlanEnabled()); + Assertions.assertEquals(1486569340, model.schedules().get(0).rampDownWaitTimeMinutes()); + Assertions.assertEquals("uctqhjfbe", model.schedules().get(0).rampDownNotificationMessage()); + Assertions.assertEquals(75168662, model.schedules().get(0).offPeakStartTime().hour()); + Assertions.assertEquals(1278137451, model.schedules().get(0).offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, + model.schedules().get(0).offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals("rcvpnazzmhjrunmp", model.hostPoolReferences().get(0).hostPoolArmPath()); + Assertions.assertEquals(true, model.hostPoolReferences().get(0).scalingPlanEnabled()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java index b749591d05a6..9f695b91b209 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingPlansDeleteByResourceGroupWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ScalingPlansDeleteByResourceGroupWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.scalingPlans() + .deleteByResourceGroupWithResponse("ipq", "jedmurrxxgewp", com.azure.core.util.Context.NONE); - manager - .scalingPlans() - .deleteByResourceGroupWithResponse("tcmwqkchc", "waxfewzjkj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java index de1c5dd0a678..926bc3ab215a 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ScalingScheduleTests.java @@ -16,85 +16,78 @@ public final class ScalingScheduleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ScalingSchedule model = - BinaryData - .fromString( - "{\"name\":\"lpbuxwgipwhonowk\",\"daysOfWeek\":[\"Saturday\",\"Wednesday\",\"Tuesday\",\"Saturday\"],\"rampUpStartTime\":{\"hour\":691407592,\"minute\":583460875},\"rampUpLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampUpMinimumHostsPct\":624724935,\"rampUpCapacityThresholdPct\":491108548,\"peakStartTime\":{\"hour\":895884461,\"minute\":1086025239},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":2061883120,\"minute\":998969185},\"rampDownLoadBalancingAlgorithm\":\"DepthFirst\",\"rampDownMinimumHostsPct\":1117331465,\"rampDownCapacityThresholdPct\":591392190,\"rampDownForceLogoffUsers\":true,\"rampDownStopHostsWhen\":\"ZeroActiveSessions\",\"rampDownWaitTimeMinutes\":130500015,\"rampDownNotificationMessage\":\"cqvyxlwhzlsico\",\"offPeakStartTime\":{\"hour\":774640076,\"minute\":1969001145},\"offPeakLoadBalancingAlgorithm\":\"BreadthFirst\"}") - .toObject(ScalingSchedule.class); - Assertions.assertEquals("lpbuxwgipwhonowk", model.name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(691407592, model.rampUpStartTime().hour()); - Assertions.assertEquals(583460875, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(624724935, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(491108548, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(895884461, model.peakStartTime().hour()); - Assertions.assertEquals(1086025239, model.peakStartTime().minute()); + ScalingSchedule model = BinaryData.fromString( + "{\"name\":\"bh\",\"daysOfWeek\":[\"Tuesday\",\"Wednesday\",\"Wednesday\"],\"rampUpStartTime\":{\"hour\":1373205517,\"minute\":1850668583},\"rampUpLoadBalancingAlgorithm\":\"DepthFirst\",\"rampUpMinimumHostsPct\":734884561,\"rampUpCapacityThresholdPct\":1438226066,\"peakStartTime\":{\"hour\":1074926668,\"minute\":1813898530},\"peakLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownStartTime\":{\"hour\":2016648328,\"minute\":564037027},\"rampDownLoadBalancingAlgorithm\":\"BreadthFirst\",\"rampDownMinimumHostsPct\":1607140752,\"rampDownCapacityThresholdPct\":917020287,\"rampDownForceLogoffUsers\":false,\"rampDownStopHostsWhen\":\"ZeroSessions\",\"rampDownWaitTimeMinutes\":123803740,\"rampDownNotificationMessage\":\"ybyxc\",\"offPeakStartTime\":{\"hour\":858824887,\"minute\":439927989},\"offPeakLoadBalancingAlgorithm\":\"DepthFirst\"}") + .toObject(ScalingSchedule.class); + Assertions.assertEquals("bh", model.name()); + Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(1373205517, model.rampUpStartTime().hour()); + Assertions.assertEquals(1850668583, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(734884561, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1438226066, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1074926668, model.peakStartTime().hour()); + Assertions.assertEquals(1813898530, model.peakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(2061883120, model.rampDownStartTime().hour()); - Assertions.assertEquals(998969185, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1117331465, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(591392190, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(130500015, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("cqvyxlwhzlsico", model.rampDownNotificationMessage()); - Assertions.assertEquals(774640076, model.offPeakStartTime().hour()); - Assertions.assertEquals(1969001145, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(2016648328, model.rampDownStartTime().hour()); + Assertions.assertEquals(564037027, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1607140752, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(917020287, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); + Assertions.assertEquals(123803740, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("ybyxc", model.rampDownNotificationMessage()); + Assertions.assertEquals(858824887, model.offPeakStartTime().hour()); + Assertions.assertEquals(439927989, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScalingSchedule model = - new ScalingSchedule() - .withName("lpbuxwgipwhonowk") - .withDaysOfWeek( - Arrays - .asList( - ScalingScheduleDaysOfWeekItem.SATURDAY, - ScalingScheduleDaysOfWeekItem.WEDNESDAY, - ScalingScheduleDaysOfWeekItem.TUESDAY, - ScalingScheduleDaysOfWeekItem.SATURDAY)) - .withRampUpStartTime(new Time().withHour(691407592).withMinute(583460875)) - .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampUpMinimumHostsPct(624724935) - .withRampUpCapacityThresholdPct(491108548) - .withPeakStartTime(new Time().withHour(895884461).withMinute(1086025239)) - .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) - .withRampDownStartTime(new Time().withHour(2061883120).withMinute(998969185)) - .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) - .withRampDownMinimumHostsPct(1117331465) - .withRampDownCapacityThresholdPct(591392190) - .withRampDownForceLogoffUsers(true) - .withRampDownStopHostsWhen(StopHostsWhen.ZERO_ACTIVE_SESSIONS) - .withRampDownWaitTimeMinutes(130500015) - .withRampDownNotificationMessage("cqvyxlwhzlsico") - .withOffPeakStartTime(new Time().withHour(774640076).withMinute(1969001145)) - .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST); + ScalingSchedule model = new ScalingSchedule().withName("bh") + .withDaysOfWeek(Arrays.asList(ScalingScheduleDaysOfWeekItem.TUESDAY, + ScalingScheduleDaysOfWeekItem.WEDNESDAY, ScalingScheduleDaysOfWeekItem.WEDNESDAY)) + .withRampUpStartTime(new Time().withHour(1373205517).withMinute(1850668583)) + .withRampUpLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST) + .withRampUpMinimumHostsPct(734884561) + .withRampUpCapacityThresholdPct(1438226066) + .withPeakStartTime(new Time().withHour(1074926668).withMinute(1813898530)) + .withPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownStartTime(new Time().withHour(2016648328).withMinute(564037027)) + .withRampDownLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST) + .withRampDownMinimumHostsPct(1607140752) + .withRampDownCapacityThresholdPct(917020287) + .withRampDownForceLogoffUsers(false) + .withRampDownStopHostsWhen(StopHostsWhen.ZERO_SESSIONS) + .withRampDownWaitTimeMinutes(123803740) + .withRampDownNotificationMessage("ybyxc") + .withOffPeakStartTime(new Time().withHour(858824887).withMinute(439927989)) + .withOffPeakLoadBalancingAlgorithm(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST); model = BinaryData.fromObject(model).toObject(ScalingSchedule.class); - Assertions.assertEquals("lpbuxwgipwhonowk", model.name()); - Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.SATURDAY, model.daysOfWeek().get(0)); - Assertions.assertEquals(691407592, model.rampUpStartTime().hour()); - Assertions.assertEquals(583460875, model.rampUpStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.rampUpLoadBalancingAlgorithm()); - Assertions.assertEquals(624724935, model.rampUpMinimumHostsPct()); - Assertions.assertEquals(491108548, model.rampUpCapacityThresholdPct()); - Assertions.assertEquals(895884461, model.peakStartTime().hour()); - Assertions.assertEquals(1086025239, model.peakStartTime().minute()); + Assertions.assertEquals("bh", model.name()); + Assertions.assertEquals(ScalingScheduleDaysOfWeekItem.TUESDAY, model.daysOfWeek().get(0)); + Assertions.assertEquals(1373205517, model.rampUpStartTime().hour()); + Assertions.assertEquals(1850668583, model.rampUpStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampUpLoadBalancingAlgorithm()); + Assertions.assertEquals(734884561, model.rampUpMinimumHostsPct()); + Assertions.assertEquals(1438226066, model.rampUpCapacityThresholdPct()); + Assertions.assertEquals(1074926668, model.peakStartTime().hour()); + Assertions.assertEquals(1813898530, model.peakStartTime().minute()); Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.peakLoadBalancingAlgorithm()); - Assertions.assertEquals(2061883120, model.rampDownStartTime().hour()); - Assertions.assertEquals(998969185, model.rampDownStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.rampDownLoadBalancingAlgorithm()); - Assertions.assertEquals(1117331465, model.rampDownMinimumHostsPct()); - Assertions.assertEquals(591392190, model.rampDownCapacityThresholdPct()); - Assertions.assertEquals(true, model.rampDownForceLogoffUsers()); - Assertions.assertEquals(StopHostsWhen.ZERO_ACTIVE_SESSIONS, model.rampDownStopHostsWhen()); - Assertions.assertEquals(130500015, model.rampDownWaitTimeMinutes()); - Assertions.assertEquals("cqvyxlwhzlsico", model.rampDownNotificationMessage()); - Assertions.assertEquals(774640076, model.offPeakStartTime().hour()); - Assertions.assertEquals(1969001145, model.offPeakStartTime().minute()); - Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, model.offPeakLoadBalancingAlgorithm()); + Assertions.assertEquals(2016648328, model.rampDownStartTime().hour()); + Assertions.assertEquals(564037027, model.rampDownStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.BREADTH_FIRST, + model.rampDownLoadBalancingAlgorithm()); + Assertions.assertEquals(1607140752, model.rampDownMinimumHostsPct()); + Assertions.assertEquals(917020287, model.rampDownCapacityThresholdPct()); + Assertions.assertEquals(false, model.rampDownForceLogoffUsers()); + Assertions.assertEquals(StopHostsWhen.ZERO_SESSIONS, model.rampDownStopHostsWhen()); + Assertions.assertEquals(123803740, model.rampDownWaitTimeMinutes()); + Assertions.assertEquals("ybyxc", model.rampDownNotificationMessage()); + Assertions.assertEquals(858824887, model.offPeakStartTime().hour()); + Assertions.assertEquals(439927989, model.offPeakStartTime().minute()); + Assertions.assertEquals(SessionHostLoadBalancingAlgorithm.DEPTH_FIRST, model.offPeakLoadBalancingAlgorithm()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java index 4a566097fd95..fb4ecf13a6fd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SendMessageTests.java @@ -11,19 +11,17 @@ public final class SendMessageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SendMessage model = - BinaryData - .fromString("{\"messageTitle\":\"srdvetn\",\"messageBody\":\"dtutnwldu\"}") - .toObject(SendMessage.class); - Assertions.assertEquals("srdvetn", model.messageTitle()); - Assertions.assertEquals("dtutnwldu", model.messageBody()); + SendMessage model = BinaryData.fromString("{\"messageTitle\":\"dhgbjkvre\",\"messageBody\":\"eamurvzmlo\"}") + .toObject(SendMessage.class); + Assertions.assertEquals("dhgbjkvre", model.messageTitle()); + Assertions.assertEquals("eamurvzmlo", model.messageBody()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SendMessage model = new SendMessage().withMessageTitle("srdvetn").withMessageBody("dtutnwldu"); + SendMessage model = new SendMessage().withMessageTitle("dhgbjkvre").withMessageBody("eamurvzmlo"); model = BinaryData.fromObject(model).toObject(SendMessage.class); - Assertions.assertEquals("srdvetn", model.messageTitle()); - Assertions.assertEquals("dtutnwldu", model.messageBody()); + Assertions.assertEquals("dhgbjkvre", model.messageTitle()); + Assertions.assertEquals("eamurvzmlo", model.messageBody()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java index dd24493b8611..b4ab4b2bd41d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/ServiceSpecificationTests.java @@ -13,11 +13,9 @@ public final class ServiceSpecificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceSpecification model = - BinaryData - .fromString( - "{\"logSpecifications\":[{\"name\":\"qniwbybrkxvdumj\",\"displayName\":\"tfwvukxgaudc\",\"blobDuration\":\"nhsjcnyej\"}]}") - .toObject(ServiceSpecification.class); + ServiceSpecification model = BinaryData.fromString( + "{\"logSpecifications\":[{\"name\":\"qniwbybrkxvdumj\",\"displayName\":\"tfwvukxgaudc\",\"blobDuration\":\"nhsjcnyej\"}]}") + .toObject(ServiceSpecification.class); Assertions.assertEquals("qniwbybrkxvdumj", model.logSpecifications().get(0).name()); Assertions.assertEquals("tfwvukxgaudc", model.logSpecifications().get(0).displayName()); Assertions.assertEquals("nhsjcnyej", model.logSpecifications().get(0).blobDuration()); @@ -25,15 +23,10 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceSpecification model = - new ServiceSpecification() - .withLogSpecifications( - Arrays - .asList( - new LogSpecification() - .withName("qniwbybrkxvdumj") - .withDisplayName("tfwvukxgaudc") - .withBlobDuration("nhsjcnyej"))); + ServiceSpecification model = new ServiceSpecification() + .withLogSpecifications(Arrays.asList(new LogSpecification().withName("qniwbybrkxvdumj") + .withDisplayName("tfwvukxgaudc") + .withBlobDuration("nhsjcnyej"))); model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); Assertions.assertEquals("qniwbybrkxvdumj", model.logSpecifications().get(0).name()); Assertions.assertEquals("tfwvukxgaudc", model.logSpecifications().get(0).displayName()); diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java index a077bd4d6d2b..992377f11e95 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostListTests.java @@ -16,90 +16,47 @@ public final class SessionHostListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SessionHostList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"ygvjayvblmh\",\"lastHeartBeat\":\"2021-07-26T11:14:50Z\",\"sessions\":2100624724,\"agentVersion\":\"xvvy\",\"allowNewSession\":false,\"virtualMachineId\":\"pbyrqufegxu\",\"resourceId\":\"zfbn\",\"assignedUser\":\"mctlpdngitv\",\"friendlyName\":\"mhrixkwmyijejve\",\"status\":\"NeedsAssistance\",\"statusTimestamp\":\"2021-09-18T06:49:11Z\",\"osVersion\":\"aixexccbdreaxh\",\"sxSStackVersion\":\"xdrrvqahqkghtp\",\"updateState\":\"Initial\",\"lastUpdateTime\":\"2021-03-19T04:26:57Z\",\"updateErrorMessage\":\"jsvfycxzbfvoowv\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"WebRTCRedirectorCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"pyostronzmyhgfi\",\"name\":\"nsxkmcwaekrrjr\",\"type\":\"afxtsgum\"},{\"properties\":{\"objectId\":\"ikkx\",\"lastHeartBeat\":\"2021-05-16T06:07:50Z\",\"sessions\":1513768261,\"agentVersion\":\"qpvuzlmvfelf\",\"allowNewSession\":true,\"virtualMachineId\":\"lcrpw\",\"resourceId\":\"eznoig\",\"assignedUser\":\"njwmwkpnbsazejj\",\"friendlyName\":\"kagfhsxtt\",\"status\":\"Available\",\"statusTimestamp\":\"2021-04-24T19:56:55Z\",\"osVersion\":\"faazpxdtnkdmkqjj\",\"sxSStackVersion\":\"uenvrkp\",\"updateState\":\"Failed\",\"lastUpdateTime\":\"2021-06-02T18:39:14Z\",\"updateErrorMessage\":\"rebqaaysjk\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"SxSStackListenerCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"UrlsAccessibleCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"ffiakp\",\"name\":\"pqqmted\",\"type\":\"tmmjihyeozph\"},{\"properties\":{\"objectId\":\"y\",\"lastHeartBeat\":\"2021-05-03T13:45:25Z\",\"sessions\":1385853585,\"agentVersion\":\"p\",\"allowNewSession\":false,\"virtualMachineId\":\"mdscwxqupev\",\"resourceId\":\"f\",\"assignedUser\":\"otxhojujby\",\"friendlyName\":\"lmcuvhixb\",\"status\":\"NeedsAssistance\",\"statusTimestamp\":\"2021-03-04T07:09:13Z\",\"osVersion\":\"yl\",\"sxSStackVersion\":\"ool\",\"updateState\":\"Started\",\"lastUpdateTime\":\"2021-01-29T16:46:41Z\",\"updateErrorMessage\":\"w\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"MetaDataServiceCheck\",\"healthCheckResult\":\"HealthCheckFailed\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"DomainTrustCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"SupportedEncryptionCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"MetaDataServiceCheck\",\"healthCheckResult\":\"HealthCheckFailed\",\"additionalFailureDetails\":{}}]},\"id\":\"wiithtywub\",\"name\":\"cbihwqk\",\"type\":\"fdntwjchrdgoih\"},{\"properties\":{\"objectId\":\"ctondz\",\"lastHeartBeat\":\"2021-05-20T02:25:29Z\",\"sessions\":382280149,\"agentVersion\":\"dlwggytsbwtovv\",\"allowNewSession\":true,\"virtualMachineId\":\"inqfiufxqknpirgn\",\"resourceId\":\"ttwqmsni\",\"assignedUser\":\"cdm\",\"friendlyName\":\"r\",\"status\":\"Disconnected\",\"statusTimestamp\":\"2021-07-05T10:57:07Z\",\"osVersion\":\"nkrxfrddhcr\",\"sxSStackVersion\":\"izzronasxiftozqy\",\"updateState\":\"Failed\",\"lastUpdateTime\":\"2021-07-28T03:20:11Z\",\"updateErrorMessage\":\"sgogczhonnxk\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"DomainReachable\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"WebRTCRedirectorCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"WebRTCRedirectorCheck\",\"healthCheckResult\":\"SessionHostShutdown\",\"additionalFailureDetails\":{}}]},\"id\":\"gh\",\"name\":\"jbdhqxvc\",\"type\":\"gf\"}],\"nextLink\":\"dsofbshrns\"}") - .toObject(SessionHostList.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-26T11:14:50Z"), model.value().get(0).lastHeartBeat()); - Assertions.assertEquals(2100624724, model.value().get(0).sessions()); - Assertions.assertEquals("xvvy", model.value().get(0).agentVersion()); + SessionHostList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"objectId\":\"zrypqlmfeokerqw\",\"lastHeartBeat\":\"2021-11-05T16:27:54Z\",\"sessions\":359384916,\"agentVersion\":\"opgxedkowepb\",\"allowNewSession\":false,\"virtualMachineId\":\"fkbw\",\"resourceId\":\"snjvcdwxlpqekftn\",\"assignedUser\":\"tjsyin\",\"friendlyName\":\"fq\",\"status\":\"UpgradeFailed\",\"statusTimestamp\":\"2021-03-09T17:47:29Z\",\"osVersion\":\"tmdvypgikdgs\",\"sxSStackVersion\":\"w\",\"updateState\":\"Failed\",\"lastUpdateTime\":\"2021-12-09T01:29:35Z\",\"updateErrorMessage\":\"uzhlhkjoqrv\",\"sessionHostHealthCheckResults\":[{\"healthCheckName\":\"SxSStackListenerCheck\",\"healthCheckResult\":\"HealthCheckFailed\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"FSLogixHealthCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"MonitoringAgentCheck\",\"healthCheckResult\":\"HealthCheckSucceeded\",\"additionalFailureDetails\":{}},{\"healthCheckName\":\"DomainTrustCheck\",\"healthCheckResult\":\"Unknown\",\"additionalFailureDetails\":{}}]},\"id\":\"ool\",\"name\":\"rwxkvtkkgl\",\"type\":\"qwjygvja\"}],\"nextLink\":\"blmhvkzuhb\"}") + .toObject(SessionHostList.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T16:27:54Z"), model.value().get(0).lastHeartBeat()); + Assertions.assertEquals(359384916, model.value().get(0).sessions()); + Assertions.assertEquals("opgxedkowepb", model.value().get(0).agentVersion()); Assertions.assertEquals(false, model.value().get(0).allowNewSession()); - Assertions.assertEquals("mctlpdngitv", model.value().get(0).assignedUser()); - Assertions.assertEquals("mhrixkwmyijejve", model.value().get(0).friendlyName()); - Assertions.assertEquals(Status.NEEDS_ASSISTANCE, model.value().get(0).status()); - Assertions.assertEquals("aixexccbdreaxh", model.value().get(0).osVersion()); - Assertions.assertEquals("xdrrvqahqkghtp", model.value().get(0).sxSStackVersion()); - Assertions.assertEquals(UpdateState.INITIAL, model.value().get(0).updateState()); - Assertions.assertEquals("jsvfycxzbfvoowv", model.value().get(0).updateErrorMessage()); + Assertions.assertEquals("tjsyin", model.value().get(0).assignedUser()); + Assertions.assertEquals("fq", model.value().get(0).friendlyName()); + Assertions.assertEquals(Status.UPGRADE_FAILED, model.value().get(0).status()); + Assertions.assertEquals("tmdvypgikdgs", model.value().get(0).osVersion()); + Assertions.assertEquals("w", model.value().get(0).sxSStackVersion()); + Assertions.assertEquals(UpdateState.FAILED, model.value().get(0).updateState()); + Assertions.assertEquals("uzhlhkjoqrv", model.value().get(0).updateErrorMessage()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionHostList model = - new SessionHostList() - .withValue( - Arrays - .asList( - new SessionHostInner() - .withLastHeartBeat(OffsetDateTime.parse("2021-07-26T11:14:50Z")) - .withSessions(2100624724) - .withAgentVersion("xvvy") - .withAllowNewSession(false) - .withAssignedUser("mctlpdngitv") - .withFriendlyName("mhrixkwmyijejve") - .withStatus(Status.NEEDS_ASSISTANCE) - .withOsVersion("aixexccbdreaxh") - .withSxSStackVersion("xdrrvqahqkghtp") - .withUpdateState(UpdateState.INITIAL) - .withUpdateErrorMessage("jsvfycxzbfvoowv"), - new SessionHostInner() - .withLastHeartBeat(OffsetDateTime.parse("2021-05-16T06:07:50Z")) - .withSessions(1513768261) - .withAgentVersion("qpvuzlmvfelf") - .withAllowNewSession(true) - .withAssignedUser("njwmwkpnbsazejj") - .withFriendlyName("kagfhsxtt") - .withStatus(Status.AVAILABLE) - .withOsVersion("faazpxdtnkdmkqjj") - .withSxSStackVersion("uenvrkp") - .withUpdateState(UpdateState.FAILED) - .withUpdateErrorMessage("rebqaaysjk"), - new SessionHostInner() - .withLastHeartBeat(OffsetDateTime.parse("2021-05-03T13:45:25Z")) - .withSessions(1385853585) - .withAgentVersion("p") - .withAllowNewSession(false) - .withAssignedUser("otxhojujby") - .withFriendlyName("lmcuvhixb") - .withStatus(Status.NEEDS_ASSISTANCE) - .withOsVersion("yl") - .withSxSStackVersion("ool") - .withUpdateState(UpdateState.STARTED) - .withUpdateErrorMessage("w"), - new SessionHostInner() - .withLastHeartBeat(OffsetDateTime.parse("2021-05-20T02:25:29Z")) - .withSessions(382280149) - .withAgentVersion("dlwggytsbwtovv") - .withAllowNewSession(true) - .withAssignedUser("cdm") - .withFriendlyName("r") - .withStatus(Status.DISCONNECTED) - .withOsVersion("nkrxfrddhcr") - .withSxSStackVersion("izzronasxiftozqy") - .withUpdateState(UpdateState.FAILED) - .withUpdateErrorMessage("sgogczhonnxk"))); + SessionHostList model = new SessionHostList().withValue( + Arrays.asList(new SessionHostInner().withLastHeartBeat(OffsetDateTime.parse("2021-11-05T16:27:54Z")) + .withSessions(359384916) + .withAgentVersion("opgxedkowepb") + .withAllowNewSession(false) + .withAssignedUser("tjsyin") + .withFriendlyName("fq") + .withStatus(Status.UPGRADE_FAILED) + .withOsVersion("tmdvypgikdgs") + .withSxSStackVersion("w") + .withUpdateState(UpdateState.FAILED) + .withUpdateErrorMessage("uzhlhkjoqrv"))); model = BinaryData.fromObject(model).toObject(SessionHostList.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-26T11:14:50Z"), model.value().get(0).lastHeartBeat()); - Assertions.assertEquals(2100624724, model.value().get(0).sessions()); - Assertions.assertEquals("xvvy", model.value().get(0).agentVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T16:27:54Z"), model.value().get(0).lastHeartBeat()); + Assertions.assertEquals(359384916, model.value().get(0).sessions()); + Assertions.assertEquals("opgxedkowepb", model.value().get(0).agentVersion()); Assertions.assertEquals(false, model.value().get(0).allowNewSession()); - Assertions.assertEquals("mctlpdngitv", model.value().get(0).assignedUser()); - Assertions.assertEquals("mhrixkwmyijejve", model.value().get(0).friendlyName()); - Assertions.assertEquals(Status.NEEDS_ASSISTANCE, model.value().get(0).status()); - Assertions.assertEquals("aixexccbdreaxh", model.value().get(0).osVersion()); - Assertions.assertEquals("xdrrvqahqkghtp", model.value().get(0).sxSStackVersion()); - Assertions.assertEquals(UpdateState.INITIAL, model.value().get(0).updateState()); - Assertions.assertEquals("jsvfycxzbfvoowv", model.value().get(0).updateErrorMessage()); + Assertions.assertEquals("tjsyin", model.value().get(0).assignedUser()); + Assertions.assertEquals("fq", model.value().get(0).friendlyName()); + Assertions.assertEquals(Status.UPGRADE_FAILED, model.value().get(0).status()); + Assertions.assertEquals("tmdvypgikdgs", model.value().get(0).osVersion()); + Assertions.assertEquals("w", model.value().get(0).sxSStackVersion()); + Assertions.assertEquals(UpdateState.FAILED, model.value().get(0).updateState()); + Assertions.assertEquals("uzhlhkjoqrv", model.value().get(0).updateErrorMessage()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java index 2b1354f095a8..72097f264f7e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchPropertiesTests.java @@ -11,25 +11,22 @@ public final class SessionHostPatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SessionHostPatchProperties model = - BinaryData - .fromString("{\"allowNewSession\":false,\"assignedUser\":\"vrwxkv\",\"friendlyName\":\"k\"}") + SessionHostPatchProperties model + = BinaryData.fromString("{\"allowNewSession\":true,\"assignedUser\":\"svuo\",\"friendlyName\":\"gc\"}") .toObject(SessionHostPatchProperties.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("vrwxkv", model.assignedUser()); - Assertions.assertEquals("k", model.friendlyName()); + Assertions.assertEquals(true, model.allowNewSession()); + Assertions.assertEquals("svuo", model.assignedUser()); + Assertions.assertEquals("gc", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionHostPatchProperties model = - new SessionHostPatchProperties() - .withAllowNewSession(false) - .withAssignedUser("vrwxkv") - .withFriendlyName("k"); + SessionHostPatchProperties model = new SessionHostPatchProperties().withAllowNewSession(true) + .withAssignedUser("svuo") + .withFriendlyName("gc"); model = BinaryData.fromObject(model).toObject(SessionHostPatchProperties.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("vrwxkv", model.assignedUser()); - Assertions.assertEquals("k", model.friendlyName()); + Assertions.assertEquals(true, model.allowNewSession()); + Assertions.assertEquals("svuo", model.assignedUser()); + Assertions.assertEquals("gc", model.friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java index 2e42175df295..24927c739a3e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostPatchTests.java @@ -11,23 +11,21 @@ public final class SessionHostPatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SessionHostPatch model = - BinaryData - .fromString( - "{\"properties\":{\"allowNewSession\":false,\"assignedUser\":\"zywkb\",\"friendlyName\":\"ryuzh\"},\"id\":\"hkjoqr\",\"name\":\"qqaatjinrvgou\",\"type\":\"mfiibfggj\"}") - .toObject(SessionHostPatch.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("zywkb", model.assignedUser()); - Assertions.assertEquals("ryuzh", model.friendlyName()); + SessionHostPatch model = BinaryData.fromString( + "{\"properties\":{\"allowNewSession\":true,\"assignedUser\":\"cyajguqf\",\"friendlyName\":\"ygz\"},\"id\":\"dnkfx\",\"name\":\"semdwzrmu\",\"type\":\"apfcqdpsq\"}") + .toObject(SessionHostPatch.class); + Assertions.assertEquals(true, model.allowNewSession()); + Assertions.assertEquals("cyajguqf", model.assignedUser()); + Assertions.assertEquals("ygz", model.friendlyName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SessionHostPatch model = - new SessionHostPatch().withAllowNewSession(false).withAssignedUser("zywkb").withFriendlyName("ryuzh"); + SessionHostPatch model + = new SessionHostPatch().withAllowNewSession(true).withAssignedUser("cyajguqf").withFriendlyName("ygz"); model = BinaryData.fromObject(model).toObject(SessionHostPatch.class); - Assertions.assertEquals(false, model.allowNewSession()); - Assertions.assertEquals("zywkb", model.assignedUser()); - Assertions.assertEquals("ryuzh", model.friendlyName()); + Assertions.assertEquals(true, model.allowNewSession()); + Assertions.assertEquals("cyajguqf", model.assignedUser()); + Assertions.assertEquals("ygz", model.friendlyName()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java index a6e30281ee01..f2afa74fc51e 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SessionHostsDeleteWithResponseMockTests.java @@ -6,58 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SessionHostsDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.sessionHosts() + .deleteWithResponse("lujyxkyxl", "gsjgkzzlta", "hbzffovwmbjlzqs", true, com.azure.core.util.Context.NONE); - manager - .sessionHosts() - .deleteWithResponse("rrscubiwsdrnp", "qwodiffjx", "jrmmuabwib", false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java index eace254e9da0..f2cc5f2abd94 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/SkuTests.java @@ -12,32 +12,28 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Sku model = - BinaryData - .fromString( - "{\"name\":\"a\",\"tier\":\"Standard\",\"size\":\"izuckyfihrfidfvz\",\"family\":\"zuhtymwisdkfthwx\",\"capacity\":61317803}") - .toObject(Sku.class); - Assertions.assertEquals("a", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("izuckyfihrfidfvz", model.size()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.family()); - Assertions.assertEquals(61317803, model.capacity()); + Sku model = BinaryData.fromString( + "{\"name\":\"ujysvle\",\"tier\":\"Premium\",\"size\":\"qawrlyxwj\",\"family\":\"prbnwbxgjvtbv\",\"capacity\":1783786624}") + .toObject(Sku.class); + Assertions.assertEquals("ujysvle", model.name()); + Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); + Assertions.assertEquals("qawrlyxwj", model.size()); + Assertions.assertEquals("prbnwbxgjvtbv", model.family()); + Assertions.assertEquals(1783786624, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = - new Sku() - .withName("a") - .withTier(SkuTier.STANDARD) - .withSize("izuckyfihrfidfvz") - .withFamily("zuhtymwisdkfthwx") - .withCapacity(61317803); + Sku model = new Sku().withName("ujysvle") + .withTier(SkuTier.PREMIUM) + .withSize("qawrlyxwj") + .withFamily("prbnwbxgjvtbv") + .withCapacity(1783786624); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("a", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("izuckyfihrfidfvz", model.size()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.family()); - Assertions.assertEquals(61317803, model.capacity()); + Assertions.assertEquals("ujysvle", model.name()); + Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); + Assertions.assertEquals("qawrlyxwj", model.size()); + Assertions.assertEquals("prbnwbxgjvtbv", model.family()); + Assertions.assertEquals(1783786624, model.capacity()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java index 0e4f9cd3a0f2..387653d3b675 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemInnerTests.java @@ -11,32 +11,28 @@ public final class StartMenuItemInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - StartMenuItemInner model = - BinaryData - .fromString( - "{\"properties\":{\"appAlias\":\"jrjxgciqibrhosx\",\"filePath\":\"qrhzoymibmrqyib\",\"commandLineArguments\":\"wfluszdt\",\"iconPath\":\"rkwofyyvoqa\",\"iconIndex\":848769798},\"id\":\"expbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}") - .toObject(StartMenuItemInner.class); - Assertions.assertEquals("jrjxgciqibrhosx", model.appAlias()); - Assertions.assertEquals("qrhzoymibmrqyib", model.filePath()); - Assertions.assertEquals("wfluszdt", model.commandLineArguments()); - Assertions.assertEquals("rkwofyyvoqa", model.iconPath()); - Assertions.assertEquals(848769798, model.iconIndex()); + StartMenuItemInner model = BinaryData.fromString( + "{\"properties\":{\"appAlias\":\"cdyhbpkkpwdreqn\",\"filePath\":\"vq\",\"commandLineArguments\":\"vljxywsu\",\"iconPath\":\"yrs\",\"iconIndex\":1066362942},\"id\":\"tgadgvraeaen\",\"name\":\"qnzarrwl\",\"type\":\"uu\"}") + .toObject(StartMenuItemInner.class); + Assertions.assertEquals("cdyhbpkkpwdreqn", model.appAlias()); + Assertions.assertEquals("vq", model.filePath()); + Assertions.assertEquals("vljxywsu", model.commandLineArguments()); + Assertions.assertEquals("yrs", model.iconPath()); + Assertions.assertEquals(1066362942, model.iconIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StartMenuItemInner model = - new StartMenuItemInner() - .withAppAlias("jrjxgciqibrhosx") - .withFilePath("qrhzoymibmrqyib") - .withCommandLineArguments("wfluszdt") - .withIconPath("rkwofyyvoqa") - .withIconIndex(848769798); + StartMenuItemInner model = new StartMenuItemInner().withAppAlias("cdyhbpkkpwdreqn") + .withFilePath("vq") + .withCommandLineArguments("vljxywsu") + .withIconPath("yrs") + .withIconIndex(1066362942); model = BinaryData.fromObject(model).toObject(StartMenuItemInner.class); - Assertions.assertEquals("jrjxgciqibrhosx", model.appAlias()); - Assertions.assertEquals("qrhzoymibmrqyib", model.filePath()); - Assertions.assertEquals("wfluszdt", model.commandLineArguments()); - Assertions.assertEquals("rkwofyyvoqa", model.iconPath()); - Assertions.assertEquals(848769798, model.iconIndex()); + Assertions.assertEquals("cdyhbpkkpwdreqn", model.appAlias()); + Assertions.assertEquals("vq", model.filePath()); + Assertions.assertEquals("vljxywsu", model.commandLineArguments()); + Assertions.assertEquals("yrs", model.iconPath()); + Assertions.assertEquals(1066362942, model.iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java index c74224404417..096ac43f1489 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemListTests.java @@ -13,42 +13,39 @@ public final class StartMenuItemListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - StartMenuItemList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"appAlias\":\"pdggkzzlvm\",\"filePath\":\"paxmodfvuefywsb\",\"commandLineArguments\":\"vmwy\",\"iconPath\":\"fouyf\",\"iconIndex\":938616277},\"id\":\"kcpwiy\",\"name\":\"vqtmnub\",\"type\":\"xkp\"},{\"properties\":{\"appAlias\":\"mond\",\"filePath\":\"quxvypomgkop\",\"commandLineArguments\":\"hojvpajqgxysmocm\",\"iconPath\":\"fqvm\",\"iconIndex\":1181340997},\"id\":\"oz\",\"name\":\"pvhelxprg\",\"type\":\"yat\"}],\"nextLink\":\"ckcb\"}") - .toObject(StartMenuItemList.class); - Assertions.assertEquals("pdggkzzlvm", model.value().get(0).appAlias()); - Assertions.assertEquals("paxmodfvuefywsb", model.value().get(0).filePath()); - Assertions.assertEquals("vmwy", model.value().get(0).commandLineArguments()); - Assertions.assertEquals("fouyf", model.value().get(0).iconPath()); - Assertions.assertEquals(938616277, model.value().get(0).iconIndex()); + StartMenuItemList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"appAlias\":\"ksmond\",\"filePath\":\"quxvypomgkop\",\"commandLineArguments\":\"hojvpajqgxysmocm\",\"iconPath\":\"fqvm\",\"iconIndex\":1181340997},\"id\":\"zapvhelx\",\"name\":\"rgly\",\"type\":\"tddckcb\"},{\"properties\":{\"appAlias\":\"jrjxgciqibrhosx\",\"filePath\":\"qrhzoymibmrqyib\",\"commandLineArguments\":\"wfluszdt\",\"iconPath\":\"rkwofyyvoqa\",\"iconIndex\":848769798},\"id\":\"xpbtgiwbwo\",\"name\":\"nwashrtd\",\"type\":\"kcnqxwbpo\"},{\"properties\":{\"appAlias\":\"pi\",\"filePath\":\"waasip\",\"commandLineArguments\":\"iobyu\",\"iconPath\":\"rpqlp\",\"iconIndex\":1285990077},\"id\":\"iuqgbdbutauv\",\"name\":\"btkuwhh\",\"type\":\"hykojoxafnndlpic\"}],\"nextLink\":\"o\"}") + .toObject(StartMenuItemList.class); + Assertions.assertEquals("ksmond", model.value().get(0).appAlias()); + Assertions.assertEquals("quxvypomgkop", model.value().get(0).filePath()); + Assertions.assertEquals("hojvpajqgxysmocm", model.value().get(0).commandLineArguments()); + Assertions.assertEquals("fqvm", model.value().get(0).iconPath()); + Assertions.assertEquals(1181340997, model.value().get(0).iconIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StartMenuItemList model = - new StartMenuItemList() - .withValue( - Arrays - .asList( - new StartMenuItemInner() - .withAppAlias("pdggkzzlvm") - .withFilePath("paxmodfvuefywsb") - .withCommandLineArguments("vmwy") - .withIconPath("fouyf") - .withIconIndex(938616277), - new StartMenuItemInner() - .withAppAlias("mond") - .withFilePath("quxvypomgkop") - .withCommandLineArguments("hojvpajqgxysmocm") - .withIconPath("fqvm") - .withIconIndex(1181340997))); + StartMenuItemList model = new StartMenuItemList().withValue(Arrays.asList( + new StartMenuItemInner().withAppAlias("ksmond") + .withFilePath("quxvypomgkop") + .withCommandLineArguments("hojvpajqgxysmocm") + .withIconPath("fqvm") + .withIconIndex(1181340997), + new StartMenuItemInner().withAppAlias("jrjxgciqibrhosx") + .withFilePath("qrhzoymibmrqyib") + .withCommandLineArguments("wfluszdt") + .withIconPath("rkwofyyvoqa") + .withIconIndex(848769798), + new StartMenuItemInner().withAppAlias("pi") + .withFilePath("waasip") + .withCommandLineArguments("iobyu") + .withIconPath("rpqlp") + .withIconIndex(1285990077))); model = BinaryData.fromObject(model).toObject(StartMenuItemList.class); - Assertions.assertEquals("pdggkzzlvm", model.value().get(0).appAlias()); - Assertions.assertEquals("paxmodfvuefywsb", model.value().get(0).filePath()); - Assertions.assertEquals("vmwy", model.value().get(0).commandLineArguments()); - Assertions.assertEquals("fouyf", model.value().get(0).iconPath()); - Assertions.assertEquals(938616277, model.value().get(0).iconIndex()); + Assertions.assertEquals("ksmond", model.value().get(0).appAlias()); + Assertions.assertEquals("quxvypomgkop", model.value().get(0).filePath()); + Assertions.assertEquals("hojvpajqgxysmocm", model.value().get(0).commandLineArguments()); + Assertions.assertEquals("fqvm", model.value().get(0).iconPath()); + Assertions.assertEquals(1181340997, model.value().get(0).iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java index f90489efdb54..d3ed0767d02f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemPropertiesTests.java @@ -11,32 +11,28 @@ public final class StartMenuItemPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - StartMenuItemProperties model = - BinaryData - .fromString( - "{\"appAlias\":\"cnqxwbpokulpi\",\"filePath\":\"waasip\",\"commandLineArguments\":\"iobyu\",\"iconPath\":\"rpqlp\",\"iconIndex\":1285990077}") - .toObject(StartMenuItemProperties.class); - Assertions.assertEquals("cnqxwbpokulpi", model.appAlias()); - Assertions.assertEquals("waasip", model.filePath()); - Assertions.assertEquals("iobyu", model.commandLineArguments()); - Assertions.assertEquals("rpqlp", model.iconPath()); - Assertions.assertEquals(1285990077, model.iconIndex()); + StartMenuItemProperties model = BinaryData.fromString( + "{\"appAlias\":\"fqka\",\"filePath\":\"wiipfpub\",\"commandLineArguments\":\"bwwift\",\"iconPath\":\"qkvpuvksgplsakn\",\"iconIndex\":792282663}") + .toObject(StartMenuItemProperties.class); + Assertions.assertEquals("fqka", model.appAlias()); + Assertions.assertEquals("wiipfpub", model.filePath()); + Assertions.assertEquals("bwwift", model.commandLineArguments()); + Assertions.assertEquals("qkvpuvksgplsakn", model.iconPath()); + Assertions.assertEquals(792282663, model.iconIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StartMenuItemProperties model = - new StartMenuItemProperties() - .withAppAlias("cnqxwbpokulpi") - .withFilePath("waasip") - .withCommandLineArguments("iobyu") - .withIconPath("rpqlp") - .withIconIndex(1285990077); + StartMenuItemProperties model = new StartMenuItemProperties().withAppAlias("fqka") + .withFilePath("wiipfpub") + .withCommandLineArguments("bwwift") + .withIconPath("qkvpuvksgplsakn") + .withIconIndex(792282663); model = BinaryData.fromObject(model).toObject(StartMenuItemProperties.class); - Assertions.assertEquals("cnqxwbpokulpi", model.appAlias()); - Assertions.assertEquals("waasip", model.filePath()); - Assertions.assertEquals("iobyu", model.commandLineArguments()); - Assertions.assertEquals("rpqlp", model.iconPath()); - Assertions.assertEquals(1285990077, model.iconIndex()); + Assertions.assertEquals("fqka", model.appAlias()); + Assertions.assertEquals("wiipfpub", model.filePath()); + Assertions.assertEquals("bwwift", model.commandLineArguments()); + Assertions.assertEquals("qkvpuvksgplsakn", model.iconPath()); + Assertions.assertEquals(792282663, model.iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java index 7c014e40b947..d0b3ce63b379 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/StartMenuItemsListMockTests.java @@ -6,69 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItem; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class StartMenuItemsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"appAlias\":\"vwwskondcbr\",\"filePath\":\"muvqejosovyr\",\"commandLineArguments\":\"eaesin\",\"iconPath\":\"tljqobbpih\",\"iconIndex\":1941467727},\"id\":\"ecybmrqbrj\",\"name\":\"bmpxdlvykfrexc\",\"type\":\"s\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .startMenuItems() - .list("whqjjyslurlpshhk", "pedwqsl", 510077945, false, 1919863050, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vwwskondcbr", response.iterator().next().appAlias()); - Assertions.assertEquals("muvqejosovyr", response.iterator().next().filePath()); - Assertions.assertEquals("eaesin", response.iterator().next().commandLineArguments()); - Assertions.assertEquals("tljqobbpih", response.iterator().next().iconPath()); - Assertions.assertEquals(1941467727, response.iterator().next().iconIndex()); + String responseStr + = "{\"value\":[{\"properties\":{\"appAlias\":\"jpvuaurkihcirld\",\"filePath\":\"xrdcoxnbkkja\",\"commandLineArguments\":\"rnnqb\",\"iconPath\":\"bpizxqltgr\",\"iconIndex\":2097623376},\"id\":\"pxrxvbfihwu\",\"name\":\"vctafsrb\",\"type\":\"rblmli\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.startMenuItems() + .list("bkdq", "rdzsylollgtrczzy", 360585194, false, 2080792970, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("jpvuaurkihcirld", response.iterator().next().appAlias()); + Assertions.assertEquals("xrdcoxnbkkja", response.iterator().next().filePath()); + Assertions.assertEquals("rnnqb", response.iterator().next().commandLineArguments()); + Assertions.assertEquals("bpizxqltgr", response.iterator().next().iconPath()); + Assertions.assertEquals(2097623376, response.iterator().next().iconIndex()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java index 263165be8c0a..477c69fd0c3f 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/TimeTests.java @@ -11,16 +11,16 @@ public final class TimeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Time model = BinaryData.fromString("{\"hour\":1797950253,\"minute\":1146711687}").toObject(Time.class); - Assertions.assertEquals(1797950253, model.hour()); - Assertions.assertEquals(1146711687, model.minute()); + Time model = BinaryData.fromString("{\"hour\":2035107412,\"minute\":384139525}").toObject(Time.class); + Assertions.assertEquals(2035107412, model.hour()); + Assertions.assertEquals(384139525, model.minute()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Time model = new Time().withHour(1797950253).withMinute(1146711687); + Time model = new Time().withHour(2035107412).withMinute(384139525); model = BinaryData.fromObject(model).toObject(Time.class); - Assertions.assertEquals(1797950253, model.hour()); - Assertions.assertEquals(1146711687, model.minute()); + Assertions.assertEquals(2035107412, model.hour()); + Assertions.assertEquals(384139525, model.minute()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java index cccf0f849e31..7b7b74924e83 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionInnerTests.java @@ -14,32 +14,28 @@ public final class UserSessionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserSessionInner model = - BinaryData - .fromString( - "{\"properties\":{\"objectId\":\"hneuyowqkd\",\"userPrincipalName\":\"t\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Pending\",\"activeDirectoryUserName\":\"cgpik\",\"createTime\":\"2021-11-09T05:31:13Z\"},\"id\":\"mejzanlfzxia\",\"name\":\"rmbzo\",\"type\":\"okixrjqcir\"}") - .toObject(UserSessionInner.class); - Assertions.assertEquals("t", model.userPrincipalName()); + UserSessionInner model = BinaryData.fromString( + "{\"properties\":{\"objectId\":\"o\",\"userPrincipalName\":\"hjjklff\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"lgzrfzeeyeb\",\"createTime\":\"2021-06-13T01:41:31Z\"},\"id\":\"ayuhqlbjbsy\",\"name\":\"bqwrvtldgm\",\"type\":\"pgvmpipaslthaqfx\"}") + .toObject(UserSessionInner.class); + Assertions.assertEquals("hjjklff", model.userPrincipalName()); Assertions.assertEquals(ApplicationType.REMOTE_APP, model.applicationType()); - Assertions.assertEquals(SessionState.PENDING, model.sessionState()); - Assertions.assertEquals("cgpik", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T05:31:13Z"), model.createTime()); + Assertions.assertEquals(SessionState.LOG_OFF, model.sessionState()); + Assertions.assertEquals("lgzrfzeeyeb", model.activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T01:41:31Z"), model.createTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserSessionInner model = - new UserSessionInner() - .withUserPrincipalName("t") - .withApplicationType(ApplicationType.REMOTE_APP) - .withSessionState(SessionState.PENDING) - .withActiveDirectoryUsername("cgpik") - .withCreateTime(OffsetDateTime.parse("2021-11-09T05:31:13Z")); + UserSessionInner model = new UserSessionInner().withUserPrincipalName("hjjklff") + .withApplicationType(ApplicationType.REMOTE_APP) + .withSessionState(SessionState.LOG_OFF) + .withActiveDirectoryUsername("lgzrfzeeyeb") + .withCreateTime(OffsetDateTime.parse("2021-06-13T01:41:31Z")); model = BinaryData.fromObject(model).toObject(UserSessionInner.class); - Assertions.assertEquals("t", model.userPrincipalName()); + Assertions.assertEquals("hjjklff", model.userPrincipalName()); Assertions.assertEquals(ApplicationType.REMOTE_APP, model.applicationType()); - Assertions.assertEquals(SessionState.PENDING, model.sessionState()); - Assertions.assertEquals("cgpik", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-09T05:31:13Z"), model.createTime()); + Assertions.assertEquals(SessionState.LOG_OFF, model.sessionState()); + Assertions.assertEquals("lgzrfzeeyeb", model.activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T01:41:31Z"), model.createTime()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java index 708c6ae44978..4239166dfe55 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionListTests.java @@ -16,54 +16,34 @@ public final class UserSessionListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserSessionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"objectId\":\"p\",\"userPrincipalName\":\"cstwity\",\"applicationType\":\"Desktop\",\"sessionState\":\"UserProfileDiskMounted\",\"activeDirectoryUserName\":\"cedcpnmdy\",\"createTime\":\"2021-08-04T00:15:47Z\"},\"id\":\"wzxltjc\",\"name\":\"nhltiugcxn\",\"type\":\"vvwxqi\"},{\"properties\":{\"objectId\":\"nyowxwlmdjrkvfg\",\"userPrincipalName\":\"fvpdbo\",\"applicationType\":\"Desktop\",\"sessionState\":\"Disconnected\",\"activeDirectoryUserName\":\"j\",\"createTime\":\"2021-03-04T03:48:03Z\"},\"id\":\"krribdeibqi\",\"name\":\"qkgh\",\"type\":\"xndzwm\"},{\"properties\":{\"objectId\":\"ajpjo\",\"userPrincipalName\":\"kqnyh\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Active\",\"activeDirectoryUserName\":\"ivfxzsjabibsyst\",\"createTime\":\"2021-05-13T21:12:04Z\"},\"id\":\"sdjpvkvp\",\"name\":\"jxbkzbzkdvn\",\"type\":\"jabudurgkakmo\"},{\"properties\":{\"objectId\":\"jk\",\"userPrincipalName\":\"fhmouwq\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Active\",\"activeDirectoryUserName\":\"eeyebi\",\"createTime\":\"2021-05-17T10:43:36Z\"},\"id\":\"ayuhqlbjbsy\",\"name\":\"bqwrvtldgm\",\"type\":\"pgvmpipaslthaqfx\"}],\"nextLink\":\"mwutwbdsre\"}") - .toObject(UserSessionList.class); - Assertions.assertEquals("cstwity", model.value().get(0).userPrincipalName()); - Assertions.assertEquals(ApplicationType.DESKTOP, model.value().get(0).applicationType()); - Assertions.assertEquals(SessionState.USER_PROFILE_DISK_MOUNTED, model.value().get(0).sessionState()); - Assertions.assertEquals("cedcpnmdy", model.value().get(0).activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T00:15:47Z"), model.value().get(0).createTime()); + UserSessionList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"objectId\":\"xccedcpnmdyodn\",\"userPrincipalName\":\"xltjcvnhltiu\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Active\",\"activeDirectoryUserName\":\"vwxqibyqunyo\",\"createTime\":\"2021-06-28T16:16:43Z\"},\"id\":\"mdjrkvfgbvfvp\",\"name\":\"bodacizsjq\",\"type\":\"hkr\"},{\"properties\":{\"objectId\":\"deibqip\",\"userPrincipalName\":\"ghvxndzwmkrefa\",\"applicationType\":\"Desktop\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"kqnyh\",\"createTime\":\"2021-03-14T06:12:53Z\"},\"id\":\"tjivfxzsjabib\",\"name\":\"ystawfsdjpvkvp\",\"type\":\"jxbkzbzkdvn\"}],\"nextLink\":\"abudurgk\"}") + .toObject(UserSessionList.class); + Assertions.assertEquals("xltjcvnhltiu", model.value().get(0).userPrincipalName()); + Assertions.assertEquals(ApplicationType.REMOTE_APP, model.value().get(0).applicationType()); + Assertions.assertEquals(SessionState.ACTIVE, model.value().get(0).sessionState()); + Assertions.assertEquals("vwxqibyqunyo", model.value().get(0).activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T16:16:43Z"), model.value().get(0).createTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserSessionList model = - new UserSessionList() - .withValue( - Arrays - .asList( - new UserSessionInner() - .withUserPrincipalName("cstwity") - .withApplicationType(ApplicationType.DESKTOP) - .withSessionState(SessionState.USER_PROFILE_DISK_MOUNTED) - .withActiveDirectoryUsername("cedcpnmdy") - .withCreateTime(OffsetDateTime.parse("2021-08-04T00:15:47Z")), - new UserSessionInner() - .withUserPrincipalName("fvpdbo") - .withApplicationType(ApplicationType.DESKTOP) - .withSessionState(SessionState.DISCONNECTED) - .withActiveDirectoryUsername("j") - .withCreateTime(OffsetDateTime.parse("2021-03-04T03:48:03Z")), - new UserSessionInner() - .withUserPrincipalName("kqnyh") - .withApplicationType(ApplicationType.REMOTE_APP) - .withSessionState(SessionState.ACTIVE) - .withActiveDirectoryUsername("ivfxzsjabibsyst") - .withCreateTime(OffsetDateTime.parse("2021-05-13T21:12:04Z")), - new UserSessionInner() - .withUserPrincipalName("fhmouwq") - .withApplicationType(ApplicationType.REMOTE_APP) - .withSessionState(SessionState.ACTIVE) - .withActiveDirectoryUsername("eeyebi") - .withCreateTime(OffsetDateTime.parse("2021-05-17T10:43:36Z")))); + UserSessionList model = new UserSessionList().withValue(Arrays.asList( + new UserSessionInner().withUserPrincipalName("xltjcvnhltiu") + .withApplicationType(ApplicationType.REMOTE_APP) + .withSessionState(SessionState.ACTIVE) + .withActiveDirectoryUsername("vwxqibyqunyo") + .withCreateTime(OffsetDateTime.parse("2021-06-28T16:16:43Z")), + new UserSessionInner().withUserPrincipalName("ghvxndzwmkrefa") + .withApplicationType(ApplicationType.DESKTOP) + .withSessionState(SessionState.LOG_OFF) + .withActiveDirectoryUsername("kqnyh") + .withCreateTime(OffsetDateTime.parse("2021-03-14T06:12:53Z")))); model = BinaryData.fromObject(model).toObject(UserSessionList.class); - Assertions.assertEquals("cstwity", model.value().get(0).userPrincipalName()); - Assertions.assertEquals(ApplicationType.DESKTOP, model.value().get(0).applicationType()); - Assertions.assertEquals(SessionState.USER_PROFILE_DISK_MOUNTED, model.value().get(0).sessionState()); - Assertions.assertEquals("cedcpnmdy", model.value().get(0).activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T00:15:47Z"), model.value().get(0).createTime()); + Assertions.assertEquals("xltjcvnhltiu", model.value().get(0).userPrincipalName()); + Assertions.assertEquals(ApplicationType.REMOTE_APP, model.value().get(0).applicationType()); + Assertions.assertEquals(SessionState.ACTIVE, model.value().get(0).sessionState()); + Assertions.assertEquals("vwxqibyqunyo", model.value().get(0).activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T16:16:43Z"), model.value().get(0).createTime()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java index cae536540b69..8929894fc69b 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionPropertiesTests.java @@ -14,32 +14,28 @@ public final class UserSessionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserSessionProperties model = - BinaryData - .fromString( - "{\"objectId\":\"pfrlazsz\",\"userPrincipalName\":\"woiindf\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Active\",\"activeDirectoryUserName\":\"wbtlhflsjcdh\",\"createTime\":\"2021-08-12T16:31:07Z\"}") - .toObject(UserSessionProperties.class); - Assertions.assertEquals("woiindf", model.userPrincipalName()); + UserSessionProperties model = BinaryData.fromString( + "{\"objectId\":\"mwutwbdsre\",\"userPrincipalName\":\"drhneuyow\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Disconnected\",\"activeDirectoryUserName\":\"i\",\"createTime\":\"2020-12-27T08:51:44Z\"}") + .toObject(UserSessionProperties.class); + Assertions.assertEquals("drhneuyow", model.userPrincipalName()); Assertions.assertEquals(ApplicationType.REMOTE_APP, model.applicationType()); - Assertions.assertEquals(SessionState.ACTIVE, model.sessionState()); - Assertions.assertEquals("wbtlhflsjcdh", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T16:31:07Z"), model.createTime()); + Assertions.assertEquals(SessionState.DISCONNECTED, model.sessionState()); + Assertions.assertEquals("i", model.activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T08:51:44Z"), model.createTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserSessionProperties model = - new UserSessionProperties() - .withUserPrincipalName("woiindf") - .withApplicationType(ApplicationType.REMOTE_APP) - .withSessionState(SessionState.ACTIVE) - .withActiveDirectoryUsername("wbtlhflsjcdh") - .withCreateTime(OffsetDateTime.parse("2021-08-12T16:31:07Z")); + UserSessionProperties model = new UserSessionProperties().withUserPrincipalName("drhneuyow") + .withApplicationType(ApplicationType.REMOTE_APP) + .withSessionState(SessionState.DISCONNECTED) + .withActiveDirectoryUsername("i") + .withCreateTime(OffsetDateTime.parse("2020-12-27T08:51:44Z")); model = BinaryData.fromObject(model).toObject(UserSessionProperties.class); - Assertions.assertEquals("woiindf", model.userPrincipalName()); + Assertions.assertEquals("drhneuyow", model.userPrincipalName()); Assertions.assertEquals(ApplicationType.REMOTE_APP, model.applicationType()); - Assertions.assertEquals(SessionState.ACTIVE, model.sessionState()); - Assertions.assertEquals("wbtlhflsjcdh", model.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-12T16:31:07Z"), model.createTime()); + Assertions.assertEquals(SessionState.DISCONNECTED, model.sessionState()); + Assertions.assertEquals("i", model.activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T08:51:44Z"), model.createTime()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java index 5bdd9e1b74e6..33b41c404f63 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDeleteWithResponseMockTests.java @@ -6,59 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class UserSessionsDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.userSessions() + .deleteWithResponse("psjoqcjenk", "hf", "zv", "qxfx", true, com.azure.core.util.Context.NONE); - manager - .userSessions() - .deleteWithResponse( - "aifghtmoqqt", "ffhzbkrkjjjavfq", "vhnqo", "wdogiyetesyp", false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java index 38aa2de0acdd..019eedc5da20 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsDisconnectWithResponseMockTests.java @@ -6,59 +6,30 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class UserSessionsDisconnectWithResponseMockTests { @Test public void testDisconnectWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.userSessions() + .disconnectWithResponse("yjtcdxabbujftab", "nbbklqpxzucafed", "wwnlzafwxudgnh", "ookrtalvnbw", + com.azure.core.util.Context.NONE); - manager - .userSessions() - .disconnectWithResponse( - "bsjuscvsfx", "gctmgxuupbezq", "cydrtceukdqkk", "ihztgeqmgqzgwldo", com.azure.core.util.Context.NONE); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java index 37e3e2ee72ea..90531c4a55ae 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsGetWithResponseMockTests.java @@ -6,71 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; import com.azure.resourcemanager.desktopvirtualization.models.SessionState; import com.azure.resourcemanager.desktopvirtualization.models.UserSession; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class UserSessionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"properties\":{\"objectId\":\"oeocnhzqrott\",\"userPrincipalName\":\"cfyjzp\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"Active\",\"activeDirectoryUserName\":\"apqinf\",\"createTime\":\"2021-03-15T02:08:03Z\"},\"id\":\"glqdhm\",\"name\":\"jzralc\",\"type\":\"pjby\"}"; - String responseStr = - "{\"properties\":{\"objectId\":\"rttuiaclkiexha\",\"userPrincipalName\":\"fnth\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"t\",\"createTime\":\"2021-07-20T02:29:06Z\"},\"id\":\"gbpvnwswmtxkyct\",\"name\":\"wgzwxjlmecvog\",\"type\":\"gzyvnee\"}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + UserSession response = manager.userSessions() + .getWithResponse("kyewnfnzhhhqo", "mffjkutycyarn", "oohguabzoghkt", "pyc", com.azure.core.util.Context.NONE) + .getValue(); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UserSession response = - manager - .userSessions() - .getWithResponse("gsksrfhf", "olmk", "bnxwc", "ommpvfqaw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fnth", response.userPrincipalName()); + Assertions.assertEquals("cfyjzp", response.userPrincipalName()); Assertions.assertEquals(ApplicationType.REMOTE_APP, response.applicationType()); - Assertions.assertEquals(SessionState.LOG_OFF, response.sessionState()); - Assertions.assertEquals("t", response.activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T02:29:06Z"), response.createTime()); + Assertions.assertEquals(SessionState.ACTIVE, response.sessionState()); + Assertions.assertEquals("apqinf", response.activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T02:08:03Z"), response.createTime()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java index 7d15f961e455..b7a667fac078 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListByHostPoolMockTests.java @@ -6,72 +6,41 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; import com.azure.resourcemanager.desktopvirtualization.models.SessionState; import com.azure.resourcemanager.desktopvirtualization.models.UserSession; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class UserSessionsListByHostPoolMockTests { @Test public void testListByHostPool() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"objectId\":\"qnrmvvfko\",\"userPrincipalName\":\"lghktuidvrm\",\"applicationType\":\"Desktop\",\"sessionState\":\"Pending\",\"activeDirectoryUserName\":\"wex\",\"createTime\":\"2021-08-07T05:35:14Z\"},\"id\":\"vlazipbhpwvqsgny\",\"name\":\"uuzivensrpmeyyvp\",\"type\":\"patlbijp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .userSessions() - .listByHostPool( - "duczkgof", "y", "srucvcrrpcjtt", 411078462, false, 2056089114, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lghktuidvrm", response.iterator().next().userPrincipalName()); - Assertions.assertEquals(ApplicationType.DESKTOP, response.iterator().next().applicationType()); - Assertions.assertEquals(SessionState.PENDING, response.iterator().next().sessionState()); - Assertions.assertEquals("wex", response.iterator().next().activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T05:35:14Z"), response.iterator().next().createTime()); + String responseStr + = "{\"value\":[{\"properties\":{\"objectId\":\"rrqmbzmqk\",\"userPrincipalName\":\"tbnxwbjsid\",\"applicationType\":\"RemoteApp\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"kso\",\"createTime\":\"2021-09-30T06:21:09Z\"},\"id\":\"gewi\",\"name\":\"ym\",\"type\":\"hbguzo\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.userSessions() + .listByHostPool("aujvaa", "nggiycwkdtaa", "xw", 1216917583, false, 1817047437, + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("tbnxwbjsid", response.iterator().next().userPrincipalName()); + Assertions.assertEquals(ApplicationType.REMOTE_APP, response.iterator().next().applicationType()); + Assertions.assertEquals(SessionState.LOG_OFF, response.iterator().next().sessionState()); + Assertions.assertEquals("kso", response.iterator().next().activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-30T06:21:09Z"), response.iterator().next().createTime()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java index 1f3062a9bb99..da82ac8c113d 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsListMockTests.java @@ -6,72 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.ApplicationType; import com.azure.resourcemanager.desktopvirtualization.models.SessionState; import com.azure.resourcemanager.desktopvirtualization.models.UserSession; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class UserSessionsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr + = "{\"value\":[{\"properties\":{\"objectId\":\"yv\",\"userPrincipalName\":\"bsizus\",\"applicationType\":\"Desktop\",\"sessionState\":\"UserProfileDiskMounted\",\"activeDirectoryUserName\":\"cmnlzijiufehg\",\"createTime\":\"2021-10-11T17:24:41Z\"},\"id\":\"nwyvq\",\"name\":\"xrerlniylylyf\",\"type\":\"xzutgqztwhghmupg\"}]}"; - String responseStr = - "{\"value\":[{\"properties\":{\"objectId\":\"upia\",\"userPrincipalName\":\"xnafbw\",\"applicationType\":\"Desktop\",\"sessionState\":\"LogOff\",\"activeDirectoryUserName\":\"uovmaonurjt\",\"createTime\":\"2021-05-12T05:44:48Z\"},\"id\":\"hihpvecmsl\",\"name\":\"lbl\",\"type\":\"jxl\"}]}"; + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + PagedIterable response = manager.userSessions() + .list("l", "cmpzqjhhhqx", "w", 1797841912, true, 1628053576, com.azure.core.util.Context.NONE); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .userSessions() - .list( - "dbztjhqtfbov", "ynkbwetnju", "p", 1399052652, true, 1446166939, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xnafbw", response.iterator().next().userPrincipalName()); + Assertions.assertEquals("bsizus", response.iterator().next().userPrincipalName()); Assertions.assertEquals(ApplicationType.DESKTOP, response.iterator().next().applicationType()); - Assertions.assertEquals(SessionState.LOG_OFF, response.iterator().next().sessionState()); - Assertions.assertEquals("uovmaonurjt", response.iterator().next().activeDirectoryUsername()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-12T05:44:48Z"), response.iterator().next().createTime()); + Assertions.assertEquals(SessionState.USER_PROFILE_DISK_MOUNTED, response.iterator().next().sessionState()); + Assertions.assertEquals("cmnlzijiufehg", response.iterator().next().activeDirectoryUsername()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T17:24:41Z"), response.iterator().next().createTime()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java index 2635e1854eea..6723f3336736 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/UserSessionsSendMessageWithResponseMockTests.java @@ -6,65 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; import com.azure.resourcemanager.desktopvirtualization.models.SendMessage; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class UserSessionsSendMessageWithResponseMockTests { @Test public void testSendMessageWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - manager - .userSessions() - .sendMessageWithResponse( - "chillcecf", - "huwaoaguhic", - "llizs", - "ac", - new SendMessage().withMessageTitle("vhrweftkwqejpmv").withMessageBody("ehaepwamcxtc"), + manager.userSessions() + .sendMessageWithResponse("pbeme", "uclvdjj", "kyrdnqodx", "hhxhq", + new SendMessage().withMessageTitle("qnvzoqgyipemch").withMessageBody("v"), com.azure.core.util.Context.NONE); + } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java index b5f41976f944..5ac2c581c0fd 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchPropertiesTests.java @@ -13,29 +13,25 @@ public final class WorkspacePatchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WorkspacePatchProperties model = - BinaryData - .fromString( - "{\"description\":\"rzafbljjgpbtoqcj\",\"friendlyName\":\"ljavbqid\",\"applicationGroupReferences\":[\"jzyulpk\",\"dj\"],\"publicNetworkAccess\":\"Enabled\"}") - .toObject(WorkspacePatchProperties.class); - Assertions.assertEquals("rzafbljjgpbtoqcj", model.description()); - Assertions.assertEquals("ljavbqid", model.friendlyName()); - Assertions.assertEquals("jzyulpk", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + WorkspacePatchProperties model = BinaryData.fromString( + "{\"description\":\"dsoifiyipj\",\"friendlyName\":\"qwpgrjbzn\",\"applicationGroupReferences\":[\"jxvsnbyxqabn\",\"ocpcy\",\"hurzafblj\"],\"publicNetworkAccess\":\"Disabled\"}") + .toObject(WorkspacePatchProperties.class); + Assertions.assertEquals("dsoifiyipj", model.description()); + Assertions.assertEquals("qwpgrjbzn", model.friendlyName()); + Assertions.assertEquals("jxvsnbyxqabn", model.applicationGroupReferences().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspacePatchProperties model = - new WorkspacePatchProperties() - .withDescription("rzafbljjgpbtoqcj") - .withFriendlyName("ljavbqid") - .withApplicationGroupReferences(Arrays.asList("jzyulpk", "dj")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + WorkspacePatchProperties model = new WorkspacePatchProperties().withDescription("dsoifiyipj") + .withFriendlyName("qwpgrjbzn") + .withApplicationGroupReferences(Arrays.asList("jxvsnbyxqabn", "ocpcy", "hurzafblj")) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); model = BinaryData.fromObject(model).toObject(WorkspacePatchProperties.class); - Assertions.assertEquals("rzafbljjgpbtoqcj", model.description()); - Assertions.assertEquals("ljavbqid", model.friendlyName()); - Assertions.assertEquals("jzyulpk", model.applicationGroupReferences().get(0)); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + Assertions.assertEquals("dsoifiyipj", model.description()); + Assertions.assertEquals("qwpgrjbzn", model.friendlyName()); + Assertions.assertEquals("jxvsnbyxqabn", model.applicationGroupReferences().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java index d048ed4602b7..eb8ac6b9e513 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePatchTests.java @@ -15,32 +15,30 @@ public final class WorkspacePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WorkspacePatch model = - BinaryData - .fromString( - "{\"tags\":{\"wjdk\":\"qrimzinpv\",\"t\":\"rsoodqxhcrmnoh\"},\"properties\":{\"description\":\"h\",\"friendlyName\":\"oifiyipjxsqwpgr\",\"applicationGroupReferences\":[\"norcjxvsnbyxqab\",\"mocpc\"],\"publicNetworkAccess\":\"Disabled\"}}") - .toObject(WorkspacePatch.class); - Assertions.assertEquals("qrimzinpv", model.tags().get("wjdk")); - Assertions.assertEquals("h", model.description()); - Assertions.assertEquals("oifiyipjxsqwpgr", model.friendlyName()); - Assertions.assertEquals("norcjxvsnbyxqab", model.applicationGroupReferences().get(0)); + WorkspacePatch model = BinaryData.fromString( + "{\"tags\":{\"pvkmijcmmxdcuf\":\"hwxmnteiwa\",\"cxtbzsg\":\"fsrpymzidnse\",\"sne\":\"yc\",\"flnrosfqpteehzz\":\"mdwzjeiachboo\"},\"properties\":{\"description\":\"yqrimzin\",\"friendlyName\":\"swjdkirso\",\"applicationGroupReferences\":[\"xhcr\",\"nohjt\"],\"publicNetworkAccess\":\"Disabled\"}}") + .toObject(WorkspacePatch.class); + Assertions.assertEquals("hwxmnteiwa", model.tags().get("pvkmijcmmxdcuf")); + Assertions.assertEquals("yqrimzin", model.description()); + Assertions.assertEquals("swjdkirso", model.friendlyName()); + Assertions.assertEquals("xhcr", model.applicationGroupReferences().get(0)); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspacePatch model = - new WorkspacePatch() - .withTags(mapOf("wjdk", "qrimzinpv", "t", "rsoodqxhcrmnoh")) - .withDescription("h") - .withFriendlyName("oifiyipjxsqwpgr") - .withApplicationGroupReferences(Arrays.asList("norcjxvsnbyxqab", "mocpc")) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + WorkspacePatch model = new WorkspacePatch() + .withTags(mapOf("pvkmijcmmxdcuf", "hwxmnteiwa", "cxtbzsg", "fsrpymzidnse", "sne", "yc", "flnrosfqpteehzz", + "mdwzjeiachboo")) + .withDescription("yqrimzin") + .withFriendlyName("swjdkirso") + .withApplicationGroupReferences(Arrays.asList("xhcr", "nohjt")) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); model = BinaryData.fromObject(model).toObject(WorkspacePatch.class); - Assertions.assertEquals("qrimzinpv", model.tags().get("wjdk")); - Assertions.assertEquals("h", model.description()); - Assertions.assertEquals("oifiyipjxsqwpgr", model.friendlyName()); - Assertions.assertEquals("norcjxvsnbyxqab", model.applicationGroupReferences().get(0)); + Assertions.assertEquals("hwxmnteiwa", model.tags().get("pvkmijcmmxdcuf")); + Assertions.assertEquals("yqrimzin", model.description()); + Assertions.assertEquals("swjdkirso", model.friendlyName()); + Assertions.assertEquals("xhcr", model.applicationGroupReferences().get(0)); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java index cc6f2cde76eb..6a8140d220b5 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacePropertiesTests.java @@ -13,29 +13,25 @@ public final class WorkspacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WorkspaceProperties model = - BinaryData - .fromString( - "{\"objectId\":\"xzxtheo\",\"description\":\"si\",\"friendlyName\":\"evcciqihnhun\",\"applicationGroupReferences\":[\"jzrnf\",\"gxg\",\"spemvtzfk\",\"fublj\"],\"cloudPcResource\":true,\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"qjhqjbas\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"jqul\",\"actionsRequired\":\"sntnbybkzgcw\"},\"provisioningState\":\"Deleting\"},\"id\":\"lxxwrljdouskc\",\"name\":\"vkocrcjdkwtn\",\"type\":\"xbnjbiksq\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"sainqpjwnzl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ppeebvmgxsab\",\"actionsRequired\":\"qduujitcjczdz\"},\"provisioningState\":\"Creating\"},\"id\":\"dhkrwpdappdsbdk\",\"name\":\"wrwjfeu\",\"type\":\"nhutjeltmrldhugj\"}]}") - .toObject(WorkspaceProperties.class); - Assertions.assertEquals("si", model.description()); - Assertions.assertEquals("evcciqihnhun", model.friendlyName()); - Assertions.assertEquals("jzrnf", model.applicationGroupReferences().get(0)); + WorkspaceProperties model = BinaryData.fromString( + "{\"objectId\":\"ayhuy\",\"description\":\"kpode\",\"friendlyName\":\"oginuvamiheognar\",\"applicationGroupReferences\":[\"theotusiv\"],\"cloudPcResource\":false,\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"hungbwjzrnf\",\"gxg\"],\"privateEndpoint\":{\"id\":\"emv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ufubl\",\"actionsRequired\":\"fxqeof\"},\"provisioningState\":\"Succeeded\"},\"id\":\"jhqjbasvmsmjqul\",\"name\":\"gsntnbybkzgcwr\",\"type\":\"clxxwrljdo\"}]}") + .toObject(WorkspaceProperties.class); + Assertions.assertEquals("kpode", model.description()); + Assertions.assertEquals("oginuvamiheognar", model.friendlyName()); + Assertions.assertEquals("theotusiv", model.applicationGroupReferences().get(0)); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceProperties model = - new WorkspaceProperties() - .withDescription("si") - .withFriendlyName("evcciqihnhun") - .withApplicationGroupReferences(Arrays.asList("jzrnf", "gxg", "spemvtzfk", "fublj")) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + WorkspaceProperties model = new WorkspaceProperties().withDescription("kpode") + .withFriendlyName("oginuvamiheognar") + .withApplicationGroupReferences(Arrays.asList("theotusiv")) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); - Assertions.assertEquals("si", model.description()); - Assertions.assertEquals("evcciqihnhun", model.friendlyName()); - Assertions.assertEquals("jzrnf", model.applicationGroupReferences().get(0)); + Assertions.assertEquals("kpode", model.description()); + Assertions.assertEquals("oginuvamiheognar", model.friendlyName()); + Assertions.assertEquals("theotusiv", model.applicationGroupReferences().get(0)); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } } diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java index ed02fe0eb21b..6141c484f167 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/test/java/com/azure/resourcemanager/desktopvirtualization/generated/WorkspacesDeleteByResourceGroupWithResponseMockTests.java @@ -6,56 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class WorkspacesDeleteByResourceGroupWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DesktopVirtualizationManager manager = DesktopVirtualizationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DesktopVirtualizationManager manager = - DesktopVirtualizationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + manager.workspaces().deleteByResourceGroupWithResponse("jee", "yhyhsgzfczb", com.azure.core.util.Context.NONE); - manager.workspaces().deleteByResourceGroupWithResponse("ecuijpxtxs", "wprtu", com.azure.core.util.Context.NONE); } }