From fcc7a67d3597a26f5783bb5222a6b2bf8276269e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 11 Sep 2023 17:43:15 +0000 Subject: [PATCH] CodeGen from PR 25747 in Azure/azure-rest-api-specs Merge c6a8187b53614e3b633684b4fb2ede2f657ba8aa into c78b5d8bd3aff2d82a5f034d9164b1a9ac030e09 --- ...er.DesktopVirtualization.netstandard2.0.cs | 346 ++++++- .../Samples/Sample_HostPoolCollection.cs | 8 +- ...PoolPrivateEndpointConnectionCollection.cs | 169 ++++ ...stPoolPrivateEndpointConnectionResource.cs | 123 +++ .../Samples/Sample_HostPoolResource.cs | 46 +- .../Samples/Sample_MsixPackageCollection.cs | 8 +- .../Samples/Sample_MsixPackageResource.cs | 6 +- .../Samples/Sample_ScalingPlanCollection.cs | 8 +- ...e_ScalingPlanPersonalScheduleCollection.cs | 195 ++++ ...ple_ScalingPlanPersonalScheduleResource.cs | 132 +++ ...ple_ScalingPlanPooledScheduleCollection.cs | 8 +- ...ample_ScalingPlanPooledScheduleResource.cs | 6 +- .../Samples/Sample_ScalingPlanResource.cs | 8 +- .../Samples/Sample_SessionHostCollection.cs | 6 +- .../Samples/Sample_SessionHostResource.cs | 6 +- .../Samples/Sample_UserSessionCollection.cs | 6 +- .../Samples/Sample_UserSessionResource.cs | 8 +- .../Sample_VirtualApplicationCollection.cs | 8 +- ...ample_VirtualApplicationGroupCollection.cs | 9 +- .../Sample_VirtualApplicationGroupResource.cs | 11 +- .../Sample_VirtualApplicationResource.cs | 6 +- .../Sample_VirtualDesktopCollection.cs | 6 +- .../Samples/Sample_VirtualDesktopResource.cs | 4 +- .../Sample_VirtualWorkspaceCollection.cs | 8 +- .../Sample_VirtualWorkspaceResource.cs | 38 +- ...pacePrivateEndpointConnectionCollection.cs | 169 ++++ ...kspacePrivateEndpointConnectionResource.cs | 123 +++ .../ArmDesktopVirtualizationModelFactory.cs | 113 ++- .../DesktopVirtualizationExtensions.cs | 57 ++ .../src/Generated/HostPoolData.cs | 11 +- ...PoolPrivateEndpointConnectionCollection.cs | 348 +++++++ ...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 | 347 +++++++ .../ScalingPlanPersonalScheduleData.cs | 141 +++ .../ScalingPlanPersonalScheduleResource.cs | 290 ++++++ .../src/Generated/ScalingPlanResource.cs | 53 ++ .../Generated/VirtualApplicationGroupData.cs | 6 +- .../src/Generated/VirtualWorkspaceData.cs | 11 +- .../src/Generated/VirtualWorkspaceResource.cs | 108 +++ ...pacePrivateEndpointConnectionCollection.cs | 342 +++++++ ...kspacePrivateEndpointConnectionResource.cs | 298 ++++++ .../src/autorest.md | 2 +- 92 files changed, 7878 insertions(+), 125 deletions(-) create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs create mode 100644 sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs 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 586b7a3fa31f..a80b720b95b7 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/samples/Generated/Samples/Sample_HostPoolCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs index c4d474e3b61c..ffbc560fb88d 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_HostPoolCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_HostPoolGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_HostPoolGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_HostPoolCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Create.json // this example is just showing the usage of "HostPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task CreateOrUpdate_HostPoolCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_HostPoolListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_ListByResourceGroup.json // this example is just showing the usage of "HostPools_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..1d227b404784 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_HostPoolPrivateEndpointConnectionCollection + { + // PrivateEndpointConnection_ListByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_PrivateEndpointConnectionListByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_ListByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolResource created on azure + // for more information of creating HostPoolResource, please refer to the document of HostPoolResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier hostPoolResourceId = HostPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + HostPoolResource hostPool = client.GetHostPoolResource(hostPoolResourceId); + + // get the collection of this HostPoolPrivateEndpointConnectionResource + HostPoolPrivateEndpointConnectionCollection collection = hostPool.GetHostPoolPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (HostPoolPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // PrivateEndpointConnection_GetByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionGetByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolResource created on azure + // for more information of creating HostPoolResource, please refer to the document of HostPoolResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier hostPoolResourceId = HostPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + HostPoolResource hostPool = client.GetHostPoolResource(hostPoolResourceId); + + // get the collection of this HostPoolPrivateEndpointConnectionResource + HostPoolPrivateEndpointConnectionCollection collection = hostPool.GetHostPoolPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + HostPoolPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnection_GetByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_PrivateEndpointConnectionGetByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolResource created on azure + // for more information of creating HostPoolResource, please refer to the document of HostPoolResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier hostPoolResourceId = HostPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + HostPoolResource hostPool = client.GetHostPoolResource(hostPoolResourceId); + + // get the collection of this HostPoolPrivateEndpointConnectionResource + HostPoolPrivateEndpointConnectionCollection collection = hostPool.GetHostPoolPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // PrivateEndpointConnection_UpdateByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_PrivateEndpointConnectionUpdateByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_UpdateByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolResource created on azure + // for more information of creating HostPoolResource, please refer to the document of HostPoolResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier hostPoolResourceId = HostPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + HostPoolResource hostPool = client.GetHostPoolResource(hostPoolResourceId); + + // get the collection of this HostPoolPrivateEndpointConnectionResource + HostPoolPrivateEndpointConnectionCollection collection = hostPool.GetHostPoolPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + DesktopVirtualizationPrivateEndpointConnection connection = new DesktopVirtualizationPrivateEndpointConnection() + { + ConnectionState = new DesktopVirtualizationPrivateLinkServiceConnectionState() + { + Status = DesktopVirtualizationPrivateEndpointServiceConnectionStatus.Approved, + Description = "Approved by admin@consoto.com", + ActionsRequired = "None", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, connection); + HostPoolPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..3a9db44aaa80 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_HostPoolPrivateEndpointConnectionResource + { + // PrivateEndpointConnection_GetByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionGetByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolPrivateEndpointConnectionResource created on azure + // for more information of creating HostPoolPrivateEndpointConnectionResource, please refer to the document of HostPoolPrivateEndpointConnectionResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + ResourceIdentifier hostPoolPrivateEndpointConnectionResourceId = HostPoolPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + HostPoolPrivateEndpointConnectionResource hostPoolPrivateEndpointConnection = client.GetHostPoolPrivateEndpointConnectionResource(hostPoolPrivateEndpointConnectionResourceId); + + // invoke the operation + HostPoolPrivateEndpointConnectionResource result = await hostPoolPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnection_DeleteByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_PrivateEndpointConnectionDeleteByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_DeleteByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolPrivateEndpointConnectionResource created on azure + // for more information of creating HostPoolPrivateEndpointConnectionResource, please refer to the document of HostPoolPrivateEndpointConnectionResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + ResourceIdentifier hostPoolPrivateEndpointConnectionResourceId = HostPoolPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + HostPoolPrivateEndpointConnectionResource hostPoolPrivateEndpointConnection = client.GetHostPoolPrivateEndpointConnectionResource(hostPoolPrivateEndpointConnectionResourceId); + + // invoke the operation + await hostPoolPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // PrivateEndpointConnection_UpdateByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_PrivateEndpointConnectionUpdateByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByHostPool.json + // this example is just showing the usage of "PrivateEndpointConnections_UpdateByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolPrivateEndpointConnectionResource created on azure + // for more information of creating HostPoolPrivateEndpointConnectionResource, please refer to the document of HostPoolPrivateEndpointConnectionResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + string privateEndpointConnectionName = "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + ResourceIdentifier hostPoolPrivateEndpointConnectionResourceId = HostPoolPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName, privateEndpointConnectionName); + HostPoolPrivateEndpointConnectionResource hostPoolPrivateEndpointConnection = client.GetHostPoolPrivateEndpointConnectionResource(hostPoolPrivateEndpointConnectionResourceId); + + // invoke the operation + DesktopVirtualizationPrivateEndpointConnection connection = new DesktopVirtualizationPrivateEndpointConnection() + { + ConnectionState = new DesktopVirtualizationPrivateLinkServiceConnectionState() + { + Status = DesktopVirtualizationPrivateEndpointServiceConnectionStatus.Approved, + Description = "Approved by admin@consoto.com", + ActionsRequired = "None", + }, + }; + ArmOperation lro = await hostPoolPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, connection); + HostPoolPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs index 4d48c761341f..5ca1a1b8cf5f 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs @@ -19,12 +19,42 @@ namespace Azure.ResourceManager.DesktopVirtualization.Samples { public partial class Sample_HostPoolResource { + // PrivateLinkResources_ListByHostPool + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPrivateLinkResources_PrivateLinkResourcesListByHostPool() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByHostPool.json + // this example is just showing the usage of "PrivateLinkResources_ListByHostPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolResource created on azure + // for more information of creating HostPoolResource, please refer to the document of HostPoolResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier hostPoolResourceId = HostPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + HostPoolResource hostPool = client.GetHostPoolResource(hostPoolResourceId); + + // invoke the operation and iterate over the result + await foreach (DesktopVirtualizationPrivateLinkResource item in hostPool.GetPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + // ScalingPlan_ListByHostPool [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetScalingPlans_ScalingPlanListByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_ListByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByHostPool.json // this example is just showing the usage of "ScalingPlans_ListByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +91,7 @@ public async Task GetScalingPlans_ScalingPlanListByHostPool() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +122,7 @@ public async Task Get_HostPoolGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_HostPoolDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Delete.json // this example is just showing the usage of "HostPools_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +150,7 @@ public async Task Delete_HostPoolDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_HostPoolUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_Update.json // this example is just showing the usage of "HostPools_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +224,7 @@ public async Task Update_HostPoolUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHostPools_HostPoolList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPool_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPool_List.json // this example is just showing the usage of "HostPools_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -229,7 +259,7 @@ public async Task GetHostPools_HostPoolList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveRegistrationToken_HostPoolsRetrieveRegistrationTokenPost() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/HostPools_RetrieveRegistrationToken_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/HostPools_RetrieveRegistrationToken_Post.json // this example is just showing the usage of "HostPools_RetrieveRegistrationToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -256,7 +286,7 @@ public async Task RetrieveRegistrationToken_HostPoolsRetrieveRegistrationTokenPo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUserSessions_UserSessionListByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_ListByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_ListByHostPool.json // this example is just showing the usage of "UserSessions_ListByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -294,7 +324,7 @@ public async Task GetUserSessions_UserSessionListByHostPool() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExpandMsixImages_MsixImageExpand() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixImage_Expand_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixImage_Expand_Post.json // this example is just showing the usage of "MsixImages_Expand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs index 234e264f49cb..6a93e77f5245 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_MsixPackageCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_MSIXPackageGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Exists_MSIXPackageGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_MSIXPackageCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Create.json // this example is just showing the usage of "MSIXPackages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task CreateOrUpdate_MSIXPackageCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_MSIXPackageList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_List.json // this example is just showing the usage of "MSIXPackages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs index 45b134f5f24a..a87c259660b8 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs @@ -23,7 +23,7 @@ public partial class Sample_MsixPackageResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_MSIXPackageGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_MSIXPackageDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Delete.json // this example is just showing the usage of "MSIXPackages_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_MSIXPackageDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_MSIXPackageUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/MsixPackage_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/MsixPackage_Update.json // this example is just showing the usage of "MSIXPackages_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs index 27f1b7788b6a..6b75c6bd3428 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_ScalingPlanCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_ScalingPlansGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_ScalingPlansGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ScalingPlansCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Create.json // this example is just showing the usage of "ScalingPlans_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task CreateOrUpdate_ScalingPlansCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ScalingPlansListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListByResourceGroup.json // this example is just showing the usage of "ScalingPlans_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs new file mode 100644 index 000000000000..208f8b5580ff --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_ScalingPlanPersonalScheduleCollection + { + // ScalingPlanPersonalSchedules_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ScalingPlanPersonalSchedulesGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanResource created on azure + // for more information of creating ScalingPlanResource, please refer to the document of ScalingPlanResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "PersonalScalingPlan1"; + ResourceIdentifier scalingPlanResourceId = ScalingPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName); + ScalingPlanResource scalingPlan = client.GetScalingPlanResource(scalingPlanResourceId); + + // get the collection of this ScalingPlanPersonalScheduleResource + ScalingPlanPersonalScheduleCollection collection = scalingPlan.GetScalingPlanPersonalSchedules(); + + // invoke the operation + string scalingPlanScheduleName = "PersonalScalingPlanSchedule"; + ScalingPlanPersonalScheduleResource result = await collection.GetAsync(scalingPlanScheduleName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ScalingPlanPersonalScheduleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ScalingPlanPersonalSchedules_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_ScalingPlanPersonalSchedulesGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanResource created on azure + // for more information of creating ScalingPlanResource, please refer to the document of ScalingPlanResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "PersonalScalingPlan1"; + ResourceIdentifier scalingPlanResourceId = ScalingPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName); + ScalingPlanResource scalingPlan = client.GetScalingPlanResource(scalingPlanResourceId); + + // get the collection of this ScalingPlanPersonalScheduleResource + ScalingPlanPersonalScheduleCollection collection = scalingPlan.GetScalingPlanPersonalSchedules(); + + // invoke the operation + string scalingPlanScheduleName = "PersonalScalingPlanSchedule"; + bool result = await collection.ExistsAsync(scalingPlanScheduleName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // ScalingPlanPersonalSchedules_Create + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_ScalingPlanPersonalSchedulesCreate() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Create.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanResource created on azure + // for more information of creating ScalingPlanResource, please refer to the document of ScalingPlanResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "scalingPlan1"; + ResourceIdentifier scalingPlanResourceId = ScalingPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName); + ScalingPlanResource scalingPlan = client.GetScalingPlanResource(scalingPlanResourceId); + + // get the collection of this ScalingPlanPersonalScheduleResource + ScalingPlanPersonalScheduleCollection collection = scalingPlan.GetScalingPlanPersonalSchedules(); + + // invoke the operation + string scalingPlanScheduleName = "scalingPlanScheduleWeekdays1"; + ScalingPlanPersonalScheduleData data = new ScalingPlanPersonalScheduleData() + { + DaysOfWeek = +{ +DesktopVirtualizationDayOfWeek.Monday,DesktopVirtualizationDayOfWeek.Tuesday,DesktopVirtualizationDayOfWeek.Wednesday,DesktopVirtualizationDayOfWeek.Thursday,DesktopVirtualizationDayOfWeek.Friday +}, + RampUpStartTime = new ScalingActionTime(6, 0), + RampUpAutoStartHosts = StartupBehavior.All, + RampUpStartVmOnConnect = SetStartVmOnConnect.Enable, + RampUpActionOnDisconnect = SessionHandlingOperation.None, + RampUpMinutesToWaitOnDisconnect = 10, + RampUpActionOnLogoff = SessionHandlingOperation.None, + RampUpMinutesToWaitOnLogoff = 10, + PeakStartTime = new ScalingActionTime(8, 0), + PeakStartVmOnConnect = SetStartVmOnConnect.Enable, + PeakActionOnDisconnect = SessionHandlingOperation.None, + PeakMinutesToWaitOnDisconnect = 10, + PeakActionOnLogoff = SessionHandlingOperation.Deallocate, + PeakMinutesToWaitOnLogoff = 10, + RampDownStartTime = new ScalingActionTime(18, 0), + RampDownStartVmOnConnect = SetStartVmOnConnect.Enable, + RampDownActionOnDisconnect = SessionHandlingOperation.None, + RampDownMinutesToWaitOnDisconnect = 10, + RampDownActionOnLogoff = SessionHandlingOperation.Deallocate, + RampDownMinutesToWaitOnLogoff = 10, + OffPeakStartTime = new ScalingActionTime(20, 0), + OffPeakStartVmOnConnect = SetStartVmOnConnect.Enable, + OffPeakActionOnDisconnect = SessionHandlingOperation.None, + OffPeakMinutesToWaitOnDisconnect = 10, + OffPeakActionOnLogoff = SessionHandlingOperation.Deallocate, + OffPeakMinutesToWaitOnLogoff = 10, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, scalingPlanScheduleName, data); + ScalingPlanPersonalScheduleResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ScalingPlanPersonalScheduleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ScalingPlanPersonalSchedules_List + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ScalingPlanPersonalSchedulesList() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_List.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanResource created on azure + // for more information of creating ScalingPlanResource, please refer to the document of ScalingPlanResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "scalingPlan"; + ResourceIdentifier scalingPlanResourceId = ScalingPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName); + ScalingPlanResource scalingPlan = client.GetScalingPlanResource(scalingPlanResourceId); + + // get the collection of this ScalingPlanPersonalScheduleResource + ScalingPlanPersonalScheduleCollection collection = scalingPlan.GetScalingPlanPersonalSchedules(); + + // invoke the operation and iterate over the result + int? pageSize = 10; + bool? isDescending = true; + int? initialSkip = 0; + await foreach (ScalingPlanPersonalScheduleResource item in collection.GetAllAsync(pageSize: pageSize, isDescending: isDescending, initialSkip: initialSkip)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ScalingPlanPersonalScheduleData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs new file mode 100644 index 000000000000..f2520804ecac --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_ScalingPlanPersonalScheduleResource + { + // ScalingPlanPersonalSchedules_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ScalingPlanPersonalSchedulesGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Get.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanPersonalScheduleResource created on azure + // for more information of creating ScalingPlanPersonalScheduleResource, please refer to the document of ScalingPlanPersonalScheduleResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "PersonalScalingPlan1"; + string scalingPlanScheduleName = "PersonalScalingPlanSchedule"; + ResourceIdentifier scalingPlanPersonalScheduleResourceId = ScalingPlanPersonalScheduleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + ScalingPlanPersonalScheduleResource scalingPlanPersonalSchedule = client.GetScalingPlanPersonalScheduleResource(scalingPlanPersonalScheduleResourceId); + + // invoke the operation + ScalingPlanPersonalScheduleResource result = await scalingPlanPersonalSchedule.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ScalingPlanPersonalScheduleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // ScalingPlanPersonalSchedules_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_ScalingPlanPersonalSchedulesDelete() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Delete.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanPersonalScheduleResource created on azure + // for more information of creating ScalingPlanPersonalScheduleResource, please refer to the document of ScalingPlanPersonalScheduleResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "scalingPlan1"; + string scalingPlanScheduleName = "scalingPlanScheduleWeekdays1"; + ResourceIdentifier scalingPlanPersonalScheduleResourceId = ScalingPlanPersonalScheduleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + ScalingPlanPersonalScheduleResource scalingPlanPersonalSchedule = client.GetScalingPlanPersonalScheduleResource(scalingPlanPersonalScheduleResourceId); + + // invoke the operation + await scalingPlanPersonalSchedule.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // ScalingPlanPersonalSchedules_Update + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_ScalingPlanPersonalSchedulesUpdate() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPersonalSchedule_Update.json + // this example is just showing the usage of "ScalingPlanPersonalSchedules_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ScalingPlanPersonalScheduleResource created on azure + // for more information of creating ScalingPlanPersonalScheduleResource, please refer to the document of ScalingPlanPersonalScheduleResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string scalingPlanName = "scalingPlan1"; + string scalingPlanScheduleName = "scalingPlanScheduleWeekdays1"; + ResourceIdentifier scalingPlanPersonalScheduleResourceId = ScalingPlanPersonalScheduleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scalingPlanName, scalingPlanScheduleName); + ScalingPlanPersonalScheduleResource scalingPlanPersonalSchedule = client.GetScalingPlanPersonalScheduleResource(scalingPlanPersonalScheduleResourceId); + + // invoke the operation + ScalingPlanPersonalSchedulePatch patch = new ScalingPlanPersonalSchedulePatch() + { + PeakStartTime = new ScalingActionTime(8, 0), + PeakActionOnDisconnect = SessionHandlingOperation.None, + PeakMinutesToWaitOnDisconnect = 10, + PeakActionOnLogoff = SessionHandlingOperation.Deallocate, + PeakMinutesToWaitOnLogoff = 10, + RampDownStartTime = new ScalingActionTime(18, 0), + RampDownActionOnDisconnect = SessionHandlingOperation.None, + RampDownMinutesToWaitOnDisconnect = 10, + RampDownActionOnLogoff = SessionHandlingOperation.Deallocate, + RampDownMinutesToWaitOnLogoff = 10, + OffPeakStartTime = new ScalingActionTime(20, 0), + OffPeakStartVmOnConnect = SetStartVmOnConnect.Disable, + OffPeakActionOnDisconnect = SessionHandlingOperation.None, + OffPeakMinutesToWaitOnDisconnect = 10, + OffPeakActionOnLogoff = SessionHandlingOperation.Deallocate, + OffPeakMinutesToWaitOnLogoff = 10, + }; + ScalingPlanPersonalScheduleResource result = await scalingPlanPersonalSchedule.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ScalingPlanPersonalScheduleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs index 5759c6cbe554..7ee2c3d7ce91 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ScalingPlanPooledScheduleCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_ScalingPlanPooledSchedulesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Exists_ScalingPlanPooledSchedulesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ScalingPlanPooledSchedulesCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Create.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +147,7 @@ public async Task CreateOrUpdate_ScalingPlanPooledSchedulesCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ScalingPlanPooledSchedulesList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_List.json // this example is just showing the usage of "ScalingPlanPooledSchedules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs index 376385e37729..104e13b37a9a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ScalingPlanPooledScheduleResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_ScalingPlanPooledSchedulesGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ScalingPlanPooledSchedulesDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Delete.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_ScalingPlanPooledSchedulesDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ScalingPlanPooledSchedulesUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlanPooledSchedule_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlanPooledSchedule_Update.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs index 5c80f370d67b..6a766b1a49f2 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs @@ -24,7 +24,7 @@ public partial class Sample_ScalingPlanResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_ScalingPlansGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ScalingPlansDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Delete.json // this example is just showing the usage of "ScalingPlans_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_ScalingPlansDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ScalingPlansUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_Update.json // this example is just showing the usage of "ScalingPlans_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Update_ScalingPlansUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetScalingPlans_ScalingPlansListBySubscription() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ScalingPlan_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ScalingPlan_ListBySubscription.json // this example is just showing the usage of "ScalingPlans_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs index 807b65708e1e..9d80d729858b 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SessionHostCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_SessionHostGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Exists_SessionHostGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_SessionHostList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/SessionHost_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_List.json // this example is just showing the usage of "SessionHosts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs index 9a8b73fda19c..e4f270b677ac 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs @@ -23,7 +23,7 @@ public partial class Sample_SessionHostResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_SessionHostGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SessionHostDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/SessionHost_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Delete.json // this example is just showing the usage of "SessionHosts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Delete_SessionHostDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SessionHostUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/SessionHost_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/SessionHost_Update.json // this example is just showing the usage of "SessionHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs index 8d59c5f2dcd2..ec1b7e0ffe8c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_UserSessionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Get_UserSessionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Exists_UserSessionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_UserSessionList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_List.json // this example is just showing the usage of "UserSessions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs index 967058ce6e1c..37abacaca73e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_UserSessionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_UserSessionGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_UserSessionDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Delete.json // this example is just showing the usage of "UserSessions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Delete_UserSessionDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Disconnect_UserSessionDisconnectPost() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_Disconnect_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_Disconnect_Post.json // this example is just showing the usage of "UserSessions_Disconnect" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Disconnect_UserSessionDisconnectPost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SendMessage_UserSessionSendMessagePost() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/UserSession_SendMessage_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/UserSession_SendMessage_Post.json // this example is just showing the usage of "UserSessions_SendMessage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs index abc0457865eb..3905d3eaf0a2 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_VirtualApplicationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_ApplicationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Exists_ApplicationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApplicationCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Create.json // this example is just showing the usage of "Applications_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task CreateOrUpdate_ApplicationCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ApplicationsList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_List.json // this example is just showing the usage of "Applications_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs index f31aab54caac..43d0166d8f12 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_VirtualApplicationGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_ApplicationGroupGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_ApplicationGroupGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApplicationGroupCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Create.json // this example is just showing the usage of "ApplicationGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,6 +112,7 @@ public async Task CreateOrUpdate_ApplicationGroupCreate() { Description = "des1", FriendlyName = "friendly", + ShowInFeed = true, Tags = { ["tag1"] = "value1", @@ -133,7 +134,7 @@ public async Task CreateOrUpdate_ApplicationGroupCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ApplicationGroupListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListByResourceGroup.json // this example is just showing the usage of "ApplicationGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs index 297fe29e833e..d5e9d9e8a262 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs @@ -24,7 +24,7 @@ public partial class Sample_VirtualApplicationGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_ApplicationGroupGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ApplicationGroupDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Delete.json // this example is just showing the usage of "ApplicationGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_ApplicationGroupDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApplicationGroupsUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_Update.json // this example is just showing the usage of "ApplicationGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,6 +108,7 @@ public async Task Update_ApplicationGroupsUpdate() }, Description = "des1", FriendlyName = "friendly", + ShowInFeed = true, }; VirtualApplicationGroupResource result = await virtualApplicationGroup.UpdateAsync(patch); @@ -123,7 +124,7 @@ public async Task Update_ApplicationGroupsUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualApplicationGroups_ApplicationGroupList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/ApplicationGroup_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/ApplicationGroup_ListBySubscription.json // this example is just showing the usage of "ApplicationGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +157,7 @@ public async Task GetVirtualApplicationGroups_ApplicationGroupList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStartMenuItems_StartMenuItemList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/StartMenuItem_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/StartMenuItem_List.json // this example is just showing the usage of "StartMenuItems_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs index f1d35f65c0a6..0225c9bc0d21 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs @@ -23,7 +23,7 @@ public partial class Sample_VirtualApplicationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_ApplicationGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ApplicationDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Delete.json // this example is just showing the usage of "Applications_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_ApplicationDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApplicationUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Application_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Application_Update.json // this example is just showing the usage of "Applications_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs index 4db7f002e1f5..71e9f6bca562 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualDesktopCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_DesktopGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Exists_DesktopGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DesktopList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Desktop_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_List.json // this example is just showing the usage of "Desktops_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs index c72d16c107ef..cae12bbbcfd7 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualDesktopResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_DesktopGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DesktopUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Desktop_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Desktop_Update.json // this example is just showing the usage of "Desktops_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs index 062c21cad200..c02ce2ee1e19 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_VirtualWorkspaceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Get_WorkspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Exists_WorkspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_WorkspaceCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Create.json // this example is just showing the usage of "Workspaces_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task CreateOrUpdate_WorkspaceCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_WorkspaceListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListByResourceGroup.json // this example is just showing the usage of "Workspaces_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs index 514f076356fc..d2d0617415a9 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs @@ -24,7 +24,7 @@ public partial class Sample_VirtualWorkspaceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_WorkspaceGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_WorkspaceDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Delete.json // this example is just showing the usage of "Workspaces_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_WorkspaceDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_WorkspaceUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_Update.json // this example is just showing the usage of "Workspaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Update_WorkspaceUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualWorkspaces_WorkspaceListBySubscription() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2022-09-09/examples/Workspace_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/Workspace_ListBySubscription.json // this example is just showing the usage of "Workspaces_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,5 +149,35 @@ public async Task GetVirtualWorkspaces_WorkspaceListBySubscription() Console.WriteLine($"Succeeded"); } + + // PrivateLinkResources_ListByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPrivateLinkResources_PrivateLinkResourcesListByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateLinkResources_ListByWorkspace.json + // this example is just showing the usage of "PrivateLinkResources_ListByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VirtualWorkspaceResource created on azure + // for more information of creating VirtualWorkspaceResource, please refer to the document of VirtualWorkspaceResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + ResourceIdentifier virtualWorkspaceResourceId = VirtualWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + VirtualWorkspaceResource virtualWorkspace = client.GetVirtualWorkspaceResource(virtualWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (DesktopVirtualizationPrivateLinkResource item in virtualWorkspace.GetPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..cb1a02f2ccc5 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_WorkspacePrivateEndpointConnectionCollection + { + // PrivateEndpointConnection_ListByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_PrivateEndpointConnectionListByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_ListByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_ListByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VirtualWorkspaceResource created on azure + // for more information of creating VirtualWorkspaceResource, please refer to the document of VirtualWorkspaceResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + ResourceIdentifier virtualWorkspaceResourceId = VirtualWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + VirtualWorkspaceResource virtualWorkspace = client.GetVirtualWorkspaceResource(virtualWorkspaceResourceId); + + // get the collection of this WorkspacePrivateEndpointConnectionResource + WorkspacePrivateEndpointConnectionCollection collection = virtualWorkspace.GetWorkspacePrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (WorkspacePrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // PrivateEndpointConnection_GetByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionGetByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VirtualWorkspaceResource created on azure + // for more information of creating VirtualWorkspaceResource, please refer to the document of VirtualWorkspaceResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + ResourceIdentifier virtualWorkspaceResourceId = VirtualWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + VirtualWorkspaceResource virtualWorkspace = client.GetVirtualWorkspaceResource(virtualWorkspaceResourceId); + + // get the collection of this WorkspacePrivateEndpointConnectionResource + WorkspacePrivateEndpointConnectionCollection collection = virtualWorkspace.GetWorkspacePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + WorkspacePrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnection_GetByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_PrivateEndpointConnectionGetByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VirtualWorkspaceResource created on azure + // for more information of creating VirtualWorkspaceResource, please refer to the document of VirtualWorkspaceResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + ResourceIdentifier virtualWorkspaceResourceId = VirtualWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + VirtualWorkspaceResource virtualWorkspace = client.GetVirtualWorkspaceResource(virtualWorkspaceResourceId); + + // get the collection of this WorkspacePrivateEndpointConnectionResource + WorkspacePrivateEndpointConnectionCollection collection = virtualWorkspace.GetWorkspacePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // PrivateEndpointConnection_UpdateByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_PrivateEndpointConnectionUpdateByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_UpdateByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this VirtualWorkspaceResource created on azure + // for more information of creating VirtualWorkspaceResource, please refer to the document of VirtualWorkspaceResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + ResourceIdentifier virtualWorkspaceResourceId = VirtualWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + VirtualWorkspaceResource virtualWorkspace = client.GetVirtualWorkspaceResource(virtualWorkspaceResourceId); + + // get the collection of this WorkspacePrivateEndpointConnectionResource + WorkspacePrivateEndpointConnectionCollection collection = virtualWorkspace.GetWorkspacePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + DesktopVirtualizationPrivateEndpointConnection connection = new DesktopVirtualizationPrivateEndpointConnection() + { + ConnectionState = new DesktopVirtualizationPrivateLinkServiceConnectionState() + { + Status = DesktopVirtualizationPrivateEndpointServiceConnectionStatus.Approved, + Description = "Approved by admin@consoto.com", + ActionsRequired = "None", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, connection); + WorkspacePrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..4cae6658b5b6 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.DesktopVirtualization; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_WorkspacePrivateEndpointConnectionResource + { + // PrivateEndpointConnection_GetByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionGetByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_GetByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspacePrivateEndpointConnectionResource created on azure + // for more information of creating WorkspacePrivateEndpointConnectionResource, please refer to the document of WorkspacePrivateEndpointConnectionResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + string privateEndpointConnectionName = "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + ResourceIdentifier workspacePrivateEndpointConnectionResourceId = WorkspacePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + WorkspacePrivateEndpointConnectionResource workspacePrivateEndpointConnection = client.GetWorkspacePrivateEndpointConnectionResource(workspacePrivateEndpointConnectionResourceId); + + // invoke the operation + WorkspacePrivateEndpointConnectionResource result = await workspacePrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnection_DeleteByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_PrivateEndpointConnectionDeleteByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_DeleteByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_DeleteByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspacePrivateEndpointConnectionResource created on azure + // for more information of creating WorkspacePrivateEndpointConnectionResource, please refer to the document of WorkspacePrivateEndpointConnectionResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + string privateEndpointConnectionName = "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + ResourceIdentifier workspacePrivateEndpointConnectionResourceId = WorkspacePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + WorkspacePrivateEndpointConnectionResource workspacePrivateEndpointConnection = client.GetWorkspacePrivateEndpointConnectionResource(workspacePrivateEndpointConnectionResourceId); + + // invoke the operation + await workspacePrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // PrivateEndpointConnection_UpdateByWorkspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_PrivateEndpointConnectionUpdateByWorkspace() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2023-09-05/examples/PrivateEndpointConnection_UpdateByWorkspace.json + // this example is just showing the usage of "PrivateEndpointConnections_UpdateByWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspacePrivateEndpointConnectionResource created on azure + // for more information of creating WorkspacePrivateEndpointConnectionResource, please refer to the document of WorkspacePrivateEndpointConnectionResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string workspaceName = "workspace1"; + string privateEndpointConnectionName = "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b"; + ResourceIdentifier workspacePrivateEndpointConnectionResourceId = WorkspacePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + WorkspacePrivateEndpointConnectionResource workspacePrivateEndpointConnection = client.GetWorkspacePrivateEndpointConnectionResource(workspacePrivateEndpointConnectionResourceId); + + // invoke the operation + DesktopVirtualizationPrivateEndpointConnection connection = new DesktopVirtualizationPrivateEndpointConnection() + { + ConnectionState = new DesktopVirtualizationPrivateLinkServiceConnectionState() + { + Status = DesktopVirtualizationPrivateEndpointServiceConnectionStatus.Approved, + Description = "Approved by admin@consoto.com", + ActionsRequired = "None", + }, + }; + ArmOperation lro = await workspacePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, connection); + WorkspacePrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PrivateEndpointConnectionWithSystemDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs index 939db8b8d77d..ada9a780e876 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 484836e61f8f..40b187319d9c 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 9b8503298892..2b04782364b2 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 000000000000..761a5a988fae --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs @@ -0,0 +1,348 @@ +// 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 Autorest.CSharp.Core; +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 GeneratorPageableHelpers.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 GeneratorPageableHelpers.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 000000000000..6bd85917fefe --- /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 9808b2c014d7..bdfd6ee41109 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs @@ -37,6 +37,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; @@ -67,6 +69,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); @@ -104,6 +108,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() @@ -412,6 +469,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 GeneratorPageableHelpers.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 GeneratorPageableHelpers.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 000000000000..efc9305824b0 --- /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 000000000000..a1970c0d4893 --- /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 000000000000..efabf05f2708 --- /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 000000000000..90e93979d8bf --- /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 000000000000..6c518f83a362 --- /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 000000000000..917aa1273b83 --- /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 000000000000..6b0c0a9d04bb --- /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 000000000000..2caf80af1a55 --- /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 000000000000..f458c177c670 --- /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 000000000000..b448b3fb3a8a --- /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 c775aaf7e76d..6d700d66ec18 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 5f653f0dfe26..1898d2f60e9a 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 8366cde419cd..5b28a44d9ad9 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 000000000000..653c15b5ad99 --- /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 000000000000..d24678a9dea5 --- /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 000000000000..e1cfa77e10af --- /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 000000000000..557958d9c5dc --- /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 000000000000..9a4de19074f3 --- /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 000000000000..3dc215effdcf --- /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 000000000000..cb2149785a99 --- /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 000000000000..c0d41c9e7723 --- /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 000000000000..d6576b9726f0 --- /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 000000000000..86e415d6ec5a --- /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 000000000000..908a63306c5f --- /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 d5d87b9c23ed..d4b6866f557b 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 000000000000..39e049fe7e73 --- /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 000000000000..50405ea7faa1 --- /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 49a75b47749d..00987046809f 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 8a41a428133f..08f50854b1a7 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 7aa879568e61..ded62a853f15 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 823eccc368cc..001f19ce0913 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 63d4b56b78a9..7b23fd5c9210 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 30e777995b43..3c8302db222f 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 000000000000..dfacb05f3e3a --- /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 7aa04688f715..999e50a45eb2 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-09-05"; _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 fbb00144abe6..3386aa06b16a 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-09-05"; _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 4f38f54cec73..8d7006712daf 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-09-05"; _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 a685ba76203e..5696ab99400e 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-09-05"; _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 15bb61890bc2..a6c6f68b2b25 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-09-05"; _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 9d9f14f519ce..efaca9e3be64 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-09-05"; _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 000000000000..aad261b65101 --- /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-09-05"; + _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 000000000000..c767fa8f3c9d --- /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-09-05"; + _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 000000000000..ac50e3cf83d9 --- /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-09-05"; + _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 d7f3ee4cf8f3..a6406056096f 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-09-05"; _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 b59ba7d0696f..8ef3a07d4469 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-09-05"; _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 60fd317829f3..73a9e6b5ea60 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-09-05"; _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 d042adb1ad4a..59ad7daeacfe 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-09-05"; _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 2c0e944ce1a2..0d7d526f9dec 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-09-05"; _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 e2eb8ea1d757..bd7ea12135d3 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-09-05"; _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 000000000000..226166a3baba --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.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 Autorest.CSharp.Core; +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 GeneratorPageableHelpers.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 GeneratorPageableHelpers.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 000000000000..9604dd5aa95a --- /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 000000000000..b7744b9c2add --- /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 9aca0601777d..de48d530e155 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 32d9b9468561..711f7eb4edac 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 ca5b87c82b96..63f3f227d7ae 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 c595d27c8577..66e29a51168f 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs @@ -10,6 +10,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure; using Azure.Core; using Azure.Core.Pipeline; @@ -36,6 +37,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 +63,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 +94,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 +347,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 GeneratorPageableHelpers.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 GeneratorPageableHelpers.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 000000000000..a4452a8bb238 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs @@ -0,0 +1,342 @@ +// 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 Autorest.CSharp.Core; +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 GeneratorPageableHelpers.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 GeneratorPageableHelpers.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 000000000000..5ee5f2651fe4 --- /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 8d4210a1f3a2..81e0c67f00b4 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