From 3f7cf4adf8dc41f692a35b809026acb6ba0064f7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 12 Jul 2023 22:59:53 +0000 Subject: [PATCH] CodeGen from PR 24747 in Azure/azure-rest-api-specs Merge 3bb7888e9223b0b7a85ea7f053e6123fca7b3049 into 271e54937d2738b48c9fb1af95ea82a5c149aa8c --- ...er.DesktopVirtualization.netstandard2.0.cs | 346 ++++++- .../ArmDesktopVirtualizationModelFactory.cs | 113 ++- .../DesktopVirtualizationExtensions.cs | 57 ++ .../src/Generated/HostPoolData.cs | 11 +- ...PoolPrivateEndpointConnectionCollection.cs | 347 +++++++ ...stPoolPrivateEndpointConnectionResource.cs | 298 ++++++ .../src/Generated/HostPoolResource.cs | 107 +++ ...PrivateEndpointConnection.Serialization.cs | 118 +++ ...VirtualizationPrivateEndpointConnection.cs | 50 + ...vateEndpointConnectionProvisioningState.cs | 57 ++ ...nPrivateEndpointServiceConnectionStatus.cs | 54 ++ ...zationPrivateLinkResource.Serialization.cs | 124 +++ ...esktopVirtualizationPrivateLinkResource.cs | 46 + ...ateLinkResourceListResult.Serialization.cs | 49 + ...ualizationPrivateLinkResourceListResult.cs | 36 + ...inkServiceConnectionState.Serialization.cs | 70 ++ ...zationPrivateLinkServiceConnectionState.cs | 36 + .../Models/HostPoolData.Serialization.cs | 32 +- .../Models/HostPoolPatch.Serialization.cs | 17 +- .../src/Generated/Models/HostPoolPatch.cs | 6 +- .../Models/HostpoolPublicNetworkAccess.cs | 57 ++ ...nListResultWithSystemData.Serialization.cs | 50 + ...pointConnectionListResultWithSystemData.cs | 37 + ...nectionWithSystemDataData.Serialization.cs | 119 +++ .../Generated/Models/PublicNetworkAccess.cs | 51 + ...gPlanPersonalScheduleData.Serialization.cs | 479 ++++++++++ ...gPlanPersonalScheduleList.Serialization.cs | 50 + .../Models/ScalingPlanPersonalScheduleList.cs | 37 + ...PlanPersonalSchedulePatch.Serialization.cs | 159 ++++ .../ScalingPlanPersonalSchedulePatch.cs | 75 ++ .../Models/SessionHandlingOperation.cs | 54 ++ .../Models/SessionHostHealthCheckName.cs | 22 +- .../Generated/Models/SetStartVmOnConnect.cs | 51 + .../src/Generated/Models/StartupBehavior.cs | 54 ++ ...rtualApplicationGroupData.Serialization.cs | 17 +- ...tualApplicationGroupPatch.Serialization.cs | 17 +- .../Models/VirtualApplicationGroupPatch.cs | 6 +- .../VirtualWorkspaceData.Serialization.cs | 32 +- .../VirtualWorkspacePatch.Serialization.cs | 5 + .../Generated/Models/VirtualWorkspacePatch.cs | 2 + ...ateEndpointConnectionWithSystemDataData.cs | 54 ++ .../ApplicationGroupsRestOperations.cs | 2 +- .../ApplicationsRestOperations.cs | 2 +- .../RestOperations/DesktopsRestOperations.cs | 2 +- .../RestOperations/HostPoolsRestOperations.cs | 2 +- .../MsixImagesRestOperations.cs | 2 +- .../MsixPackagesRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 886 ++++++++++++++++++ .../PrivateLinkResourcesRestOperations.cs | 398 ++++++++ ...lingPlanPersonalSchedulesRestOperations.cs | 569 +++++++++++ ...calingPlanPooledSchedulesRestOperations.cs | 2 +- .../ScalingPlansRestOperations.cs | 2 +- .../SessionHostsRestOperations.cs | 2 +- .../StartMenuItemsRestOperations.cs | 2 +- .../UserSessionsRestOperations.cs | 2 +- .../WorkspacesRestOperations.cs | 2 +- .../ScalingPlanPersonalScheduleCollection.cs | 346 +++++++ .../ScalingPlanPersonalScheduleData.cs | 141 +++ .../ScalingPlanPersonalScheduleResource.cs | 290 ++++++ .../src/Generated/ScalingPlanResource.cs | 53 ++ .../Generated/VirtualApplicationGroupData.cs | 6 +- .../src/Generated/VirtualWorkspaceData.cs | 11 +- .../src/Generated/VirtualWorkspaceResource.cs | 107 +++ ...pacePrivateEndpointConnectionCollection.cs | 341 +++++++ ...kspacePrivateEndpointConnectionResource.cs | 298 ++++++ .../src/autorest.md | 2 +- 66 files changed, 6825 insertions(+), 49 deletions(-) create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnectionProvisioningState.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointServiceConnectionStatus.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostpoolPublicNetworkAccess.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionWithSystemDataData.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicNetworkAccess.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleData.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.Serialization.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHandlingOperation.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SetStartVmOnConnect.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/StartupBehavior.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/PrivateEndpointConnectionWithSystemDataData.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/api/Azure.ResourceManager.DesktopVirtualization.netstandard2.0.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/api/Azure.ResourceManager.DesktopVirtualization.netstandard2.0.cs index 586b7a3fa31f9..a80b720b95b76 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/api/Azure.ResourceManager.DesktopVirtualization.netstandard2.0.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/api/Azure.ResourceManager.DesktopVirtualization.netstandard2.0.cs @@ -4,6 +4,7 @@ public static partial class DesktopVirtualizationExtensions { public static Azure.Response GetHostPool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string hostPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHostPoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string hostPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.HostPoolPrivateEndpointConnectionResource GetHostPoolPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.HostPoolResource GetHostPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.HostPoolCollection GetHostPools(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHostPools(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -15,6 +16,7 @@ public static partial class DesktopVirtualizationExtensions public static Azure.ResourceManager.DesktopVirtualization.MsixPackageResource GetMsixPackageResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetScalingPlan(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scalingPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetScalingPlanAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string scalingPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanPersonalScheduleResource GetScalingPlanPersonalScheduleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanPooledScheduleResource GetScalingPlanPooledScheduleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanResource GetScalingPlanResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanCollection GetScalingPlans(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } @@ -40,6 +42,7 @@ public static partial class DesktopVirtualizationExtensions public static Azure.ResourceManager.DesktopVirtualization.VirtualWorkspaceCollection GetVirtualWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetVirtualWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetVirtualWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.WorkspacePrivateEndpointConnectionResource GetWorkspacePrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class HostPoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -84,6 +87,8 @@ public HostPoolData(Azure.Core.AzureLocation location, Azure.ResourceManager.Des public Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType? PersonalDesktopAssignmentType { get { throw null; } set { } } public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType PreferredAppGroupType { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.HostPoolRegistrationInfo RegistrationInfo { get { throw null; } set { } } public int? Ring { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku Sku { get { throw null; } set { } } @@ -94,6 +99,35 @@ public HostPoolData(Azure.Core.AzureLocation location, Azure.ResourceManager.Des public bool? StartVmOnConnect { get { throw null; } set { } } public string VmTemplate { get { throw null; } set { } } } + public partial class HostPoolPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HostPoolPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class HostPoolPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HostPoolPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.DesktopVirtualization.PrivateEndpointConnectionWithSystemDataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class HostPoolResource : Azure.ResourceManager.ArmResource { public static readonly Azure.Core.ResourceType ResourceType; @@ -109,9 +143,14 @@ protected HostPoolResource() { } public virtual Azure.AsyncPageable ExpandMsixImagesAsync(Azure.ResourceManager.DesktopVirtualization.Models.MsixImageUri msixImageUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetHostPoolPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHostPoolPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DesktopVirtualization.HostPoolPrivateEndpointConnectionCollection GetHostPoolPrivateEndpointConnections() { throw null; } public virtual Azure.Response GetMsixPackage(string msixPackageFullName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMsixPackageAsync(string msixPackageFullName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DesktopVirtualization.MsixPackageCollection GetMsixPackages() { throw null; } + public virtual Azure.Pageable GetPrivateLinkResources(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetScalingPlans(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.Pageable GetScalingPlans(System.Threading.CancellationToken cancellationToken) { throw null; } @@ -182,6 +221,13 @@ protected MsixPackageResource() { } public virtual Azure.Response Update(Azure.ResourceManager.DesktopVirtualization.Models.MsixPackagePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.DesktopVirtualization.Models.MsixPackagePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class PrivateEndpointConnectionWithSystemDataData : Azure.ResourceManager.Models.ResourceData + { + public PrivateEndpointConnectionWithSystemDataData() { } + public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + } public partial class ScalingPlanCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ScalingPlanCollection() { } @@ -224,6 +270,65 @@ public ScalingPlanData(Azure.Core.AzureLocation location, string timeZone) : bas public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku Sku { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } } + public partial class ScalingPlanPersonalScheduleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ScalingPlanPersonalScheduleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string scalingPlanScheduleName, Azure.ResourceManager.DesktopVirtualization.ScalingPlanPersonalScheduleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string scalingPlanScheduleName, Azure.ResourceManager.DesktopVirtualization.ScalingPlanPersonalScheduleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ScalingPlanPersonalScheduleData : Azure.ResourceManager.Models.ResourceData + { + public ScalingPlanPersonalScheduleData() { } + public System.Collections.Generic.IList DaysOfWeek { get { throw null; } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? OffPeakActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? OffPeakActionOnLogoff { get { throw null; } set { } } + public int? OffPeakMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? OffPeakMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime OffPeakStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? OffPeakStartVmOnConnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? PeakActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? PeakActionOnLogoff { get { throw null; } set { } } + public int? PeakMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? PeakMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime PeakStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? PeakStartVmOnConnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampDownActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampDownActionOnLogoff { get { throw null; } set { } } + public int? RampDownMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? RampDownMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime RampDownStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? RampDownStartVmOnConnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampUpActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampUpActionOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior? RampUpAutoStartHosts { get { throw null; } set { } } + public int? RampUpMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? RampUpMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime RampUpStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? RampUpStartVmOnConnect { get { throw null; } set { } } + } + public partial class ScalingPlanPersonalScheduleResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ScalingPlanPersonalScheduleResource() { } + public virtual Azure.ResourceManager.DesktopVirtualization.ScalingPlanPersonalScheduleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.DesktopVirtualization.Models.ScalingPlanPersonalSchedulePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.DesktopVirtualization.Models.ScalingPlanPersonalSchedulePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ScalingPlanPooledScheduleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ScalingPlanPooledScheduleCollection() { } @@ -287,6 +392,9 @@ protected ScalingPlanResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetScalingPlanPersonalSchedule(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetScalingPlanPersonalScheduleAsync(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DesktopVirtualization.ScalingPlanPersonalScheduleCollection GetScalingPlanPersonalSchedules() { throw null; } public virtual Azure.Response GetScalingPlanPooledSchedule(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetScalingPlanPooledScheduleAsync(string scalingPlanScheduleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DesktopVirtualization.ScalingPlanPooledScheduleCollection GetScalingPlanPooledSchedules() { throw null; } @@ -472,6 +580,7 @@ public VirtualApplicationGroupData(Azure.Core.AzureLocation location, Azure.Core public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationMigrationProperties MigrationRequest { get { throw null; } set { } } public string ObjectId { get { throw null; } } public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } + public bool? ShowInFeed { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku Sku { get { throw null; } set { } } public Azure.Core.ResourceIdentifier WorkspaceId { get { throw null; } } } @@ -591,6 +700,8 @@ public VirtualWorkspaceData(Azure.Core.AzureLocation location) : base (default(A public Azure.Core.ResourceIdentifier ManagedBy { get { throw null; } set { } } public string ObjectId { get { throw null; } } public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku Sku { get { throw null; } set { } } } public partial class VirtualWorkspaceResource : Azure.ResourceManager.ArmResource @@ -606,6 +717,11 @@ protected VirtualWorkspaceResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPrivateLinkResources(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(int? pageSize = default(int?), bool? isDescending = default(bool?), int? initialSkip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkspacePrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspacePrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DesktopVirtualization.WorkspacePrivateEndpointConnectionCollection GetWorkspacePrivateEndpointConnections() { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -613,18 +729,51 @@ protected VirtualWorkspaceResource() { } public virtual Azure.Response Update(Azure.ResourceManager.DesktopVirtualization.Models.VirtualWorkspacePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.DesktopVirtualization.Models.VirtualWorkspacePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class WorkspacePrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspacePrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspacePrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspacePrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.DesktopVirtualization.PrivateEndpointConnectionWithSystemDataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection connection, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.DesktopVirtualization.Models { public static partial class ArmDesktopVirtualizationModelFactory { + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnection DesktopVirtualizationPrivateEndpointConnection(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateLinkResource DesktopVirtualizationPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationStartMenuItem DesktopVirtualizationStartMenuItem(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string appAlias = null, string filePath = null, string commandLineArguments = null, string iconPath = null, int? iconIndex = default(int?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.Models.ExpandMsixImage ExpandMsixImage(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string packageAlias = null, string imagePath = null, string packageName = null, string packageFamilyName = null, string packageFullName = null, string displayName = null, string packageRelativePath = null, bool? isRegularRegistration = default(bool?), bool? isActive = default(bool?), System.Collections.Generic.IEnumerable packageDependencies = null, string version = null, System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable packageApplications = null) { throw null; } - public static Azure.ResourceManager.DesktopVirtualization.HostPoolData HostPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string friendlyName = null, string description = null, Azure.ResourceManager.DesktopVirtualization.Models.HostPoolType hostPoolType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolType), Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType? personalDesktopAssignmentType = default(Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType?), string customRdpProperty = null, int? maxSessionLimit = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType loadBalancerType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType), int? ring = default(int?), bool? isValidationEnvironment = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolRegistrationInfo registrationInfo = null, string vmTemplate = null, System.Collections.Generic.IEnumerable applicationGroupReferences = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType? ssoSecretType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType?), Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType preferredAppGroupType = default(Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType), bool? startVmOnConnect = default(bool?), bool? isCloudPCResource = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHostAgentUpdateProperties agentUpdate = null, Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } - public static Azure.ResourceManager.DesktopVirtualization.Models.HostPoolPatch HostPoolPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, string friendlyName = null, string description = null, string customRdpProperty = null, int? maxSessionLimit = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType? personalDesktopAssignmentType = default(Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType? loadBalancerType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType?), int? ring = default(int?), bool? isValidationEnvironment = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolRegistrationInfoPatch registrationInfo = null, string vmTemplate = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType? ssoSecretType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType?), Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType? preferredAppGroupType = default(Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType?), bool? startVmOnConnect = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHostAgentUpdatePatchProperties agentUpdate = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.HostPoolData HostPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string friendlyName = null, string description = null, Azure.ResourceManager.DesktopVirtualization.Models.HostPoolType hostPoolType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolType), Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType? personalDesktopAssignmentType = default(Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType?), string customRdpProperty = null, int? maxSessionLimit = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType loadBalancerType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType), int? ring = default(int?), bool? isValidationEnvironment = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolRegistrationInfo registrationInfo = null, string vmTemplate = null, System.Collections.Generic.IEnumerable applicationGroupReferences = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType? ssoSecretType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType?), Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType preferredAppGroupType = default(Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType), bool? startVmOnConnect = default(bool?), bool? isCloudPCResource = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHostAgentUpdateProperties agentUpdate = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.HostPoolPatch HostPoolPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, string friendlyName = null, string description = null, string customRdpProperty = null, int? maxSessionLimit = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType? personalDesktopAssignmentType = default(Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType? loadBalancerType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolLoadBalancerType?), int? ring = default(int?), bool? isValidationEnvironment = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.HostPoolRegistrationInfoPatch registrationInfo = null, string vmTemplate = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType? ssoSecretType = default(Azure.ResourceManager.DesktopVirtualization.Models.HostPoolSsoSecretType?), Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType? preferredAppGroupType = default(Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType?), bool? startVmOnConnect = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHostAgentUpdatePatchProperties agentUpdate = null) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.MsixPackageData MsixPackageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string imagePath = null, string packageName = null, string packageFamilyName = null, string displayName = null, string packageRelativePath = null, bool? isRegularRegistration = default(bool?), bool? isActive = default(bool?), System.Collections.Generic.IEnumerable packageDependencies = null, string version = null, System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable packageApplications = null) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.Models.MsixPackagePatch MsixPackagePatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? isActive = default(bool?), bool? isRegularRegistration = default(bool?), string displayName = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.PrivateEndpointConnectionWithSystemDataData PrivateEndpointConnectionWithSystemDataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanData ScalingPlanData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string description = null, string friendlyName = null, string timeZone = null, Azure.ResourceManager.DesktopVirtualization.Models.ScalingHostPoolType? scalingHostPoolType = default(Azure.ResourceManager.DesktopVirtualization.Models.ScalingHostPoolType?), string exclusionTag = null, System.Collections.Generic.IEnumerable schedules = null, System.Collections.Generic.IEnumerable hostPoolReferences = null, Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanPersonalScheduleData ScalingPlanPersonalScheduleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable daysOfWeek = null, Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime rampUpStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior? rampUpAutoStartHosts = default(Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior?), Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? rampUpStartVmOnConnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? rampUpActionOnDisconnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? rampUpMinutesToWaitOnDisconnect = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? rampUpActionOnLogoff = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? rampUpMinutesToWaitOnLogoff = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime peakStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? peakStartVmOnConnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? peakActionOnDisconnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? peakMinutesToWaitOnDisconnect = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? peakActionOnLogoff = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? peakMinutesToWaitOnLogoff = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime rampDownStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? rampDownStartVmOnConnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? rampDownActionOnDisconnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? rampDownMinutesToWaitOnDisconnect = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? rampDownActionOnLogoff = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? rampDownMinutesToWaitOnLogoff = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime offPeakStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? offPeakStartVmOnConnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? offPeakActionOnDisconnect = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? offPeakMinutesToWaitOnDisconnect = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? offPeakActionOnLogoff = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation?), int? offPeakMinutesToWaitOnLogoff = default(int?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable daysOfWeek = null, Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime rampUpStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?), int? rampUpMinimumHostsPct = default(int?), int? rampUpCapacityThresholdPct = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime peakStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime rampDownStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?), int? rampDownMinimumHostsPct = default(int?), int? rampDownCapacityThresholdPct = default(int?), bool? rampDownForceLogoffUsers = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = default(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationStopHostsWhen?), int? rampDownWaitTimeMinutes = default(int?), string rampDownNotificationMessage = null, Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime offPeakStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.Models.ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable daysOfWeek = null, Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime rampUpStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?), int? rampUpMinimumHostsPct = default(int?), int? rampUpCapacityThresholdPct = default(int?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime peakStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?), Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime rampDownStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?), int? rampDownMinimumHostsPct = default(int?), int? rampDownCapacityThresholdPct = default(int?), bool? rampDownForceLogoffUsers = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = default(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationStopHostsWhen?), int? rampDownWaitTimeMinutes = default(int?), string rampDownNotificationMessage = null, Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime offPeakStartTime = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostLoadBalancingAlgorithm?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.SessionHostData SessionHostData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string objectId = null, System.DateTimeOffset? lastHeartBeatOn = default(System.DateTimeOffset?), int? sessions = default(int?), string agentVersion = null, bool? allowNewSession = default(bool?), string vmId = null, Azure.Core.ResourceIdentifier resourceId = null, string assignedUser = null, string friendlyName = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostStatus? status = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostStatus?), System.DateTimeOffset? statusTimestamp = default(System.DateTimeOffset?), string osVersion = null, string sxsStackVersion = null, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostUpdateState? updateState = default(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostUpdateState?), System.DateTimeOffset? lastUpdatedOn = default(System.DateTimeOffset?), string updateErrorMessage = null, System.Collections.Generic.IEnumerable sessionHostHealthCheckResults = null) { throw null; } @@ -633,10 +782,10 @@ public static partial class ArmDesktopVirtualizationModelFactory public static Azure.ResourceManager.DesktopVirtualization.Models.SessionHostPatch SessionHostPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, bool? allowNewSession = default(bool?), string assignedUser = null, string friendlyName = null) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.UserSessionData UserSessionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string objectId = null, string userPrincipalName = null, Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationType? applicationType = default(Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationType?), Azure.ResourceManager.DesktopVirtualization.Models.UserSessionState? sessionState = default(Azure.ResourceManager.DesktopVirtualization.Models.UserSessionState?), string activeDirectoryUserName = null, System.DateTimeOffset? createOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.VirtualApplicationData VirtualApplicationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string objectId = null, string description = null, string friendlyName = null, string filePath = null, string msixPackageFamilyName = null, string msixPackageApplicationId = null, Azure.ResourceManager.DesktopVirtualization.Models.RemoteApplicationType? applicationType = default(Azure.ResourceManager.DesktopVirtualization.Models.RemoteApplicationType?), Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationCommandLineSetting commandLineSetting = default(Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationCommandLineSetting), string commandLineArguments = null, bool? showInPortal = default(bool?), string iconPath = null, int? iconIndex = default(int?), string iconHash = null, System.BinaryData iconContent = null) { throw null; } - public static Azure.ResourceManager.DesktopVirtualization.VirtualApplicationGroupData VirtualApplicationGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string description = null, string friendlyName = null, Azure.Core.ResourceIdentifier hostPoolId = null, Azure.Core.ResourceIdentifier workspaceId = null, Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationGroupType applicationGroupType = default(Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationGroupType), bool? isCloudPCResource = default(bool?), Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } - public static Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationGroupPatch VirtualApplicationGroupPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, string description = null, string friendlyName = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.VirtualApplicationGroupData VirtualApplicationGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string description = null, string friendlyName = null, Azure.Core.ResourceIdentifier hostPoolId = null, Azure.Core.ResourceIdentifier workspaceId = null, Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationGroupType applicationGroupType = default(Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationGroupType), bool? isCloudPCResource = default(bool?), bool? showInFeed = default(bool?), Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.VirtualApplicationGroupPatch VirtualApplicationGroupPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, string description = null, string friendlyName = null, bool? showInFeed = default(bool?)) { throw null; } public static Azure.ResourceManager.DesktopVirtualization.VirtualDesktopData VirtualDesktopData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string objectId = null, string description = null, string friendlyName = null, string iconHash = null, System.BinaryData iconContent = null) { throw null; } - public static Azure.ResourceManager.DesktopVirtualization.VirtualWorkspaceData VirtualWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string description = null, string friendlyName = null, System.Collections.Generic.IEnumerable applicationGroupReferences = null, bool? isCloudPCResource = default(bool?), Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.VirtualWorkspaceData VirtualWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string objectId = null, string description = null, string friendlyName = null, System.Collections.Generic.IEnumerable applicationGroupReferences = null, bool? isCloudPCResource = default(bool?), Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.Core.ResourceIdentifier managedBy = null, string kind = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationSku sku = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } } public enum DesktopVirtualizationDayOfWeek { @@ -656,6 +805,66 @@ public DesktopVirtualizationMigrationProperties() { } public string MigrationPath { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.MigrationOperation? Operation { get { throw null; } set { } } } + public partial class DesktopVirtualizationPrivateEndpointConnection : Azure.ResourceManager.Models.ResourceData + { + public DesktopVirtualizationPrivateEndpointConnection() { } + public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DesktopVirtualizationPrivateEndpointConnectionProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DesktopVirtualizationPrivateEndpointConnectionProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointConnectionProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DesktopVirtualizationPrivateEndpointServiceConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DesktopVirtualizationPrivateEndpointServiceConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DesktopVirtualizationPrivateLinkResource : Azure.ResourceManager.Models.ResourceData + { + public DesktopVirtualizationPrivateLinkResource() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + } + public partial class DesktopVirtualizationPrivateLinkServiceConnectionState + { + public DesktopVirtualizationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.DesktopVirtualizationPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + } public partial class DesktopVirtualizationSku { public DesktopVirtualizationSku(string name) { } @@ -747,6 +956,7 @@ public HostPoolPatch() { } public int? MaxSessionLimit { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.PersonalDesktopAssignmentType? PersonalDesktopAssignmentType { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.PreferredAppGroupType? PreferredAppGroupType { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.DesktopVirtualization.Models.HostPoolRegistrationInfoPatch RegistrationInfo { get { throw null; } set { } } public int? Ring { get { throw null; } set { } } public string SsoAdfsAuthority { get { throw null; } set { } } @@ -757,6 +967,26 @@ public HostPoolPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public string VmTemplate { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HostpoolPublicNetworkAccess : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HostpoolPublicNetworkAccess(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess Disabled { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess Enabled { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess EnabledForClientsOnly { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess EnabledForSessionHostsOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess left, Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess left, Azure.ResourceManager.DesktopVirtualization.Models.HostpoolPublicNetworkAccess right) { throw null; } + public override string ToString() { throw null; } + } public partial class HostPoolRegistrationInfo { public HostPoolRegistrationInfo() { } @@ -925,6 +1155,24 @@ public MsixPackagePatch() { } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PublicNetworkAccess : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PublicNetworkAccess(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess Disabled { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess left, Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess left, Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RemoteApplicationType : System.IEquatable { private readonly object _dummy; @@ -985,6 +1233,36 @@ public ScalingPlanPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public string TimeZone { get { throw null; } set { } } } + public partial class ScalingPlanPersonalSchedulePatch + { + public ScalingPlanPersonalSchedulePatch() { } + public System.Collections.Generic.IList DaysOfWeek { get { throw null; } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? OffPeakActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? OffPeakActionOnLogoff { get { throw null; } set { } } + public int? OffPeakMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? OffPeakMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime OffPeakStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? OffPeakStartVmOnConnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? PeakActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? PeakActionOnLogoff { get { throw null; } set { } } + public int? PeakMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? PeakMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime PeakStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? PeakStartVmOnConnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampDownActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampDownActionOnLogoff { get { throw null; } set { } } + public int? RampDownMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? RampDownMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime RampDownStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? RampDownStartVmOnConnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampUpActionOnDisconnect { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation? RampUpActionOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior? RampUpAutoStartHosts { get { throw null; } set { } } + public int? RampUpMinutesToWaitOnDisconnect { get { throw null; } set { } } + public int? RampUpMinutesToWaitOnLogoff { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.ScalingActionTime RampUpStartTime { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect? RampUpStartVmOnConnect { get { throw null; } set { } } + } public partial class ScalingPlanPooledSchedulePatch : Azure.ResourceManager.Models.ResourceData { public ScalingPlanPooledSchedulePatch() { } @@ -1063,6 +1341,25 @@ public ScalingSchedule() { } public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.ScalingScheduleDaysOfWeekItem left, Azure.ResourceManager.DesktopVirtualization.Models.ScalingScheduleDaysOfWeekItem right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SessionHandlingOperation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SessionHandlingOperation(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation Deallocate { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation Hibernate { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation None { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation left, Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation left, Azure.ResourceManager.DesktopVirtualization.Models.SessionHandlingOperation right) { throw null; } + public override string ToString() { throw null; } + } public partial class SessionHostAgentUpdatePatchProperties { public SessionHostAgentUpdatePatchProperties() { } @@ -1238,6 +1535,43 @@ public SessionHostPatch() { } public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.SessionHostUpdateState left, Azure.ResourceManager.DesktopVirtualization.Models.SessionHostUpdateState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SetStartVmOnConnect : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SetStartVmOnConnect(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect Disable { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect Enable { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect left, Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect left, Azure.ResourceManager.DesktopVirtualization.Models.SetStartVmOnConnect right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StartupBehavior : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StartupBehavior(string value) { throw null; } + public static Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior All { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior None { get { throw null; } } + public static Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior WithAssignedUser { get { throw null; } } + public bool Equals(Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior left, Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior right) { throw null; } + public static implicit operator Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior left, Azure.ResourceManager.DesktopVirtualization.Models.StartupBehavior right) { throw null; } + public override string ToString() { throw null; } + } public partial class UserSessionMessage { public UserSessionMessage() { } @@ -1290,6 +1624,7 @@ public partial class VirtualApplicationGroupPatch : Azure.ResourceManager.Models public VirtualApplicationGroupPatch() { } public string Description { get { throw null; } set { } } public string FriendlyName { get { throw null; } set { } } + public bool? ShowInFeed { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -1357,6 +1692,7 @@ public VirtualWorkspacePatch() { } public System.Collections.Generic.IList ApplicationGroupReferences { get { throw null; } } public string Description { get { throw null; } set { } } public string FriendlyName { get { throw null; } set { } } + public Azure.ResourceManager.DesktopVirtualization.Models.PublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs index 939db8b8d77df..ada9a780e8765 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs @@ -30,6 +30,8 @@ public static partial class ArmDesktopVirtualizationModelFactory /// Friendly name of Workspace. /// List of applicationGroup resource Ids. /// Is cloud pc resource. + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + /// List of private endpoint connection associated with the specified 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. /// 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. /// 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. @@ -37,12 +39,58 @@ public static partial class ArmDesktopVirtualizationModelFactory /// The resource model definition representing SKU. /// Gets or sets the plan. /// A new instance for mocking. - public static VirtualWorkspaceData VirtualWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, IEnumerable applicationGroupReferences = null, bool? isCloudPCResource = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) + public static VirtualWorkspaceData VirtualWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, IEnumerable applicationGroupReferences = null, bool? isCloudPCResource = null, PublicNetworkAccess? publicNetworkAccess = null, IEnumerable privateEndpointConnections = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { tags ??= new Dictionary(); applicationGroupReferences ??= new List(); + privateEndpointConnections ??= new List(); - return new VirtualWorkspaceData(id, name, resourceType, systemData, tags, location, objectId, description, friendlyName, applicationGroupReferences?.ToList(), isCloudPCResource, managedBy, kind, etag, identity, sku, plan); + return new VirtualWorkspaceData(id, name, resourceType, systemData, tags, location, objectId, description, friendlyName, applicationGroupReferences?.ToList(), isCloudPCResource, publicNetworkAccess, privateEndpointConnections?.ToList(), managedBy, kind, etag, identity, sku, plan); + } + + /// Initializes a new instance of DesktopVirtualizationPrivateEndpointConnection. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// A new instance for mocking. + public static DesktopVirtualizationPrivateEndpointConnection DesktopVirtualizationPrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, DesktopVirtualizationPrivateLinkServiceConnectionState connectionState = null, DesktopVirtualizationPrivateEndpointConnectionProvisioningState? provisioningState = null) + { + return new DesktopVirtualizationPrivateEndpointConnection(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, provisioningState); + } + + /// Initializes a new instance of PrivateEndpointConnectionWithSystemDataData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// A new instance for mocking. + public static PrivateEndpointConnectionWithSystemDataData PrivateEndpointConnectionWithSystemDataData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, DesktopVirtualizationPrivateLinkServiceConnectionState connectionState = null, DesktopVirtualizationPrivateEndpointConnectionProvisioningState? provisioningState = null) + { + return new PrivateEndpointConnectionWithSystemDataData(id, name, resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, provisioningState); + } + + /// Initializes a new instance of DesktopVirtualizationPrivateLinkResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + /// A new instance for mocking. + public static DesktopVirtualizationPrivateLinkResource DesktopVirtualizationPrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new DesktopVirtualizationPrivateLinkResource(id, name, resourceType, systemData, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList()); } /// Initializes a new instance of ScalingPlanData. @@ -136,6 +184,45 @@ public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(Reso return new ScalingPlanPooledSchedulePatch(id, name, resourceType, systemData, daysOfWeek?.ToList(), rampUpStartTime, rampUpLoadBalancingAlgorithm, rampUpMinimumHostsPct, rampUpCapacityThresholdPct, peakStartTime, peakLoadBalancingAlgorithm, rampDownStartTime, rampDownLoadBalancingAlgorithm, rampDownMinimumHostsPct, rampDownCapacityThresholdPct, rampDownForceLogoffUsers, rampDownStopHostsWhen, rampDownWaitTimeMinutes, rampDownNotificationMessage, offPeakStartTime, offPeakLoadBalancingAlgorithm); } + /// Initializes a new instance of ScalingPlanPersonalScheduleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Set of days of the week on which this schedule is active. + /// Starting time for ramp up period. + /// The desired startup behavior during the ramp up period for personal vms in the hostpool. + /// 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. + /// Action to be taken after a user disconnect during the ramp up period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp up period. + /// Action to be taken after a logoff 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. + /// Starting time for peak period. + /// The desired configuration of Start VM On Connect for the hostpool during the peak phase. + /// Action to be taken after a user disconnect during the peak period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the peak period. + /// Action to be taken after a logoff 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. + /// Starting time for ramp down period. + /// The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. + /// Action to be taken after a user disconnect during the ramp down period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp down period. + /// Action to be taken after a logoff 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. + /// Starting time for off-peak period. + /// The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. + /// Action to be taken after a user disconnect during the off-peak period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the off-peak period. + /// Action to be taken after a logoff 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. + /// A new instance for mocking. + public static ScalingPlanPersonalScheduleData ScalingPlanPersonalScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable daysOfWeek = null, ScalingActionTime rampUpStartTime = null, StartupBehavior? rampUpAutoStartHosts = null, SetStartVmOnConnect? rampUpStartVmOnConnect = null, SessionHandlingOperation? rampUpActionOnDisconnect = null, int? rampUpMinutesToWaitOnDisconnect = null, SessionHandlingOperation? rampUpActionOnLogoff = null, int? rampUpMinutesToWaitOnLogoff = null, ScalingActionTime peakStartTime = null, SetStartVmOnConnect? peakStartVmOnConnect = null, SessionHandlingOperation? peakActionOnDisconnect = null, int? peakMinutesToWaitOnDisconnect = null, SessionHandlingOperation? peakActionOnLogoff = null, int? peakMinutesToWaitOnLogoff = null, ScalingActionTime rampDownStartTime = null, SetStartVmOnConnect? rampDownStartVmOnConnect = null, SessionHandlingOperation? rampDownActionOnDisconnect = null, int? rampDownMinutesToWaitOnDisconnect = null, SessionHandlingOperation? rampDownActionOnLogoff = null, int? rampDownMinutesToWaitOnLogoff = null, ScalingActionTime offPeakStartTime = null, SetStartVmOnConnect? offPeakStartVmOnConnect = null, SessionHandlingOperation? offPeakActionOnDisconnect = null, int? offPeakMinutesToWaitOnDisconnect = null, SessionHandlingOperation? offPeakActionOnLogoff = null, int? offPeakMinutesToWaitOnLogoff = null) + { + daysOfWeek ??= new List(); + + return new ScalingPlanPersonalScheduleData(id, name, resourceType, systemData, daysOfWeek?.ToList(), rampUpStartTime, rampUpAutoStartHosts, rampUpStartVmOnConnect, rampUpActionOnDisconnect, rampUpMinutesToWaitOnDisconnect, rampUpActionOnLogoff, rampUpMinutesToWaitOnLogoff, peakStartTime, peakStartVmOnConnect, peakActionOnDisconnect, peakMinutesToWaitOnDisconnect, peakActionOnLogoff, peakMinutesToWaitOnLogoff, rampDownStartTime, rampDownStartVmOnConnect, rampDownActionOnDisconnect, rampDownMinutesToWaitOnDisconnect, rampDownActionOnLogoff, rampDownMinutesToWaitOnLogoff, offPeakStartTime, offPeakStartVmOnConnect, offPeakActionOnDisconnect, offPeakMinutesToWaitOnDisconnect, offPeakActionOnLogoff, offPeakMinutesToWaitOnLogoff); + } + /// Initializes a new instance of VirtualApplicationGroupData. /// The id. /// The name. @@ -150,6 +237,7 @@ public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(Reso /// Workspace arm path of ApplicationGroup. /// Resource Type of ApplicationGroup. /// Is cloud pc resource. + /// Boolean representing whether the applicationGroup is show in the feed. /// 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. /// 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. /// 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. @@ -157,11 +245,11 @@ public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(Reso /// The resource model definition representing SKU. /// Gets or sets the plan. /// A new instance for mocking. - public static VirtualApplicationGroupData VirtualApplicationGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, ResourceIdentifier hostPoolId = null, ResourceIdentifier workspaceId = null, VirtualApplicationGroupType applicationGroupType = default, bool? isCloudPCResource = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) + public static VirtualApplicationGroupData VirtualApplicationGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, ResourceIdentifier hostPoolId = null, ResourceIdentifier workspaceId = null, VirtualApplicationGroupType applicationGroupType = default, bool? isCloudPCResource = null, bool? showInFeed = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { tags ??= new Dictionary(); - return new VirtualApplicationGroupData(id, name, resourceType, systemData, tags, location, objectId, description, friendlyName, hostPoolId, workspaceId, applicationGroupType, isCloudPCResource, managedBy, kind, etag, identity, sku, plan); + return new VirtualApplicationGroupData(id, name, resourceType, systemData, tags, location, objectId, description, friendlyName, hostPoolId, workspaceId, applicationGroupType, isCloudPCResource, showInFeed, managedBy, kind, etag, identity, sku, plan); } /// Initializes a new instance of VirtualApplicationGroupPatch. @@ -172,12 +260,13 @@ public static VirtualApplicationGroupData VirtualApplicationGroupData(ResourceId /// tags to be updated. /// Description of ApplicationGroup. /// Friendly name of ApplicationGroup. + /// Boolean representing whether the applicationGroup is show in the feed. /// A new instance for mocking. - public static VirtualApplicationGroupPatch VirtualApplicationGroupPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, string description = null, string friendlyName = null) + public static VirtualApplicationGroupPatch VirtualApplicationGroupPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, string description = null, string friendlyName = null, bool? showInFeed = null) { tags ??= new Dictionary(); - return new VirtualApplicationGroupPatch(id, name, resourceType, systemData, tags, description, friendlyName); + return new VirtualApplicationGroupPatch(id, name, resourceType, systemData, tags, description, friendlyName, showInFeed); } /// Initializes a new instance of DesktopVirtualizationStartMenuItem. @@ -264,7 +353,9 @@ public static VirtualDesktopData VirtualDesktopData(ResourceIdentifier id = null /// The type of preferred application group type, default to Desktop Application Group. /// The flag to turn on/off StartVMOnConnect feature. /// Is cloud pc resource. + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. /// The session host configuration for updating agent, monitoring agent, and stack component. + /// List of private endpoint connection associated with the specified 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. /// 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. /// 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. @@ -272,12 +363,13 @@ public static VirtualDesktopData VirtualDesktopData(ResourceIdentifier id = null /// The resource model definition representing SKU. /// Gets or sets the plan. /// A new instance for mocking. - public static HostPoolData HostPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string friendlyName = null, string description = null, HostPoolType hostPoolType = default, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, string customRdpProperty = null, int? maxSessionLimit = null, HostPoolLoadBalancerType loadBalancerType = default, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfo registrationInfo = null, string vmTemplate = null, IEnumerable applicationGroupReferences = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType preferredAppGroupType = default, bool? startVmOnConnect = null, bool? isCloudPCResource = null, SessionHostAgentUpdateProperties agentUpdate = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) + public static HostPoolData HostPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string friendlyName = null, string description = null, HostPoolType hostPoolType = default, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, string customRdpProperty = null, int? maxSessionLimit = null, HostPoolLoadBalancerType loadBalancerType = default, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfo registrationInfo = null, string vmTemplate = null, IEnumerable applicationGroupReferences = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType preferredAppGroupType = default, bool? startVmOnConnect = null, bool? isCloudPCResource = null, HostpoolPublicNetworkAccess? publicNetworkAccess = null, SessionHostAgentUpdateProperties agentUpdate = null, IEnumerable privateEndpointConnections = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { tags ??= new Dictionary(); applicationGroupReferences ??= new List(); + privateEndpointConnections ??= new List(); - return new HostPoolData(id, name, resourceType, systemData, tags, location, objectId, friendlyName, description, hostPoolType, personalDesktopAssignmentType, customRdpProperty, maxSessionLimit, loadBalancerType, ring, isValidationEnvironment, registrationInfo, vmTemplate, applicationGroupReferences?.ToList(), ssoAdfsAuthority, ssoClientId, ssoClientSecretKeyVaultPath, ssoSecretType, preferredAppGroupType, startVmOnConnect, isCloudPCResource, agentUpdate, managedBy, kind, etag, identity, sku, plan); + return new HostPoolData(id, name, resourceType, systemData, tags, location, objectId, friendlyName, description, hostPoolType, personalDesktopAssignmentType, customRdpProperty, maxSessionLimit, loadBalancerType, ring, isValidationEnvironment, registrationInfo, vmTemplate, applicationGroupReferences?.ToList(), ssoAdfsAuthority, ssoClientId, ssoClientSecretKeyVaultPath, ssoSecretType, preferredAppGroupType, startVmOnConnect, isCloudPCResource, publicNetworkAccess, agentUpdate, privateEndpointConnections?.ToList(), managedBy, kind, etag, identity, sku, plan); } /// Initializes a new instance of HostPoolPatch. @@ -302,13 +394,14 @@ public static HostPoolData HostPoolData(ResourceIdentifier id = null, string nam /// The type of single sign on Secret Type. /// The type of preferred application group type, default to Desktop Application Group. /// The flag to turn on/off StartVMOnConnect feature. + /// Enabled to allow this resource to be access from the public network. /// The session host configuration for updating agent, monitoring agent, and stack component. /// A new instance for mocking. - public static HostPoolPatch HostPoolPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, string friendlyName = null, string description = null, string customRdpProperty = null, int? maxSessionLimit = null, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, HostPoolLoadBalancerType? loadBalancerType = null, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfoPatch registrationInfo = null, string vmTemplate = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType? preferredAppGroupType = null, bool? startVmOnConnect = null, SessionHostAgentUpdatePatchProperties agentUpdate = null) + public static HostPoolPatch HostPoolPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, string friendlyName = null, string description = null, string customRdpProperty = null, int? maxSessionLimit = null, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, HostPoolLoadBalancerType? loadBalancerType = null, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfoPatch registrationInfo = null, string vmTemplate = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType? preferredAppGroupType = null, bool? startVmOnConnect = null, HostpoolPublicNetworkAccess? publicNetworkAccess = null, SessionHostAgentUpdatePatchProperties agentUpdate = null) { tags ??= new Dictionary(); - return new HostPoolPatch(id, name, resourceType, systemData, tags, friendlyName, description, customRdpProperty, maxSessionLimit, personalDesktopAssignmentType, loadBalancerType, ring, isValidationEnvironment, registrationInfo, vmTemplate, ssoAdfsAuthority, ssoClientId, ssoClientSecretKeyVaultPath, ssoSecretType, preferredAppGroupType, startVmOnConnect, agentUpdate); + return new HostPoolPatch(id, name, resourceType, systemData, tags, friendlyName, description, customRdpProperty, maxSessionLimit, personalDesktopAssignmentType, loadBalancerType, ring, isValidationEnvironment, registrationInfo, vmTemplate, ssoAdfsAuthority, ssoClientId, ssoClientSecretKeyVaultPath, ssoSecretType, preferredAppGroupType, startVmOnConnect, publicNetworkAccess, agentUpdate); } /// Initializes a new instance of UserSessionData. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs index 484836e61f8f5..40b187319d9cc 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs @@ -68,6 +68,44 @@ public static VirtualWorkspaceResource GetVirtualWorkspaceResource(this ArmClien } #endregion + #region WorkspacePrivateEndpointConnectionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkspacePrivateEndpointConnectionResource GetWorkspacePrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkspacePrivateEndpointConnectionResource.ValidateResourceId(id); + return new WorkspacePrivateEndpointConnectionResource(client, id); + } + ); + } + #endregion + + #region HostPoolPrivateEndpointConnectionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static HostPoolPrivateEndpointConnectionResource GetHostPoolPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + HostPoolPrivateEndpointConnectionResource.ValidateResourceId(id); + return new HostPoolPrivateEndpointConnectionResource(client, id); + } + ); + } + #endregion + #region ScalingPlanResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -106,6 +144,25 @@ public static ScalingPlanPooledScheduleResource GetScalingPlanPooledScheduleReso } #endregion + #region ScalingPlanPersonalScheduleResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ScalingPlanPersonalScheduleResource GetScalingPlanPersonalScheduleResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ScalingPlanPersonalScheduleResource.ValidateResourceId(id); + return new ScalingPlanPersonalScheduleResource(client, id); + } + ); + } + #endregion + #region VirtualApplicationGroupResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs index 9b8503298892c..2b04782364b2a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs @@ -30,6 +30,7 @@ public HostPoolData(AzureLocation location, HostPoolType hostPoolType, HostPoolL LoadBalancerType = loadBalancerType; ApplicationGroupReferences = new ChangeTrackingList(); PreferredAppGroupType = preferredAppGroupType; + PrivateEndpointConnections = new ChangeTrackingList(); } /// Initializes a new instance of HostPoolData. @@ -59,14 +60,16 @@ public HostPoolData(AzureLocation location, HostPoolType hostPoolType, HostPoolL /// The type of preferred application group type, default to Desktop Application Group. /// The flag to turn on/off StartVMOnConnect feature. /// Is cloud pc resource. + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. /// The session host configuration for updating agent, monitoring agent, and stack component. + /// List of private endpoint connection associated with the specified 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. /// 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. /// 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. /// Gets or sets the identity. Current supported identity types: SystemAssigned. /// The resource model definition representing SKU. /// Gets or sets the plan. - internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IReadOnlyList applicationGroupReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, SessionHostAgentUpdateProperties agentUpdate, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) : base(id, name, resourceType, systemData, tags, location) + internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IReadOnlyList applicationGroupReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, HostpoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdateProperties agentUpdate, IReadOnlyList privateEndpointConnections, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) : base(id, name, resourceType, systemData, tags, location) { ObjectId = objectId; FriendlyName = friendlyName; @@ -88,7 +91,9 @@ internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceT PreferredAppGroupType = preferredAppGroupType; StartVmOnConnect = startVmOnConnect; IsCloudPCResource = isCloudPCResource; + PublicNetworkAccess = publicNetworkAccess; AgentUpdate = agentUpdate; + PrivateEndpointConnections = privateEndpointConnections; ManagedBy = managedBy; Kind = kind; ETag = etag; @@ -137,8 +142,12 @@ internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceT public bool? StartVmOnConnect { get; set; } /// Is cloud pc resource. public bool? IsCloudPCResource { get; } + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + public HostpoolPublicNetworkAccess? PublicNetworkAccess { get; set; } /// The session host configuration for updating agent, monitoring agent, and stack component. public SessionHostAgentUpdateProperties AgentUpdate { get; set; } + /// List of private endpoint connection associated with the specified resource. + public IReadOnlyList PrivateEndpointConnections { get; } /// 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. public ResourceIdentifier ManagedBy { get; set; } /// 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. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs new file mode 100644 index 0000000000000..7598547515ac5 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetHostPoolPrivateEndpointConnections method from an instance of . + /// + public partial class HostPoolPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected HostPoolPrivateEndpointConnectionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal HostPoolPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", HostPoolPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(HostPoolPrivateEndpointConnectionResource.ResourceType, out string hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != HostPoolResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HostPoolResource.ResourceType), nameof(id)); + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByHostPool + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByHostPoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, connection, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByHostPool + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByHostPool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, connection, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByHostPoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByHostPool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List private endpoint connections associated with hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnections_ListByHostPool + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByHostPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByHostPoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HostPoolPrivateEndpointConnectionResource(Client, PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(e)), _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "HostPoolPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List private endpoint connections associated with hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnections_ListByHostPool + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByHostPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByHostPoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HostPoolPrivateEndpointConnectionResource(Client, PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(e)), _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "HostPoolPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByHostPoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByHostPool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs new file mode 100644 index 0000000000000..6bd85917fefe8 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A Class representing a HostPoolPrivateEndpointConnection along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetHostPoolPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetHostPoolPrivateEndpointConnection method. + /// + public partial class HostPoolPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly PrivateEndpointConnectionWithSystemDataData _data; + + /// Initializes a new instance of the class for mocking. + protected HostPoolPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal HostPoolPrivateEndpointConnectionResource(ArmClient client, PrivateEndpointConnectionWithSystemDataData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal HostPoolPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DesktopVirtualization/hostPools/privateEndpointConnections"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual PrivateEndpointConnectionWithSystemDataData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByHostPoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByHostPool(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove a connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_DeleteByHostPool + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteByHostPoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove a connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_DeleteByHostPool + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteByHostPool(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByHostPool + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByHostPoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connection, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByHostPool + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("HostPoolPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _hostPoolPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByHostPool(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connection, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new HostPoolPrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs index e8823574898c2..fa1bcd4463866 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs @@ -36,6 +36,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _hostPoolClientDiagnostics; private readonly HostPoolsRestOperations _hostPoolRestClient; + private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly ClientDiagnostics _scalingPlanClientDiagnostics; private readonly ScalingPlansRestOperations _scalingPlanRestClient; private readonly ClientDiagnostics _userSessionClientDiagnostics; @@ -66,6 +68,8 @@ internal HostPoolResource(ArmClient client, ResourceIdentifier id) : base(client _hostPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string hostPoolApiVersion); _hostPoolRestClient = new HostPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hostPoolApiVersion); + _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _scalingPlanClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ScalingPlanResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(ScalingPlanResource.ResourceType, out string scalingPlanApiVersion); _scalingPlanRestClient = new ScalingPlansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scalingPlanApiVersion); @@ -103,6 +107,59 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of HostPoolPrivateEndpointConnectionResources in the HostPool. + /// An object representing collection of HostPoolPrivateEndpointConnectionResources and their operations over a HostPoolPrivateEndpointConnectionResource. + public virtual HostPoolPrivateEndpointConnectionCollection GetHostPoolPrivateEndpointConnections() + { + return GetCachedClient(Client => new HostPoolPrivateEndpointConnectionCollection(Client, Id)); + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetHostPoolPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetHostPoolPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByHostPool + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetHostPoolPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetHostPoolPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + /// Gets a collection of SessionHostResources in the HostPool. /// An object representing collection of SessionHostResources and their operations over a SessionHostResource. public virtual SessionHostCollection GetSessionHosts() @@ -411,6 +468,56 @@ public virtual Response Update(HostPoolPatch patch, Cancellati } } + /// + /// List the private link resources available for this hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResources_ListByHostPool + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPrivateLinkResourcesAsync(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByHostPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _privateLinkResourcesRestClient.CreateListByHostPoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DesktopVirtualizationPrivateLinkResource.DeserializeDesktopVirtualizationPrivateLinkResource, _privateLinkResourcesClientDiagnostics, Pipeline, "HostPoolResource.GetPrivateLinkResources", "value", "nextLink", cancellationToken); + } + + /// + /// List the private link resources available for this hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResources_ListByHostPool + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPrivateLinkResources(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByHostPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _privateLinkResourcesRestClient.CreateListByHostPoolNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DesktopVirtualizationPrivateLinkResource.DeserializeDesktopVirtualizationPrivateLinkResource, _privateLinkResourcesClientDiagnostics, Pipeline, "HostPoolResource.GetPrivateLinkResources", "value", "nextLink", cancellationToken); + } + /// /// List scaling plan associated with hostpool. /// diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.Serialization.cs new file mode 100644 index 0000000000000..efc9305824b08 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class DesktopVirtualizationPrivateEndpointConnection : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(ConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(ConnectionState); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DesktopVirtualizationPrivateEndpointConnection DeserializeDesktopVirtualizationPrivateEndpointConnection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional privateEndpoint = default; + Optional privateLinkServiceConnectionState = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("privateEndpoint"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = DesktopVirtualizationPrivateLinkServiceConnectionState.DeserializeDesktopVirtualizationPrivateLinkServiceConnectionState(property0.Value); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new DesktopVirtualizationPrivateEndpointConnection(id, name, type, systemData.Value, privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.cs new file mode 100644 index 0000000000000..a1970c0d4893a --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnection.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The Private Endpoint Connection resource. + public partial class DesktopVirtualizationPrivateEndpointConnection : ResourceData + { + /// Initializes a new instance of DesktopVirtualizationPrivateEndpointConnection. + public DesktopVirtualizationPrivateEndpointConnection() + { + } + + /// Initializes a new instance of DesktopVirtualizationPrivateEndpointConnection. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + internal DesktopVirtualizationPrivateEndpointConnection(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubResource privateEndpoint, DesktopVirtualizationPrivateLinkServiceConnectionState connectionState, DesktopVirtualizationPrivateEndpointConnectionProvisioningState? provisioningState) : base(id, name, resourceType, systemData) + { + PrivateEndpoint = privateEndpoint; + ConnectionState = connectionState; + ProvisioningState = provisioningState; + } + + /// The resource of private end point. + internal SubResource PrivateEndpoint { get; set; } + /// Gets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + } + + /// A collection of information about the state of the connection between service consumer and provider. + public DesktopVirtualizationPrivateLinkServiceConnectionState ConnectionState { get; set; } + /// The provisioning state of the private endpoint connection resource. + public DesktopVirtualizationPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnectionProvisioningState.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 0000000000000..efabf05f2708f --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The current provisioning state. + public readonly partial struct DesktopVirtualizationPrivateEndpointConnectionProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DesktopVirtualizationPrivateEndpointConnectionProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string FailedValue = "Failed"; + + /// Succeeded. + public static DesktopVirtualizationPrivateEndpointConnectionProvisioningState Succeeded { get; } = new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(SucceededValue); + /// Creating. + public static DesktopVirtualizationPrivateEndpointConnectionProvisioningState Creating { get; } = new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(CreatingValue); + /// Deleting. + public static DesktopVirtualizationPrivateEndpointConnectionProvisioningState Deleting { get; } = new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(DeletingValue); + /// Failed. + public static DesktopVirtualizationPrivateEndpointConnectionProvisioningState Failed { get; } = new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(DesktopVirtualizationPrivateEndpointConnectionProvisioningState left, DesktopVirtualizationPrivateEndpointConnectionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DesktopVirtualizationPrivateEndpointConnectionProvisioningState left, DesktopVirtualizationPrivateEndpointConnectionProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DesktopVirtualizationPrivateEndpointConnectionProvisioningState(string value) => new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DesktopVirtualizationPrivateEndpointConnectionProvisioningState other && Equals(other); + /// + public bool Equals(DesktopVirtualizationPrivateEndpointConnectionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointServiceConnectionStatus.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..90e93979d8bf6 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The private endpoint connection status. + public readonly partial struct DesktopVirtualizationPrivateEndpointServiceConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DesktopVirtualizationPrivateEndpointServiceConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string RejectedValue = "Rejected"; + + /// Pending. + public static DesktopVirtualizationPrivateEndpointServiceConnectionStatus Pending { get; } = new DesktopVirtualizationPrivateEndpointServiceConnectionStatus(PendingValue); + /// Approved. + public static DesktopVirtualizationPrivateEndpointServiceConnectionStatus Approved { get; } = new DesktopVirtualizationPrivateEndpointServiceConnectionStatus(ApprovedValue); + /// Rejected. + public static DesktopVirtualizationPrivateEndpointServiceConnectionStatus Rejected { get; } = new DesktopVirtualizationPrivateEndpointServiceConnectionStatus(RejectedValue); + /// Determines if two values are the same. + public static bool operator ==(DesktopVirtualizationPrivateEndpointServiceConnectionStatus left, DesktopVirtualizationPrivateEndpointServiceConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DesktopVirtualizationPrivateEndpointServiceConnectionStatus left, DesktopVirtualizationPrivateEndpointServiceConnectionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DesktopVirtualizationPrivateEndpointServiceConnectionStatus(string value) => new DesktopVirtualizationPrivateEndpointServiceConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DesktopVirtualizationPrivateEndpointServiceConnectionStatus other && Equals(other); + /// + public bool Equals(DesktopVirtualizationPrivateEndpointServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.Serialization.cs new file mode 100644 index 0000000000000..6c518f83a362c --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class DesktopVirtualizationPrivateLinkResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DesktopVirtualizationPrivateLinkResource DeserializeDesktopVirtualizationPrivateLinkResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional groupId = default; + Optional> requiredMembers = default; + Optional> requiredZoneNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("groupId"u8)) + { + groupId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("requiredMembers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property0.NameEquals("requiredZoneNames"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + } + continue; + } + } + return new DesktopVirtualizationPrivateLinkResource(id, name, type, systemData.Value, groupId.Value, Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames)); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.cs new file mode 100644 index 0000000000000..917aa1273b833 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResource.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// A private link resource. + public partial class DesktopVirtualizationPrivateLinkResource : ResourceData + { + /// Initializes a new instance of DesktopVirtualizationPrivateLinkResource. + public DesktopVirtualizationPrivateLinkResource() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of DesktopVirtualizationPrivateLinkResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + internal DesktopVirtualizationPrivateLinkResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames) : base(id, name, resourceType, systemData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + } + + /// The private link resource group id. + public string GroupId { get; } + /// The private link resource required member names. + public IReadOnlyList RequiredMembers { get; } + /// The private link resource Private link DNS zone name. + public IList RequiredZoneNames { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..6b0c0a9d04bb8 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class DesktopVirtualizationPrivateLinkResourceListResult + { + internal static DesktopVirtualizationPrivateLinkResourceListResult DeserializeDesktopVirtualizationPrivateLinkResourceListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DesktopVirtualizationPrivateLinkResource.DeserializeDesktopVirtualizationPrivateLinkResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DesktopVirtualizationPrivateLinkResourceListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.cs new file mode 100644 index 0000000000000..2caf80af1a551 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkResourceListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// A list of private link resources. + internal partial class DesktopVirtualizationPrivateLinkResourceListResult + { + /// Initializes a new instance of DesktopVirtualizationPrivateLinkResourceListResult. + internal DesktopVirtualizationPrivateLinkResourceListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of DesktopVirtualizationPrivateLinkResourceListResult. + /// Array of private link resources. + /// Link to the next page of results. + internal DesktopVirtualizationPrivateLinkResourceListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Array of private link resources. + public IReadOnlyList Value { get; } + /// Link to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 0000000000000..f458c177c6703 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class DesktopVirtualizationPrivateLinkServiceConnectionState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + writer.WriteEndObject(); + } + + internal static DesktopVirtualizationPrivateLinkServiceConnectionState DeserializeDesktopVirtualizationPrivateLinkServiceConnectionState(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional status = default; + Optional description = default; + Optional actionsRequired = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new DesktopVirtualizationPrivateEndpointServiceConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + } + return new DesktopVirtualizationPrivateLinkServiceConnectionState(Optional.ToNullable(status), description.Value, actionsRequired.Value); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..b448b3fb3a8af --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DesktopVirtualizationPrivateLinkServiceConnectionState.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// A collection of information about the state of the connection between service consumer and provider. + public partial class DesktopVirtualizationPrivateLinkServiceConnectionState + { + /// Initializes a new instance of DesktopVirtualizationPrivateLinkServiceConnectionState. + public DesktopVirtualizationPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of DesktopVirtualizationPrivateLinkServiceConnectionState. + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// The reason for approval/rejection of the connection. + /// A message indicating if changes on the service provider require any updates on the consumer. + internal DesktopVirtualizationPrivateLinkServiceConnectionState(DesktopVirtualizationPrivateEndpointServiceConnectionStatus? status, string description, string actionsRequired) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + } + + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + public DesktopVirtualizationPrivateEndpointServiceConnectionStatus? Status { get; set; } + /// The reason for approval/rejection of the connection. + public string Description { get; set; } + /// A message indicating if changes on the service provider require any updates on the consumer. + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolData.Serialization.cs index c775aaf7e76dd..6d700d66ec188 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolData.Serialization.cs @@ -135,6 +135,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("startVMOnConnect"u8); writer.WriteBooleanValue(StartVmOnConnect.Value); } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } if (Optional.IsDefined(AgentUpdate)) { writer.WritePropertyName("agentUpdate"u8); @@ -182,7 +187,9 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element) PreferredAppGroupType preferredAppGroupType = default; Optional startVmOnConnect = default; Optional cloudPCResource = default; + Optional publicNetworkAccess = default; Optional agentUpdate = default; + Optional> privateEndpointConnections = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("managedBy"u8)) @@ -428,6 +435,15 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element) cloudPCResource = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new HostpoolPublicNetworkAccess(property0.Value.GetString()); + continue; + } if (property0.NameEquals("agentUpdate"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -437,11 +453,25 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element) agentUpdate = SessionHostAgentUpdateProperties.DeserializeSessionHostAgentUpdateProperties(property0.Value); continue; } + if (property0.NameEquals("privateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DesktopVirtualizationPrivateEndpointConnection.DeserializeDesktopVirtualizationPrivateEndpointConnection(item)); + } + privateEndpointConnections = array; + continue; + } } continue; } } - return new HostPoolData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, objectId.Value, friendlyName.Value, description.Value, hostPoolType, Optional.ToNullable(personalDesktopAssignmentType), customRdpProperty.Value, Optional.ToNullable(maxSessionLimit), loadBalancerType, Optional.ToNullable(ring), Optional.ToNullable(validationEnvironment), registrationInfo.Value, vmTemplate.Value, Optional.ToList(applicationGroupReferences), ssoadfsAuthority.Value, ssoClientId.Value, ssoClientSecretKeyVaultPath.Value, Optional.ToNullable(ssoSecretType), preferredAppGroupType, Optional.ToNullable(startVmOnConnect), Optional.ToNullable(cloudPCResource), agentUpdate.Value, managedBy.Value, kind.Value, Optional.ToNullable(etag), identity, sku.Value, plan); + return new HostPoolData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, objectId.Value, friendlyName.Value, description.Value, hostPoolType, Optional.ToNullable(personalDesktopAssignmentType), customRdpProperty.Value, Optional.ToNullable(maxSessionLimit), loadBalancerType, Optional.ToNullable(ring), Optional.ToNullable(validationEnvironment), registrationInfo.Value, vmTemplate.Value, Optional.ToList(applicationGroupReferences), ssoadfsAuthority.Value, ssoClientId.Value, ssoClientSecretKeyVaultPath.Value, Optional.ToNullable(ssoSecretType), preferredAppGroupType, Optional.ToNullable(startVmOnConnect), Optional.ToNullable(cloudPCResource), Optional.ToNullable(publicNetworkAccess), agentUpdate.Value, Optional.ToList(privateEndpointConnections), managedBy.Value, kind.Value, Optional.ToNullable(etag), identity, sku.Value, plan); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs index 5f653f0dfe262..1898d2f60e9a9 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs @@ -110,6 +110,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("startVMOnConnect"u8); writer.WriteBooleanValue(StartVmOnConnect.Value); } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } if (Optional.IsDefined(AgentUpdate)) { writer.WritePropertyName("agentUpdate"u8); @@ -146,6 +151,7 @@ internal static HostPoolPatch DeserializeHostPoolPatch(JsonElement element) Optional ssoSecretType = default; Optional preferredAppGroupType = default; Optional startVmOnConnect = default; + Optional publicNetworkAccess = default; Optional agentUpdate = default; foreach (var property in element.EnumerateObject()) { @@ -312,6 +318,15 @@ internal static HostPoolPatch DeserializeHostPoolPatch(JsonElement element) startVmOnConnect = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new HostpoolPublicNetworkAccess(property0.Value.GetString()); + continue; + } if (property0.NameEquals("agentUpdate"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -325,7 +340,7 @@ internal static HostPoolPatch DeserializeHostPoolPatch(JsonElement element) continue; } } - return new HostPoolPatch(id, name, type, systemData.Value, Optional.ToDictionary(tags), friendlyName.Value, description.Value, customRdpProperty.Value, Optional.ToNullable(maxSessionLimit), Optional.ToNullable(personalDesktopAssignmentType), Optional.ToNullable(loadBalancerType), Optional.ToNullable(ring), Optional.ToNullable(validationEnvironment), registrationInfo.Value, vmTemplate.Value, ssoadfsAuthority.Value, ssoClientId.Value, ssoClientSecretKeyVaultPath.Value, Optional.ToNullable(ssoSecretType), Optional.ToNullable(preferredAppGroupType), Optional.ToNullable(startVmOnConnect), agentUpdate.Value); + return new HostPoolPatch(id, name, type, systemData.Value, Optional.ToDictionary(tags), friendlyName.Value, description.Value, customRdpProperty.Value, Optional.ToNullable(maxSessionLimit), Optional.ToNullable(personalDesktopAssignmentType), Optional.ToNullable(loadBalancerType), Optional.ToNullable(ring), Optional.ToNullable(validationEnvironment), registrationInfo.Value, vmTemplate.Value, ssoadfsAuthority.Value, ssoClientId.Value, ssoClientSecretKeyVaultPath.Value, Optional.ToNullable(ssoSecretType), Optional.ToNullable(preferredAppGroupType), Optional.ToNullable(startVmOnConnect), Optional.ToNullable(publicNetworkAccess), agentUpdate.Value); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs index 8366cde419cd6..5b28a44d9ad9c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs @@ -42,8 +42,9 @@ public HostPoolPatch() /// The type of single sign on Secret Type. /// The type of preferred application group type, default to Desktop Application Group. /// The flag to turn on/off StartVMOnConnect feature. + /// Enabled to allow this resource to be access from the public network. /// The session host configuration for updating agent, monitoring agent, and stack component. - internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, SessionHostAgentUpdatePatchProperties agentUpdate) : base(id, name, resourceType, systemData) + internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, HostpoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdatePatchProperties agentUpdate) : base(id, name, resourceType, systemData) { Tags = tags; FriendlyName = friendlyName; @@ -62,6 +63,7 @@ internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resource SsoSecretType = ssoSecretType; PreferredAppGroupType = preferredAppGroupType; StartVmOnConnect = startVmOnConnect; + PublicNetworkAccess = publicNetworkAccess; AgentUpdate = agentUpdate; } @@ -99,6 +101,8 @@ internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resource public PreferredAppGroupType? PreferredAppGroupType { get; set; } /// The flag to turn on/off StartVMOnConnect feature. public bool? StartVmOnConnect { get; set; } + /// Enabled to allow this resource to be access from the public network. + public HostpoolPublicNetworkAccess? PublicNetworkAccess { get; set; } /// The session host configuration for updating agent, monitoring agent, and stack component. public SessionHostAgentUpdatePatchProperties AgentUpdate { get; set; } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostpoolPublicNetworkAccess.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostpoolPublicNetworkAccess.cs new file mode 100644 index 0000000000000..653c15b5ad998 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostpoolPublicNetworkAccess.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + public readonly partial struct HostpoolPublicNetworkAccess : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HostpoolPublicNetworkAccess(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + private const string EnabledForSessionHostsOnlyValue = "EnabledForSessionHostsOnly"; + private const string EnabledForClientsOnlyValue = "EnabledForClientsOnly"; + + /// Enabled. + public static HostpoolPublicNetworkAccess Enabled { get; } = new HostpoolPublicNetworkAccess(EnabledValue); + /// Disabled. + public static HostpoolPublicNetworkAccess Disabled { get; } = new HostpoolPublicNetworkAccess(DisabledValue); + /// EnabledForSessionHostsOnly. + public static HostpoolPublicNetworkAccess EnabledForSessionHostsOnly { get; } = new HostpoolPublicNetworkAccess(EnabledForSessionHostsOnlyValue); + /// EnabledForClientsOnly. + public static HostpoolPublicNetworkAccess EnabledForClientsOnly { get; } = new HostpoolPublicNetworkAccess(EnabledForClientsOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(HostpoolPublicNetworkAccess left, HostpoolPublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HostpoolPublicNetworkAccess left, HostpoolPublicNetworkAccess right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator HostpoolPublicNetworkAccess(string value) => new HostpoolPublicNetworkAccess(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HostpoolPublicNetworkAccess other && Equals(other); + /// + public bool Equals(HostpoolPublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.Serialization.cs new file mode 100644 index 0000000000000..d24678a9dea5d --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class PrivateEndpointConnectionListResultWithSystemData + { + internal static PrivateEndpointConnectionListResultWithSystemData DeserializePrivateEndpointConnectionListResultWithSystemData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new PrivateEndpointConnectionListResultWithSystemData(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.cs new file mode 100644 index 0000000000000..e1cfa77e10af3 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionListResultWithSystemData.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// List of private endpoint connection associated with the specified storage account. + internal partial class PrivateEndpointConnectionListResultWithSystemData + { + /// Initializes a new instance of PrivateEndpointConnectionListResultWithSystemData. + internal PrivateEndpointConnectionListResultWithSystemData() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of PrivateEndpointConnectionListResultWithSystemData. + /// Array of private endpoint connections. + /// Link to the next page of results. + internal PrivateEndpointConnectionListResultWithSystemData(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Array of private endpoint connections. + public IReadOnlyList Value { get; } + /// Link to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionWithSystemDataData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionWithSystemDataData.Serialization.cs new file mode 100644 index 0000000000000..557958d9c5dc0 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PrivateEndpointConnectionWithSystemDataData.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class PrivateEndpointConnectionWithSystemDataData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(ConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(ConnectionState); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static PrivateEndpointConnectionWithSystemDataData DeserializePrivateEndpointConnectionWithSystemDataData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional privateEndpoint = default; + Optional privateLinkServiceConnectionState = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("privateEndpoint"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = DesktopVirtualizationPrivateLinkServiceConnectionState.DeserializeDesktopVirtualizationPrivateLinkServiceConnectionState(property0.Value); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DesktopVirtualizationPrivateEndpointConnectionProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new PrivateEndpointConnectionWithSystemDataData(id, name, type, systemData.Value, privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicNetworkAccess.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 0000000000000..9a4de19074f30 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicNetworkAccess.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + public readonly partial struct PublicNetworkAccess : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PublicNetworkAccess(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static PublicNetworkAccess Enabled { get; } = new PublicNetworkAccess(EnabledValue); + /// Disabled. + public static PublicNetworkAccess Disabled { get; } = new PublicNetworkAccess(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PublicNetworkAccess left, PublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublicNetworkAccess left, PublicNetworkAccess right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PublicNetworkAccess(string value) => new PublicNetworkAccess(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublicNetworkAccess other && Equals(other); + /// + public bool Equals(PublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleData.Serialization.cs new file mode 100644 index 0000000000000..3dc215effdcf7 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleData.Serialization.cs @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class ScalingPlanPersonalScheduleData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DaysOfWeek)) + { + writer.WritePropertyName("daysOfWeek"u8); + writer.WriteStartArray(); + foreach (var item in DaysOfWeek) + { + writer.WriteStringValue(item.ToSerialString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RampUpStartTime)) + { + writer.WritePropertyName("rampUpStartTime"u8); + writer.WriteObjectValue(RampUpStartTime); + } + if (Optional.IsDefined(RampUpAutoStartHosts)) + { + writer.WritePropertyName("rampUpAutoStartHosts"u8); + writer.WriteStringValue(RampUpAutoStartHosts.Value.ToString()); + } + if (Optional.IsDefined(RampUpStartVmOnConnect)) + { + writer.WritePropertyName("rampUpStartVMOnConnect"u8); + writer.WriteStringValue(RampUpStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(RampUpActionOnDisconnect)) + { + writer.WritePropertyName("rampUpActionOnDisconnect"u8); + writer.WriteStringValue(RampUpActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(RampUpMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("rampUpMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(RampUpMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(RampUpActionOnLogoff)) + { + writer.WritePropertyName("rampUpActionOnLogoff"u8); + writer.WriteStringValue(RampUpActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(RampUpMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("rampUpMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(RampUpMinutesToWaitOnLogoff.Value); + } + if (Optional.IsDefined(PeakStartTime)) + { + writer.WritePropertyName("peakStartTime"u8); + writer.WriteObjectValue(PeakStartTime); + } + if (Optional.IsDefined(PeakStartVmOnConnect)) + { + writer.WritePropertyName("peakStartVMOnConnect"u8); + writer.WriteStringValue(PeakStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(PeakActionOnDisconnect)) + { + writer.WritePropertyName("peakActionOnDisconnect"u8); + writer.WriteStringValue(PeakActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(PeakMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("peakMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(PeakMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(PeakActionOnLogoff)) + { + writer.WritePropertyName("peakActionOnLogoff"u8); + writer.WriteStringValue(PeakActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(PeakMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("peakMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(PeakMinutesToWaitOnLogoff.Value); + } + if (Optional.IsDefined(RampDownStartTime)) + { + writer.WritePropertyName("rampDownStartTime"u8); + writer.WriteObjectValue(RampDownStartTime); + } + if (Optional.IsDefined(RampDownStartVmOnConnect)) + { + writer.WritePropertyName("rampDownStartVMOnConnect"u8); + writer.WriteStringValue(RampDownStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(RampDownActionOnDisconnect)) + { + writer.WritePropertyName("rampDownActionOnDisconnect"u8); + writer.WriteStringValue(RampDownActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(RampDownMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("rampDownMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(RampDownMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(RampDownActionOnLogoff)) + { + writer.WritePropertyName("rampDownActionOnLogoff"u8); + writer.WriteStringValue(RampDownActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(RampDownMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("rampDownMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(RampDownMinutesToWaitOnLogoff.Value); + } + if (Optional.IsDefined(OffPeakStartTime)) + { + writer.WritePropertyName("offPeakStartTime"u8); + writer.WriteObjectValue(OffPeakStartTime); + } + if (Optional.IsDefined(OffPeakStartVmOnConnect)) + { + writer.WritePropertyName("offPeakStartVMOnConnect"u8); + writer.WriteStringValue(OffPeakStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(OffPeakActionOnDisconnect)) + { + writer.WritePropertyName("offPeakActionOnDisconnect"u8); + writer.WriteStringValue(OffPeakActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(OffPeakMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("offPeakMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(OffPeakMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(OffPeakActionOnLogoff)) + { + writer.WritePropertyName("offPeakActionOnLogoff"u8); + writer.WriteStringValue(OffPeakActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(OffPeakMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("offPeakMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(OffPeakMinutesToWaitOnLogoff.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalScheduleData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional> daysOfWeek = default; + Optional rampUpStartTime = default; + Optional rampUpAutoStartHosts = default; + Optional rampUpStartVmOnConnect = default; + Optional rampUpActionOnDisconnect = default; + Optional rampUpMinutesToWaitOnDisconnect = default; + Optional rampUpActionOnLogoff = default; + Optional rampUpMinutesToWaitOnLogoff = default; + Optional peakStartTime = default; + Optional peakStartVmOnConnect = default; + Optional peakActionOnDisconnect = default; + Optional peakMinutesToWaitOnDisconnect = default; + Optional peakActionOnLogoff = default; + Optional peakMinutesToWaitOnLogoff = default; + Optional rampDownStartTime = default; + Optional rampDownStartVmOnConnect = default; + Optional rampDownActionOnDisconnect = default; + Optional rampDownMinutesToWaitOnDisconnect = default; + Optional rampDownActionOnLogoff = default; + Optional rampDownMinutesToWaitOnLogoff = default; + Optional offPeakStartTime = default; + Optional offPeakStartVmOnConnect = default; + Optional offPeakActionOnDisconnect = default; + Optional offPeakMinutesToWaitOnDisconnect = default; + Optional offPeakActionOnLogoff = default; + Optional offPeakMinutesToWaitOnLogoff = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("daysOfWeek"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString().ToDesktopVirtualizationDayOfWeek()); + } + daysOfWeek = array; + continue; + } + if (property0.NameEquals("rampUpStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value); + continue; + } + if (property0.NameEquals("rampUpAutoStartHosts"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpAutoStartHosts = new StartupBehavior(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampUpStartVMOnConnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpStartVmOnConnect = new SetStartVmOnConnect(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampUpActionOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpActionOnDisconnect = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampUpMinutesToWaitOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpMinutesToWaitOnDisconnect = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("rampUpActionOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpActionOnLogoff = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampUpMinutesToWaitOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampUpMinutesToWaitOnLogoff = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("peakStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peakStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value); + continue; + } + if (property0.NameEquals("peakStartVMOnConnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peakStartVmOnConnect = new SetStartVmOnConnect(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("peakActionOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peakActionOnDisconnect = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("peakMinutesToWaitOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peakMinutesToWaitOnDisconnect = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("peakActionOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peakActionOnLogoff = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("peakMinutesToWaitOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peakMinutesToWaitOnLogoff = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("rampDownStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampDownStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value); + continue; + } + if (property0.NameEquals("rampDownStartVMOnConnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampDownStartVmOnConnect = new SetStartVmOnConnect(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampDownActionOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampDownActionOnDisconnect = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampDownMinutesToWaitOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampDownMinutesToWaitOnDisconnect = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("rampDownActionOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampDownActionOnLogoff = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("rampDownMinutesToWaitOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rampDownMinutesToWaitOnLogoff = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("offPeakStartTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offPeakStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value); + continue; + } + if (property0.NameEquals("offPeakStartVMOnConnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offPeakStartVmOnConnect = new SetStartVmOnConnect(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("offPeakActionOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offPeakActionOnDisconnect = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("offPeakMinutesToWaitOnDisconnect"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offPeakMinutesToWaitOnDisconnect = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("offPeakActionOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offPeakActionOnLogoff = new SessionHandlingOperation(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("offPeakMinutesToWaitOnLogoff"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offPeakMinutesToWaitOnLogoff = property0.Value.GetInt32(); + continue; + } + } + continue; + } + } + return new ScalingPlanPersonalScheduleData(id, name, type, systemData.Value, Optional.ToList(daysOfWeek), rampUpStartTime.Value, Optional.ToNullable(rampUpAutoStartHosts), Optional.ToNullable(rampUpStartVmOnConnect), Optional.ToNullable(rampUpActionOnDisconnect), Optional.ToNullable(rampUpMinutesToWaitOnDisconnect), Optional.ToNullable(rampUpActionOnLogoff), Optional.ToNullable(rampUpMinutesToWaitOnLogoff), peakStartTime.Value, Optional.ToNullable(peakStartVmOnConnect), Optional.ToNullable(peakActionOnDisconnect), Optional.ToNullable(peakMinutesToWaitOnDisconnect), Optional.ToNullable(peakActionOnLogoff), Optional.ToNullable(peakMinutesToWaitOnLogoff), rampDownStartTime.Value, Optional.ToNullable(rampDownStartVmOnConnect), Optional.ToNullable(rampDownActionOnDisconnect), Optional.ToNullable(rampDownMinutesToWaitOnDisconnect), Optional.ToNullable(rampDownActionOnLogoff), Optional.ToNullable(rampDownMinutesToWaitOnLogoff), offPeakStartTime.Value, Optional.ToNullable(offPeakStartVmOnConnect), Optional.ToNullable(offPeakActionOnDisconnect), Optional.ToNullable(offPeakMinutesToWaitOnDisconnect), Optional.ToNullable(offPeakActionOnLogoff), Optional.ToNullable(offPeakMinutesToWaitOnLogoff)); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.Serialization.cs new file mode 100644 index 0000000000000..cb2149785a999 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class ScalingPlanPersonalScheduleList + { + internal static ScalingPlanPersonalScheduleList DeserializeScalingPlanPersonalScheduleList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ScalingPlanPersonalScheduleList(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.cs new file mode 100644 index 0000000000000..c0d41c9e7723b --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalScheduleList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// List of ScalingPlanPersonalSchedule definitions. + internal partial class ScalingPlanPersonalScheduleList + { + /// Initializes a new instance of ScalingPlanPersonalScheduleList. + internal ScalingPlanPersonalScheduleList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ScalingPlanPersonalScheduleList. + /// List of ScalingPlanPersonalSchedule definitions. + /// Link to the next page of results. + internal ScalingPlanPersonalScheduleList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// List of ScalingPlanPersonalSchedule definitions. + public IReadOnlyList Value { get; } + /// Link to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.Serialization.cs new file mode 100644 index 0000000000000..d6576b9726f04 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class ScalingPlanPersonalSchedulePatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DaysOfWeek)) + { + writer.WritePropertyName("daysOfWeek"u8); + writer.WriteStartArray(); + foreach (var item in DaysOfWeek) + { + writer.WriteStringValue(item.ToSerialString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RampUpStartTime)) + { + writer.WritePropertyName("rampUpStartTime"u8); + writer.WriteObjectValue(RampUpStartTime); + } + if (Optional.IsDefined(RampUpAutoStartHosts)) + { + writer.WritePropertyName("rampUpAutoStartHosts"u8); + writer.WriteStringValue(RampUpAutoStartHosts.Value.ToString()); + } + if (Optional.IsDefined(RampUpStartVmOnConnect)) + { + writer.WritePropertyName("rampUpStartVMOnConnect"u8); + writer.WriteStringValue(RampUpStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(RampUpActionOnDisconnect)) + { + writer.WritePropertyName("rampUpActionOnDisconnect"u8); + writer.WriteStringValue(RampUpActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(RampUpMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("rampUpMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(RampUpMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(RampUpActionOnLogoff)) + { + writer.WritePropertyName("rampUpActionOnLogoff"u8); + writer.WriteStringValue(RampUpActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(RampUpMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("rampUpMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(RampUpMinutesToWaitOnLogoff.Value); + } + if (Optional.IsDefined(PeakStartTime)) + { + writer.WritePropertyName("peakStartTime"u8); + writer.WriteObjectValue(PeakStartTime); + } + if (Optional.IsDefined(PeakStartVmOnConnect)) + { + writer.WritePropertyName("peakStartVMOnConnect"u8); + writer.WriteStringValue(PeakStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(PeakActionOnDisconnect)) + { + writer.WritePropertyName("peakActionOnDisconnect"u8); + writer.WriteStringValue(PeakActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(PeakMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("peakMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(PeakMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(PeakActionOnLogoff)) + { + writer.WritePropertyName("peakActionOnLogoff"u8); + writer.WriteStringValue(PeakActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(PeakMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("peakMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(PeakMinutesToWaitOnLogoff.Value); + } + if (Optional.IsDefined(RampDownStartTime)) + { + writer.WritePropertyName("rampDownStartTime"u8); + writer.WriteObjectValue(RampDownStartTime); + } + if (Optional.IsDefined(RampDownStartVmOnConnect)) + { + writer.WritePropertyName("rampDownStartVMOnConnect"u8); + writer.WriteStringValue(RampDownStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(RampDownActionOnDisconnect)) + { + writer.WritePropertyName("rampDownActionOnDisconnect"u8); + writer.WriteStringValue(RampDownActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(RampDownMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("rampDownMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(RampDownMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(RampDownActionOnLogoff)) + { + writer.WritePropertyName("rampDownActionOnLogoff"u8); + writer.WriteStringValue(RampDownActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(RampDownMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("rampDownMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(RampDownMinutesToWaitOnLogoff.Value); + } + if (Optional.IsDefined(OffPeakStartTime)) + { + writer.WritePropertyName("offPeakStartTime"u8); + writer.WriteObjectValue(OffPeakStartTime); + } + if (Optional.IsDefined(OffPeakStartVmOnConnect)) + { + writer.WritePropertyName("offPeakStartVMOnConnect"u8); + writer.WriteStringValue(OffPeakStartVmOnConnect.Value.ToString()); + } + if (Optional.IsDefined(OffPeakActionOnDisconnect)) + { + writer.WritePropertyName("offPeakActionOnDisconnect"u8); + writer.WriteStringValue(OffPeakActionOnDisconnect.Value.ToString()); + } + if (Optional.IsDefined(OffPeakMinutesToWaitOnDisconnect)) + { + writer.WritePropertyName("offPeakMinutesToWaitOnDisconnect"u8); + writer.WriteNumberValue(OffPeakMinutesToWaitOnDisconnect.Value); + } + if (Optional.IsDefined(OffPeakActionOnLogoff)) + { + writer.WritePropertyName("offPeakActionOnLogoff"u8); + writer.WriteStringValue(OffPeakActionOnLogoff.Value.ToString()); + } + if (Optional.IsDefined(OffPeakMinutesToWaitOnLogoff)) + { + writer.WritePropertyName("offPeakMinutesToWaitOnLogoff"u8); + writer.WriteNumberValue(OffPeakMinutesToWaitOnLogoff.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.cs new file mode 100644 index 0000000000000..86e415d6ec5ae --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPersonalSchedulePatch.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// ScalingPlanPersonalSchedule properties that can be patched. + public partial class ScalingPlanPersonalSchedulePatch + { + /// Initializes a new instance of ScalingPlanPersonalSchedulePatch. + public ScalingPlanPersonalSchedulePatch() + { + DaysOfWeek = new ChangeTrackingList(); + } + + /// Set of days of the week on which this schedule is active. + public IList DaysOfWeek { get; } + /// Starting time for ramp up period. + public ScalingActionTime RampUpStartTime { get; set; } + /// The desired startup behavior during the ramp up period for personal vms in the hostpool. + public StartupBehavior? RampUpAutoStartHosts { get; set; } + /// 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. + public SetStartVmOnConnect? RampUpStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the ramp up period. + public SessionHandlingOperation? RampUpActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp up period. + public int? RampUpMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the ramp up period. + public SessionHandlingOperation? RampUpActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the ramp up period. + public int? RampUpMinutesToWaitOnLogoff { get; set; } + /// Starting time for peak period. + public ScalingActionTime PeakStartTime { get; set; } + /// The desired configuration of Start VM On Connect for the hostpool during the peak phase. + public SetStartVmOnConnect? PeakStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the peak period. + public SessionHandlingOperation? PeakActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the peak period. + public int? PeakMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the peak period. + public SessionHandlingOperation? PeakActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the peak period. + public int? PeakMinutesToWaitOnLogoff { get; set; } + /// Starting time for ramp down period. + public ScalingActionTime RampDownStartTime { get; set; } + /// The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. + public SetStartVmOnConnect? RampDownStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the ramp down period. + public SessionHandlingOperation? RampDownActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp down period. + public int? RampDownMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the ramp down period. + public SessionHandlingOperation? RampDownActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the ramp down period. + public int? RampDownMinutesToWaitOnLogoff { get; set; } + /// Starting time for off-peak period. + public ScalingActionTime OffPeakStartTime { get; set; } + /// The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. + public SetStartVmOnConnect? OffPeakStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the off-peak period. + public SessionHandlingOperation? OffPeakActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the off-peak period. + public int? OffPeakMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the off-peak period. + public SessionHandlingOperation? OffPeakActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the off-peak period. + public int? OffPeakMinutesToWaitOnLogoff { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHandlingOperation.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHandlingOperation.cs new file mode 100644 index 0000000000000..908a63306c5fc --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHandlingOperation.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Action to be taken after a user disconnect during the ramp up period. + public readonly partial struct SessionHandlingOperation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SessionHandlingOperation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string DeallocateValue = "Deallocate"; + private const string HibernateValue = "Hibernate"; + + /// None. + public static SessionHandlingOperation None { get; } = new SessionHandlingOperation(NoneValue); + /// Deallocate. + public static SessionHandlingOperation Deallocate { get; } = new SessionHandlingOperation(DeallocateValue); + /// Hibernate. + public static SessionHandlingOperation Hibernate { get; } = new SessionHandlingOperation(HibernateValue); + /// Determines if two values are the same. + public static bool operator ==(SessionHandlingOperation left, SessionHandlingOperation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SessionHandlingOperation left, SessionHandlingOperation right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SessionHandlingOperation(string value) => new SessionHandlingOperation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SessionHandlingOperation other && Equals(other); + /// + public bool Equals(SessionHandlingOperation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostHealthCheckName.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostHealthCheckName.cs index d5d87b9c23ed0..d4b6866f557bb 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostHealthCheckName.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostHealthCheckName.cs @@ -34,27 +34,27 @@ public SessionHostHealthCheckName(string value) private const string MetaDataServiceCheckValue = "MetaDataServiceCheck"; private const string AppAttachHealthCheckValue = "AppAttachHealthCheck"; - /// Verifies the SessionHost is joined to a domain. If this check fails is classified as fatal as no connection can succeed if the SessionHost is not joined to the domain. + /// Verifies the SessionHost is joined to a domain. If this check fails is classified as fatal as no connection can succeed if the SessionHost is not joined to the domain. (Currently Enabled). public static SessionHostHealthCheckName DomainJoinedCheck { get; } = new SessionHostHealthCheckName(DomainJoinedCheckValue); - /// Verifies the SessionHost is not experiencing domain trust issues that will prevent authentication on SessionHost at connection time when session is created. If this check fails is classified as fatal as no connection can succeed if we cannot reach the domain for authentication on the SessionHost. + /// Verifies the SessionHost is not experiencing domain trust issues that will prevent authentication on SessionHost at connection time when session is created. If this check fails is classified as fatal as no connection can succeed if we cannot reach the domain for authentication on the SessionHost. (Currently Enabled). public static SessionHostHealthCheckName DomainTrustCheck { get; } = new SessionHostHealthCheckName(DomainTrustCheckValue); - /// Verifies the FSLogix service is up and running to make sure users' profiles are loaded in the session. If this check fails is classified as fatal as even if the connection can succeed, user experience is bad as the user profile cannot be loaded and user will get a temporary profile in the session. + /// Verifies the FSLogix service is up and running to make sure users' profiles are loaded in the session. If this check fails is classified as fatal as even if the connection can succeed, user experience is bad as the user profile cannot be loaded and user will get a temporary profile in the session. (Currently Disabled). public static SessionHostHealthCheckName FSLogixHealthCheck { get; } = new SessionHostHealthCheckName(FSLogixHealthCheckValue); - /// Verifies that the SxS stack is up and running so connections can succeed. If this check fails is classified as fatal as no connection can succeed if the SxS stack is not ready. + /// Verifies that the SxS stack is up and running so connections can succeed. If this check fails is classified as fatal as no connection can succeed if the SxS stack is not ready. (Currently Enabled). public static SessionHostHealthCheckName SxsStackListenerCheck { get; } = new SessionHostHealthCheckName(SxsStackListenerCheckValue); - /// Verifies that the required WVD service and Geneva URLs are reachable from the SessionHost. These URLs are: RdTokenUri, RdBrokerURI, RdDiagnosticsUri and storage blob URLs for agent monitoring (geneva). If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is unable to store warm path data (logs, operations ...). + /// Verifies that the required WVD service and Geneva URLs are reachable from the SessionHost. These URLs are: RdTokenUri, RdBrokerURI, RdDiagnosticsUri and storage blob URLs for agent monitoring (geneva). If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is unable to store warm path data (logs, operations ...). (Currently Disabled). public static SessionHostHealthCheckName UrlsAccessibleCheck { get; } = new SessionHostHealthCheckName(UrlsAccessibleCheckValue); - /// Verifies that the required Geneva agent is running. If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is missing or running (possibly) older version. + /// Verifies that the required Geneva agent is running. If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is missing or running (possibly) older version. (Currently Enabled). public static SessionHostHealthCheckName MonitoringAgentCheck { get; } = new SessionHostHealthCheckName(MonitoringAgentCheckValue); - /// Verifies the domain the SessionHost is joined to is still reachable. If this check fails is classified as fatal as no connection can succeed if the domain the SessionHost is joined is not reachable at the time of connection. + /// Verifies the domain the SessionHost is joined to is still reachable. If this check fails is classified as fatal as no connection can succeed if the domain the SessionHost is joined is not reachable at the time of connection. (Currently Disabled). public static SessionHostHealthCheckName DomainReachable { get; } = new SessionHostHealthCheckName(DomainReachableValue); - /// Verifies whether the WebRTCRedirector component is healthy. The WebRTCRedirector component is used to optimize video and audio performance in Microsoft Teams. This checks whether the component is still running, and whether there is a higher version available. If this check fails, it is non fatal and the machine still can service connections, main issue may be the WebRTCRedirector component has to be restarted or updated. + /// Verifies whether the WebRTCRedirector component is healthy. The WebRTCRedirector component is used to optimize video and audio performance in Microsoft Teams. This checks whether the component is still running, and whether there is a higher version available. If this check fails, it is non fatal and the machine still can service connections, main issue may be the WebRTCRedirector component has to be restarted or updated. (Currently Disabled). public static SessionHostHealthCheckName WebRtcRedirectorCheck { get; } = new SessionHostHealthCheckName(WebRtcRedirectorCheckValue); - /// Verifies the value of SecurityLayer registration key. If the value is 0 (SecurityLayer.RDP) this check fails with Error code = NativeMethodErrorCode.E_FAIL and is fatal. If the value is 1 (SecurityLayer.Negotiate) this check fails with Error code = NativeMethodErrorCode.ERROR_SUCCESS and is non fatal. + /// Verifies the value of SecurityLayer registration key. If the value is 0 (SecurityLayer.RDP) this check fails with Error code = NativeMethodErrorCode.E_FAIL and is fatal. If the value is 1 (SecurityLayer.Negotiate) this check fails with Error code = NativeMethodErrorCode.ERROR_SUCCESS and is non fatal. (Currently Disabled). public static SessionHostHealthCheckName SupportedEncryptionCheck { get; } = new SessionHostHealthCheckName(SupportedEncryptionCheckValue); - /// Verifies the metadata service is accessible and return compute properties. + /// Verifies the metadata service is accessible and return compute properties. (Currently Enabled). public static SessionHostHealthCheckName MetaDataServiceCheck { get; } = new SessionHostHealthCheckName(MetaDataServiceCheckValue); - /// Verifies that the AppAttachService is healthy (there were no issues during package staging). The AppAttachService is used to enable the staging/registration (and eventual deregistration/destaging) of MSIX apps that have been set up by the tenant admin. This checks whether the component had any failures during package staging. Failures in staging will prevent some MSIX apps from working properly for the end user. If this check fails, it is non fatal and the machine still can service connections, main issue may be certain apps will not work for end-users. + /// Verifies that the AppAttachService is healthy (there were no issues during package staging). The AppAttachService is used to enable the staging/registration (and eventual deregistration/destaging) of MSIX apps that have been set up by the tenant admin. This checks whether the component had any failures during package staging. Failures in staging will prevent some MSIX apps from working properly for the end user. If this check fails, it is non fatal and the machine still can service connections, main issue may be certain apps will not work for end-users. (Currently Enabled). public static SessionHostHealthCheckName AppAttachHealthCheck { get; } = new SessionHostHealthCheckName(AppAttachHealthCheckValue); /// Determines if two values are the same. public static bool operator ==(SessionHostHealthCheckName left, SessionHostHealthCheckName right) => left.Equals(right); diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SetStartVmOnConnect.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SetStartVmOnConnect.cs new file mode 100644 index 0000000000000..39e049fe7e732 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SetStartVmOnConnect.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// 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. + public readonly partial struct SetStartVmOnConnect : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SetStartVmOnConnect(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnableValue = "Enable"; + private const string DisableValue = "Disable"; + + /// Enable. + public static SetStartVmOnConnect Enable { get; } = new SetStartVmOnConnect(EnableValue); + /// Disable. + public static SetStartVmOnConnect Disable { get; } = new SetStartVmOnConnect(DisableValue); + /// Determines if two values are the same. + public static bool operator ==(SetStartVmOnConnect left, SetStartVmOnConnect right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SetStartVmOnConnect left, SetStartVmOnConnect right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SetStartVmOnConnect(string value) => new SetStartVmOnConnect(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SetStartVmOnConnect other && Equals(other); + /// + public bool Equals(SetStartVmOnConnect other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/StartupBehavior.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/StartupBehavior.cs new file mode 100644 index 0000000000000..50405ea7faa17 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/StartupBehavior.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The desired startup behavior during the ramp up period for personal vms in the hostpool. + public readonly partial struct StartupBehavior : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StartupBehavior(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string WithAssignedUserValue = "WithAssignedUser"; + private const string AllValue = "All"; + + /// Session hosts will not be started by the service. This setting depends on Start VM on Connect to be enabled to start the session hosts. + public static StartupBehavior None { get; } = new StartupBehavior(NoneValue); + /// Session hosts with an assigned user will be started during Ramp Up. + public static StartupBehavior WithAssignedUser { get; } = new StartupBehavior(WithAssignedUserValue); + /// All personal session hosts in the hostpool will be started during ramp up. + public static StartupBehavior All { get; } = new StartupBehavior(AllValue); + /// Determines if two values are the same. + public static bool operator ==(StartupBehavior left, StartupBehavior right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StartupBehavior left, StartupBehavior right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StartupBehavior(string value) => new StartupBehavior(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StartupBehavior other && Equals(other); + /// + public bool Equals(StartupBehavior other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupData.Serialization.cs index 49a75b47749d7..00987046809f7 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupData.Serialization.cs @@ -73,6 +73,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(HostPoolId); writer.WritePropertyName("applicationGroupType"u8); writer.WriteStringValue(ApplicationGroupType.ToString()); + if (Optional.IsDefined(ShowInFeed)) + { + writer.WritePropertyName("showInFeed"u8); + writer.WriteBooleanValue(ShowInFeed.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -102,6 +107,7 @@ internal static VirtualApplicationGroupData DeserializeVirtualApplicationGroupDa Optional workspaceArmPath = default; VirtualApplicationGroupType applicationGroupType = default; Optional cloudPCResource = default; + Optional showInFeed = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("managedBy"u8)) @@ -250,11 +256,20 @@ internal static VirtualApplicationGroupData DeserializeVirtualApplicationGroupDa cloudPCResource = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("showInFeed"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + showInFeed = property0.Value.GetBoolean(); + continue; + } } continue; } } - return new VirtualApplicationGroupData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, objectId.Value, description.Value, friendlyName.Value, hostPoolArmPath, workspaceArmPath.Value, applicationGroupType, Optional.ToNullable(cloudPCResource), managedBy.Value, kind.Value, Optional.ToNullable(etag), identity, sku.Value, plan); + return new VirtualApplicationGroupData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, objectId.Value, description.Value, friendlyName.Value, hostPoolArmPath, workspaceArmPath.Value, applicationGroupType, Optional.ToNullable(cloudPCResource), Optional.ToNullable(showInFeed), managedBy.Value, kind.Value, Optional.ToNullable(etag), identity, sku.Value, plan); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.Serialization.cs index 8a41a428133f8..08f50854b1a7b 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.Serialization.cs @@ -40,6 +40,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("friendlyName"u8); writer.WriteStringValue(FriendlyName); } + if (Optional.IsDefined(ShowInFeed)) + { + writer.WritePropertyName("showInFeed"u8); + writer.WriteBooleanValue(ShowInFeed.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -57,6 +62,7 @@ internal static VirtualApplicationGroupPatch DeserializeVirtualApplicationGroupP Optional systemData = default; Optional description = default; Optional friendlyName = default; + Optional showInFeed = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("tags"u8)) @@ -116,11 +122,20 @@ internal static VirtualApplicationGroupPatch DeserializeVirtualApplicationGroupP friendlyName = property0.Value.GetString(); continue; } + if (property0.NameEquals("showInFeed"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + showInFeed = property0.Value.GetBoolean(); + continue; + } } continue; } } - return new VirtualApplicationGroupPatch(id, name, type, systemData.Value, Optional.ToDictionary(tags), description.Value, friendlyName.Value); + return new VirtualApplicationGroupPatch(id, name, type, systemData.Value, Optional.ToDictionary(tags), description.Value, friendlyName.Value, Optional.ToNullable(showInFeed)); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.cs index 7aa879568e619..ded62a853f157 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualApplicationGroupPatch.cs @@ -28,11 +28,13 @@ public VirtualApplicationGroupPatch() /// tags to be updated. /// Description of ApplicationGroup. /// Friendly name of ApplicationGroup. - internal VirtualApplicationGroupPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string description, string friendlyName) : base(id, name, resourceType, systemData) + /// Boolean representing whether the applicationGroup is show in the feed. + internal VirtualApplicationGroupPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string description, string friendlyName, bool? showInFeed) : base(id, name, resourceType, systemData) { Tags = tags; Description = description; FriendlyName = friendlyName; + ShowInFeed = showInFeed; } /// tags to be updated. @@ -41,5 +43,7 @@ internal VirtualApplicationGroupPatch(ResourceIdentifier id, string name, Resour public string Description { get; set; } /// Friendly name of ApplicationGroup. public string FriendlyName { get; set; } + /// Boolean representing whether the applicationGroup is show in the feed. + public bool? ShowInFeed { get; set; } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspaceData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspaceData.Serialization.cs index 823eccc368cc8..001f19ce09138 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspaceData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspaceData.Serialization.cs @@ -79,6 +79,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -106,6 +111,8 @@ internal static VirtualWorkspaceData DeserializeVirtualWorkspaceData(JsonElement Optional friendlyName = default; Optional> applicationGroupReferences = default; Optional cloudPCResource = default; + Optional publicNetworkAccess = default; + Optional> privateEndpointConnections = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("managedBy"u8)) @@ -248,11 +255,34 @@ internal static VirtualWorkspaceData DeserializeVirtualWorkspaceData(JsonElement cloudPCResource = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DesktopVirtualizationPrivateEndpointConnection.DeserializeDesktopVirtualizationPrivateEndpointConnection(item)); + } + privateEndpointConnections = array; + continue; + } } continue; } } - return new VirtualWorkspaceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, objectId.Value, description.Value, friendlyName.Value, Optional.ToList(applicationGroupReferences), Optional.ToNullable(cloudPCResource), managedBy.Value, kind.Value, Optional.ToNullable(etag), identity, sku.Value, plan); + return new VirtualWorkspaceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, objectId.Value, description.Value, friendlyName.Value, Optional.ToList(applicationGroupReferences), Optional.ToNullable(cloudPCResource), Optional.ToNullable(publicNetworkAccess), Optional.ToList(privateEndpointConnections), managedBy.Value, kind.Value, Optional.ToNullable(etag), identity, sku.Value, plan); } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.Serialization.cs index 63d4b56b78a90..7b23fd5c9210a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.Serialization.cs @@ -48,6 +48,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.cs index 30e777995b43b..3c8302db222fe 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualWorkspacePatch.cs @@ -28,5 +28,7 @@ public VirtualWorkspacePatch() public string FriendlyName { get; set; } /// List of applicationGroup links. public IList ApplicationGroupReferences { get; } + /// Enabled to allow this resource to be access from the public network. + public PublicNetworkAccess? PublicNetworkAccess { get; set; } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/PrivateEndpointConnectionWithSystemDataData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/PrivateEndpointConnectionWithSystemDataData.cs new file mode 100644 index 0000000000000..dfacb05f3e3a9 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/PrivateEndpointConnectionWithSystemDataData.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing the PrivateEndpointConnectionWithSystemData data model. + /// The Private Endpoint Connection resource. + /// + public partial class PrivateEndpointConnectionWithSystemDataData : ResourceData + { + /// Initializes a new instance of PrivateEndpointConnectionWithSystemDataData. + public PrivateEndpointConnectionWithSystemDataData() + { + } + + /// Initializes a new instance of PrivateEndpointConnectionWithSystemDataData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + internal PrivateEndpointConnectionWithSystemDataData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubResource privateEndpoint, DesktopVirtualizationPrivateLinkServiceConnectionState connectionState, DesktopVirtualizationPrivateEndpointConnectionProvisioningState? provisioningState) : base(id, name, resourceType, systemData) + { + PrivateEndpoint = privateEndpoint; + ConnectionState = connectionState; + ProvisioningState = provisioningState; + } + + /// The resource of private end point. + internal SubResource PrivateEndpoint { get; set; } + /// Gets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + } + + /// A collection of information about the state of the connection between service consumer and provider. + public DesktopVirtualizationPrivateLinkServiceConnectionState ConnectionState { get; set; } + /// The provisioning state of the private endpoint connection resource. + public DesktopVirtualizationPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs index 7aa04688f715c..5c9f403e5eb3e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs @@ -33,7 +33,7 @@ public ApplicationGroupsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs index fbb00144abe62..c6144a1277480 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs @@ -33,7 +33,7 @@ public ApplicationsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs index 4f38f54cec732..6835cbbfc1832 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs @@ -33,7 +33,7 @@ public DesktopsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs index a685ba76203e5..3ef9157778653 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs @@ -33,7 +33,7 @@ public HostPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs index 15bb61890bc21..41752f65f03ea 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs @@ -33,7 +33,7 @@ public MsixImagesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs index 9d9f14f519cef..b3ce68faa305b 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs @@ -33,7 +33,7 @@ public MsixPackagesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs new file mode 100644 index 0000000000000..cbac877bd9b11 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -0,0 +1,886 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class PrivateEndpointConnectionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-07-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private endpoint connections. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private endpoint connections. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetByWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetByWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PrivateEndpointConnectionWithSystemDataData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PrivateEndpointConnectionWithSystemDataData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteByWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Remove a connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteByWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Remove a connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateByWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connection); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Approve or reject a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateByWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var message = CreateUpdateByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName, connection); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Approve or reject a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var message = CreateUpdateByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName, connection); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (isDescending != null) + { + uri.AppendQuery("isDescending", isDescending.Value, true); + } + if (initialSkip != null) + { + uri.AppendQuery("initialSkip", initialSkip.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private endpoint connections associated with hostpool. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private endpoint connections associated with hostpool. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PrivateEndpointConnectionWithSystemDataData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PrivateEndpointConnectionWithSystemDataData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Remove a connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Remove a connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(connection); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Approve or reject a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var message = CreateUpdateByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName, connection); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Approve or reject a private endpoint connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var message = CreateUpdateByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName, connection); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionWithSystemDataData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByWorkspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private endpoint connections. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWorkspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private endpoint connections. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWorkspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByHostPoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private endpoint connections associated with hostpool. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private endpoint connections associated with hostpool. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionListResultWithSystemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PrivateEndpointConnectionListResultWithSystemData.DeserializePrivateEndpointConnectionListResultWithSystemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs new file mode 100644 index 0000000000000..7171416342153 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class PrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-07-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (isDescending != null) + { + uri.AppendQuery("isDescending", isDescending.Value, true); + } + if (initialSkip != null) + { + uri.AppendQuery("initialSkip", initialSkip.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the private link resources available for this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the private link resources available for this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (isDescending != null) + { + uri.AppendQuery("isDescending", isDescending.Value, true); + } + if (initialSkip != null) + { + uri.AppendQuery("initialSkip", initialSkip.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the private link resources available for this hostpool. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the private link resources available for this hostpool. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByWorkspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the private link resources available for this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByWorkspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the private link resources available for this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the workspace. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByWorkspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListByWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByHostPoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the private link resources available for this hostpool. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the private link resources available for this hostpool. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DesktopVirtualizationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DesktopVirtualizationPrivateLinkResourceListResult.DeserializeDesktopVirtualizationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs new file mode 100644 index 0000000000000..f8bcb416be6cb --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs @@ -0,0 +1,569 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class ScalingPlanPersonalSchedulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ScalingPlanPersonalSchedulesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ScalingPlanPersonalSchedulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-07-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/scalingPlans/", false); + uri.AppendPath(scalingPlanName, true); + uri.AppendPath("/personalSchedules/", false); + uri.AppendPath(scalingPlanScheduleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ScalingPlanPersonalScheduleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ScalingPlanPersonalScheduleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, ScalingPlanPersonalScheduleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/scalingPlans/", false); + uri.AppendPath(scalingPlanName, true); + uri.AppendPath("/personalSchedules/", false); + uri.AppendPath(scalingPlanScheduleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, ScalingPlanPersonalScheduleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + ScalingPlanPersonalScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, ScalingPlanPersonalScheduleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + ScalingPlanPersonalScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/scalingPlans/", false); + uri.AppendPath(scalingPlanName, true); + uri.AppendPath("/personalSchedules/", false); + uri.AppendPath(scalingPlanScheduleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Remove a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Remove a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/scalingPlans/", false); + uri.AppendPath(scalingPlanName, true); + uri.AppendPath("/personalSchedules/", false); + uri.AppendPath(scalingPlanScheduleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a ScalingPlanPersonalSchedule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// The name of the ScalingPlanSchedule. + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName, ScalingPlanPersonalSchedulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string scalingPlanName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/scalingPlans/", false); + uri.AppendPath(scalingPlanName, true); + uri.AppendPath("/personalSchedules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + if (isDescending != null) + { + uri.AppendQuery("isDescending", isDescending.Value, true); + } + if (initialSkip != null) + { + uri.AppendQuery("initialSkip", initialSkip.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ScalingPlanPersonalSchedules. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string scalingPlanName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ScalingPlanPersonalScheduleList.DeserializeScalingPlanPersonalScheduleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ScalingPlanPersonalSchedules. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string scalingPlanName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ScalingPlanPersonalScheduleList.DeserializeScalingPlanPersonalScheduleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string scalingPlanName, int? pageSize, bool? isDescending, int? initialSkip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ScalingPlanPersonalSchedules. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string scalingPlanName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ScalingPlanPersonalScheduleList.DeserializeScalingPlanPersonalScheduleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ScalingPlanPersonalSchedules. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the scaling plan. + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string scalingPlanName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scalingPlanName, nameof(scalingPlanName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ScalingPlanPersonalScheduleList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ScalingPlanPersonalScheduleList.DeserializeScalingPlanPersonalScheduleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs index d7f3ee4cf8f33..1e8de49ad1b1d 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs @@ -33,7 +33,7 @@ public ScalingPlanPooledSchedulesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs index b59ba7d0696fc..0da518d7cd153 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs @@ -33,7 +33,7 @@ public ScalingPlansRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs index 60fd317829f32..b654efeb103e0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs @@ -33,7 +33,7 @@ public SessionHostsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs index d042adb1ad4ae..6f1ea2061ca66 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs @@ -33,7 +33,7 @@ public StartMenuItemsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs index 2c0e944ce1a2b..160bb2e069741 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs @@ -33,7 +33,7 @@ public UserSessionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs index e2eb8ea1d7570..bdb190a56913d 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs @@ -33,7 +33,7 @@ public WorkspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-09"; + _apiVersion = apiVersion ?? "2023-07-07-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs new file mode 100644 index 0000000000000..bc96777846d25 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetScalingPlanPersonalSchedules method from an instance of . + /// + public partial class ScalingPlanPersonalScheduleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _scalingPlanPersonalScheduleClientDiagnostics; + private readonly ScalingPlanPersonalSchedulesRestOperations _scalingPlanPersonalScheduleRestClient; + + /// Initializes a new instance of the class for mocking. + protected ScalingPlanPersonalScheduleCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ScalingPlanPersonalScheduleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _scalingPlanPersonalScheduleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ScalingPlanPersonalScheduleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ScalingPlanPersonalScheduleResource.ResourceType, out string scalingPlanPersonalScheduleApiVersion); + _scalingPlanPersonalScheduleRestClient = new ScalingPlanPersonalSchedulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scalingPlanPersonalScheduleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ScalingPlanResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ScalingPlanResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Create + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the ScalingPlanSchedule. + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string scalingPlanScheduleName, ScalingPlanPersonalScheduleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _scalingPlanPersonalScheduleRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scalingPlanScheduleName, data, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Create + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the ScalingPlanSchedule. + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string scalingPlanScheduleName, ScalingPlanPersonalScheduleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _scalingPlanPersonalScheduleRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scalingPlanScheduleName, data, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleCollection.Get"); + scope.Start(); + try + { + var response = await _scalingPlanPersonalScheduleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scalingPlanScheduleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleCollection.Get"); + scope.Start(); + try + { + var response = _scalingPlanPersonalScheduleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scalingPlanScheduleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ScalingPlanPersonalSchedules. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_List + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _scalingPlanPersonalScheduleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scalingPlanPersonalScheduleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScalingPlanPersonalScheduleResource(Client, ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(e)), _scalingPlanPersonalScheduleClientDiagnostics, Pipeline, "ScalingPlanPersonalScheduleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ScalingPlanPersonalSchedules. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_List + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _scalingPlanPersonalScheduleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scalingPlanPersonalScheduleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScalingPlanPersonalScheduleResource(Client, ScalingPlanPersonalScheduleData.DeserializeScalingPlanPersonalScheduleData(e)), _scalingPlanPersonalScheduleClientDiagnostics, Pipeline, "ScalingPlanPersonalScheduleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleCollection.Exists"); + scope.Start(); + try + { + var response = await _scalingPlanPersonalScheduleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scalingPlanScheduleName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(scalingPlanScheduleName, nameof(scalingPlanScheduleName)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleCollection.Exists"); + scope.Start(); + try + { + var response = _scalingPlanPersonalScheduleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scalingPlanScheduleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs new file mode 100644 index 0000000000000..9604dd5aa95ac --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing the ScalingPlanPersonalSchedule data model. + /// Represents a ScalingPlanPersonalSchedule definition. + /// + public partial class ScalingPlanPersonalScheduleData : ResourceData + { + /// Initializes a new instance of ScalingPlanPersonalScheduleData. + public ScalingPlanPersonalScheduleData() + { + DaysOfWeek = new ChangeTrackingList(); + } + + /// Initializes a new instance of ScalingPlanPersonalScheduleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Set of days of the week on which this schedule is active. + /// Starting time for ramp up period. + /// The desired startup behavior during the ramp up period for personal vms in the hostpool. + /// 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. + /// Action to be taken after a user disconnect during the ramp up period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp up period. + /// Action to be taken after a logoff 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. + /// Starting time for peak period. + /// The desired configuration of Start VM On Connect for the hostpool during the peak phase. + /// Action to be taken after a user disconnect during the peak period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the peak period. + /// Action to be taken after a logoff 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. + /// Starting time for ramp down period. + /// The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. + /// Action to be taken after a user disconnect during the ramp down period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp down period. + /// Action to be taken after a logoff 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. + /// Starting time for off-peak period. + /// The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. + /// Action to be taken after a user disconnect during the off-peak period. + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the off-peak period. + /// Action to be taken after a logoff 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. + internal ScalingPlanPersonalScheduleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList daysOfWeek, ScalingActionTime rampUpStartTime, StartupBehavior? rampUpAutoStartHosts, SetStartVmOnConnect? rampUpStartVmOnConnect, SessionHandlingOperation? rampUpActionOnDisconnect, int? rampUpMinutesToWaitOnDisconnect, SessionHandlingOperation? rampUpActionOnLogoff, int? rampUpMinutesToWaitOnLogoff, ScalingActionTime peakStartTime, SetStartVmOnConnect? peakStartVmOnConnect, SessionHandlingOperation? peakActionOnDisconnect, int? peakMinutesToWaitOnDisconnect, SessionHandlingOperation? peakActionOnLogoff, int? peakMinutesToWaitOnLogoff, ScalingActionTime rampDownStartTime, SetStartVmOnConnect? rampDownStartVmOnConnect, SessionHandlingOperation? rampDownActionOnDisconnect, int? rampDownMinutesToWaitOnDisconnect, SessionHandlingOperation? rampDownActionOnLogoff, int? rampDownMinutesToWaitOnLogoff, ScalingActionTime offPeakStartTime, SetStartVmOnConnect? offPeakStartVmOnConnect, SessionHandlingOperation? offPeakActionOnDisconnect, int? offPeakMinutesToWaitOnDisconnect, SessionHandlingOperation? offPeakActionOnLogoff, int? offPeakMinutesToWaitOnLogoff) : base(id, name, resourceType, systemData) + { + DaysOfWeek = daysOfWeek; + RampUpStartTime = rampUpStartTime; + RampUpAutoStartHosts = rampUpAutoStartHosts; + RampUpStartVmOnConnect = rampUpStartVmOnConnect; + RampUpActionOnDisconnect = rampUpActionOnDisconnect; + RampUpMinutesToWaitOnDisconnect = rampUpMinutesToWaitOnDisconnect; + RampUpActionOnLogoff = rampUpActionOnLogoff; + RampUpMinutesToWaitOnLogoff = rampUpMinutesToWaitOnLogoff; + PeakStartTime = peakStartTime; + PeakStartVmOnConnect = peakStartVmOnConnect; + PeakActionOnDisconnect = peakActionOnDisconnect; + PeakMinutesToWaitOnDisconnect = peakMinutesToWaitOnDisconnect; + PeakActionOnLogoff = peakActionOnLogoff; + PeakMinutesToWaitOnLogoff = peakMinutesToWaitOnLogoff; + RampDownStartTime = rampDownStartTime; + RampDownStartVmOnConnect = rampDownStartVmOnConnect; + RampDownActionOnDisconnect = rampDownActionOnDisconnect; + RampDownMinutesToWaitOnDisconnect = rampDownMinutesToWaitOnDisconnect; + RampDownActionOnLogoff = rampDownActionOnLogoff; + RampDownMinutesToWaitOnLogoff = rampDownMinutesToWaitOnLogoff; + OffPeakStartTime = offPeakStartTime; + OffPeakStartVmOnConnect = offPeakStartVmOnConnect; + OffPeakActionOnDisconnect = offPeakActionOnDisconnect; + OffPeakMinutesToWaitOnDisconnect = offPeakMinutesToWaitOnDisconnect; + OffPeakActionOnLogoff = offPeakActionOnLogoff; + OffPeakMinutesToWaitOnLogoff = offPeakMinutesToWaitOnLogoff; + } + + /// Set of days of the week on which this schedule is active. + public IList DaysOfWeek { get; } + /// Starting time for ramp up period. + public ScalingActionTime RampUpStartTime { get; set; } + /// The desired startup behavior during the ramp up period for personal vms in the hostpool. + public StartupBehavior? RampUpAutoStartHosts { get; set; } + /// 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. + public SetStartVmOnConnect? RampUpStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the ramp up period. + public SessionHandlingOperation? RampUpActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp up period. + public int? RampUpMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the ramp up period. + public SessionHandlingOperation? RampUpActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the ramp up period. + public int? RampUpMinutesToWaitOnLogoff { get; set; } + /// Starting time for peak period. + public ScalingActionTime PeakStartTime { get; set; } + /// The desired configuration of Start VM On Connect for the hostpool during the peak phase. + public SetStartVmOnConnect? PeakStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the peak period. + public SessionHandlingOperation? PeakActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the peak period. + public int? PeakMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the peak period. + public SessionHandlingOperation? PeakActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the peak period. + public int? PeakMinutesToWaitOnLogoff { get; set; } + /// Starting time for ramp down period. + public ScalingActionTime RampDownStartTime { get; set; } + /// The desired configuration of Start VM On Connect for the hostpool during the ramp down phase. + public SetStartVmOnConnect? RampDownStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the ramp down period. + public SessionHandlingOperation? RampDownActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the ramp down period. + public int? RampDownMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the ramp down period. + public SessionHandlingOperation? RampDownActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the ramp down period. + public int? RampDownMinutesToWaitOnLogoff { get; set; } + /// Starting time for off-peak period. + public ScalingActionTime OffPeakStartTime { get; set; } + /// The desired configuration of Start VM On Connect for the hostpool during the off-peak phase. + public SetStartVmOnConnect? OffPeakStartVmOnConnect { get; set; } + /// Action to be taken after a user disconnect during the off-peak period. + public SessionHandlingOperation? OffPeakActionOnDisconnect { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user disconnects during the off-peak period. + public int? OffPeakMinutesToWaitOnDisconnect { get; set; } + /// Action to be taken after a logoff during the off-peak period. + public SessionHandlingOperation? OffPeakActionOnLogoff { get; set; } + /// The time in minutes to wait before performing the desired session handling action when a user logs off during the off-peak period. + public int? OffPeakMinutesToWaitOnLogoff { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs new file mode 100644 index 0000000000000..b7744b9c2addd --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A Class representing a ScalingPlanPersonalSchedule along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetScalingPlanPersonalScheduleResource method. + /// Otherwise you can get one from its parent resource using the GetScalingPlanPersonalSchedule method. + /// + public partial class ScalingPlanPersonalScheduleResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scalingPlanName, string scalingPlanScheduleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _scalingPlanPersonalScheduleClientDiagnostics; + private readonly ScalingPlanPersonalSchedulesRestOperations _scalingPlanPersonalScheduleRestClient; + private readonly ScalingPlanPersonalScheduleData _data; + + /// Initializes a new instance of the class for mocking. + protected ScalingPlanPersonalScheduleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ScalingPlanPersonalScheduleResource(ArmClient client, ScalingPlanPersonalScheduleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ScalingPlanPersonalScheduleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _scalingPlanPersonalScheduleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string scalingPlanPersonalScheduleApiVersion); + _scalingPlanPersonalScheduleRestClient = new ScalingPlanPersonalSchedulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, scalingPlanPersonalScheduleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DesktopVirtualization/scalingPlans/personalSchedules"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ScalingPlanPersonalScheduleData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleResource.Get"); + scope.Start(); + try + { + var response = await _scalingPlanPersonalScheduleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleResource.Get"); + scope.Start(); + try + { + var response = _scalingPlanPersonalScheduleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleResource.Delete"); + scope.Start(); + try + { + var response = await _scalingPlanPersonalScheduleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleResource.Delete"); + scope.Start(); + try + { + var response = _scalingPlanPersonalScheduleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Update + /// + /// + /// + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ScalingPlanPersonalSchedulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleResource.Update"); + scope.Start(); + try + { + var response = await _scalingPlanPersonalScheduleRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Update + /// + /// + /// + /// Object containing ScalingPlanPersonalSchedule definitions. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ScalingPlanPersonalSchedulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _scalingPlanPersonalScheduleClientDiagnostics.CreateScope("ScalingPlanPersonalScheduleResource.Update"); + scope.Start(); + try + { + var response = _scalingPlanPersonalScheduleRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new ScalingPlanPersonalScheduleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs index 9aca0601777d6..de48d530e1552 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs @@ -142,6 +142,59 @@ public virtual Response GetScalingPlanPooledS return GetScalingPlanPooledSchedules().Get(scalingPlanScheduleName, cancellationToken); } + /// Gets a collection of ScalingPlanPersonalScheduleResources in the ScalingPlan. + /// An object representing collection of ScalingPlanPersonalScheduleResources and their operations over a ScalingPlanPersonalScheduleResource. + public virtual ScalingPlanPersonalScheduleCollection GetScalingPlanPersonalSchedules() + { + return GetCachedClient(Client => new ScalingPlanPersonalScheduleCollection(Client, Id)); + } + + /// + /// Get a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetScalingPlanPersonalScheduleAsync(string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + return await GetScalingPlanPersonalSchedules().GetAsync(scalingPlanScheduleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ScalingPlanPersonalSchedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName} + /// + /// + /// Operation Id + /// ScalingPlanPersonalSchedules_Get + /// + /// + /// + /// The name of the ScalingPlanSchedule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetScalingPlanPersonalSchedule(string scalingPlanScheduleName, CancellationToken cancellationToken = default) + { + return GetScalingPlanPersonalSchedules().Get(scalingPlanScheduleName, cancellationToken); + } + /// /// Get a scaling plan. /// diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs index 32d9b9468561c..711f7eb4edacc 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs @@ -47,13 +47,14 @@ public VirtualApplicationGroupData(AzureLocation location, ResourceIdentifier ho /// Workspace arm path of ApplicationGroup. /// Resource Type of ApplicationGroup. /// Is cloud pc resource. + /// Boolean representing whether the applicationGroup is show in the feed. /// 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. /// 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. /// 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. /// Gets or sets the identity. Current supported identity types: SystemAssigned. /// The resource model definition representing SKU. /// Gets or sets the plan. - internal VirtualApplicationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, ResourceIdentifier hostPoolId, ResourceIdentifier workspaceId, VirtualApplicationGroupType applicationGroupType, bool? isCloudPCResource, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) : base(id, name, resourceType, systemData, tags, location) + internal VirtualApplicationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, ResourceIdentifier hostPoolId, ResourceIdentifier workspaceId, VirtualApplicationGroupType applicationGroupType, bool? isCloudPCResource, bool? showInFeed, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) : base(id, name, resourceType, systemData, tags, location) { ObjectId = objectId; Description = description; @@ -62,6 +63,7 @@ internal VirtualApplicationGroupData(ResourceIdentifier id, string name, Resourc WorkspaceId = workspaceId; ApplicationGroupType = applicationGroupType; IsCloudPCResource = isCloudPCResource; + ShowInFeed = showInFeed; ManagedBy = managedBy; Kind = kind; ETag = etag; @@ -84,6 +86,8 @@ internal VirtualApplicationGroupData(ResourceIdentifier id, string name, Resourc public VirtualApplicationGroupType ApplicationGroupType { get; set; } /// Is cloud pc resource. public bool? IsCloudPCResource { get; } + /// Boolean representing whether the applicationGroup is show in the feed. + public bool? ShowInFeed { get; set; } /// 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. public ResourceIdentifier ManagedBy { get; set; } /// 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. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs index ca5b87c82b965..63f3f227d7ae6 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs @@ -24,6 +24,7 @@ public partial class VirtualWorkspaceData : TrackedResourceData public VirtualWorkspaceData(AzureLocation location) : base(location) { ApplicationGroupReferences = new ChangeTrackingList(); + PrivateEndpointConnections = new ChangeTrackingList(); } /// Initializes a new instance of VirtualWorkspaceData. @@ -38,19 +39,23 @@ public VirtualWorkspaceData(AzureLocation location) : base(location) /// Friendly name of Workspace. /// List of applicationGroup resource Ids. /// Is cloud pc resource. + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + /// List of private endpoint connection associated with the specified 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. /// 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. /// 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. /// Gets or sets the identity. Current supported identity types: SystemAssigned. /// The resource model definition representing SKU. /// Gets or sets the plan. - internal VirtualWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, IList applicationGroupReferences, bool? isCloudPCResource, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) : base(id, name, resourceType, systemData, tags, location) + internal VirtualWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, IList applicationGroupReferences, bool? isCloudPCResource, PublicNetworkAccess? publicNetworkAccess, IReadOnlyList privateEndpointConnections, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) : base(id, name, resourceType, systemData, tags, location) { ObjectId = objectId; Description = description; FriendlyName = friendlyName; ApplicationGroupReferences = applicationGroupReferences; IsCloudPCResource = isCloudPCResource; + PublicNetworkAccess = publicNetworkAccess; + PrivateEndpointConnections = privateEndpointConnections; ManagedBy = managedBy; Kind = kind; ETag = etag; @@ -69,6 +74,10 @@ internal VirtualWorkspaceData(ResourceIdentifier id, string name, ResourceType r public IList ApplicationGroupReferences { get; } /// Is cloud pc resource. public bool? IsCloudPCResource { get; } + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + public PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// List of private endpoint connection associated with the specified resource. + public IReadOnlyList PrivateEndpointConnections { get; } /// 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. public ResourceIdentifier ManagedBy { get; set; } /// 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. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs index c595d27c85775..d2eec6b0896cb 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs @@ -36,6 +36,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _virtualWorkspaceWorkspacesClientDiagnostics; private readonly WorkspacesRestOperations _virtualWorkspaceWorkspacesRestClient; + private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly VirtualWorkspaceData _data; /// Initializes a new instance of the class for mocking. @@ -60,6 +62,8 @@ internal VirtualWorkspaceResource(ArmClient client, ResourceIdentifier id) : bas _virtualWorkspaceWorkspacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string virtualWorkspaceWorkspacesApiVersion); _virtualWorkspaceWorkspacesRestClient = new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, virtualWorkspaceWorkspacesApiVersion); + _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -89,6 +93,59 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of WorkspacePrivateEndpointConnectionResources in the VirtualWorkspace. + /// An object representing collection of WorkspacePrivateEndpointConnectionResources and their operations over a WorkspacePrivateEndpointConnectionResource. + public virtual WorkspacePrivateEndpointConnectionCollection GetWorkspacePrivateEndpointConnections() + { + return GetCachedClient(Client => new WorkspacePrivateEndpointConnectionCollection(Client, Id)); + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetWorkspacePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetWorkspacePrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetWorkspacePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetWorkspacePrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + /// /// Get a workspace. /// @@ -289,6 +346,56 @@ public virtual Response Update(VirtualWorkspacePatch p } } + /// + /// List the private link resources available for this workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResources_ListByWorkspace + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPrivateLinkResourcesAsync(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _privateLinkResourcesRestClient.CreateListByWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DesktopVirtualizationPrivateLinkResource.DeserializeDesktopVirtualizationPrivateLinkResource, _privateLinkResourcesClientDiagnostics, Pipeline, "VirtualWorkspaceResource.GetPrivateLinkResources", "value", "nextLink", cancellationToken); + } + + /// + /// List the private link resources available for this workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResources_ListByWorkspace + /// + /// + /// + /// Number of items per page. + /// Indicates whether the collection is descending. + /// Initial number of items to skip. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPrivateLinkResources(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _privateLinkResourcesRestClient.CreateListByWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DesktopVirtualizationPrivateLinkResource.DeserializeDesktopVirtualizationPrivateLinkResource, _privateLinkResourcesClientDiagnostics, Pipeline, "VirtualWorkspaceResource.GetPrivateLinkResources", "value", "nextLink", cancellationToken); + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs new file mode 100644 index 0000000000000..0592e416e6600 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspacePrivateEndpointConnections method from an instance of . + /// + public partial class WorkspacePrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspacePrivateEndpointConnectionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspacePrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", WorkspacePrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspacePrivateEndpointConnectionResource.ResourceType, out string workspacePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspacePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != VirtualWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, VirtualWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByWorkspace + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByWorkspaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, connection, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByWorkspace + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the private endpoint connection associated with the Azure resource. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByWorkspace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, connection, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByWorkspaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByWorkspace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List private endpoint connections. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnections_ListByWorkspace + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspacePrivateEndpointConnectionResource(Client, PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(e)), _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "WorkspacePrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List private endpoint connections. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnections_ListByWorkspace + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspacePrivateEndpointConnectionResource(Client, PrivateEndpointConnectionWithSystemDataData.DeserializePrivateEndpointConnectionWithSystemDataData(e)), _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "WorkspacePrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByWorkspaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByWorkspace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs new file mode 100644 index 0000000000000..5ee5f2651fe4a --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A Class representing a WorkspacePrivateEndpointConnection along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspacePrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspacePrivateEndpointConnection method. + /// + public partial class WorkspacePrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly PrivateEndpointConnectionWithSystemDataData _data; + + /// Initializes a new instance of the class for mocking. + protected WorkspacePrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspacePrivateEndpointConnectionResource(ArmClient client, PrivateEndpointConnectionWithSystemDataData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspacePrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspacePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspacePrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DesktopVirtualization/workspaces/privateEndpointConnections"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual PrivateEndpointConnectionWithSystemDataData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByWorkspaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_GetByWorkspace + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetByWorkspace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove a connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_DeleteByWorkspace + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteByWorkspaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove a connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_DeleteByWorkspace + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteByWorkspace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByWorkspace + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByWorkspaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connection, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Approve or reject a private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_UpdateByWorkspace + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing the updated connection. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DesktopVirtualizationPrivateEndpointConnection connection, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connection, nameof(connection)); + + using var scope = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("WorkspacePrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _workspacePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateByWorkspace(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connection, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new WorkspacePrivateEndpointConnectionResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md index e1e8fcf05cfbc..7902315ea2b91 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: true csharp: true library-name: DesktopVirtualization namespace: Azure.ResourceManager.DesktopVirtualization -require: https://github.com/Azure/azure-rest-api-specs/blob/45765fbbfd14084eb7a12ebd099aaeddb2a13173/specification/desktopvirtualization/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/readme.md # tag: package-2022-09 output-folder: $(this-folder)/Generated clear-output-folder: true