From ea165416ce65e28b8d376eafaa8f6978d7bfdaa7 Mon Sep 17 00:00:00 2001 From: yaotongms <137821665+yaotongms@users.noreply.github.com> Date: Mon, 2 Dec 2024 01:28:59 -0500 Subject: [PATCH] Release preview version 2024-07-31 of HybridCompute (#46789) * generate code * rename models * update definitions * fix id type * update code * record test * remove unwanted files * update api signature * record all tests * update samples * update api sig * update changelog * update version * update version * Update CHANGELOG.md --------- Co-authored-by: Mingzhe Huang --- .../CHANGELOG.md | 10 +- ...re.ResourceManager.HybridCompute.net8.0.cs | 362 ++++++++- ...rceManager.HybridCompute.netstandard2.0.cs | 362 ++++++++- .../assets.json | 2 +- .../Samples/Sample_ArcGatewayCollection.cs | 197 +++++ .../Samples/Sample_ArcGatewayResource.cs | 109 +++ ...e_HybridComputeExtensionValueCollection.cs | 8 +- ...ple_HybridComputeExtensionValueResource.cs | 2 +- .../Sample_HybridComputeLicenseCollection.cs | 10 +- ...ple_HybridComputeLicenseProfileResource.cs | 8 +- .../Sample_HybridComputeLicenseResource.cs | 6 +- .../Sample_HybridComputeMachineCollection.cs | 16 +- ...HybridComputeMachineExtensionCollection.cs | 10 +- ...e_HybridComputeMachineExtensionResource.cs | 6 +- .../Sample_HybridComputeMachineResource.cs | 18 +- ...putePrivateEndpointConnectionCollection.cs | 10 +- ...omputePrivateEndpointConnectionResource.cs | 6 +- ...Sample_HybridComputePrivateLinkResource.cs | 2 +- ...ridComputePrivateLinkResourceCollection.cs | 8 +- ...HybridComputePrivateLinkScopeCollection.cs | 12 +- ...e_HybridComputePrivateLinkScopeResource.cs | 6 +- .../Sample_MachineRunCommandCollection.cs | 210 +++++ .../Sample_MachineRunCommandResource.cs | 123 +++ ...ecurityPerimeterConfigurationCollection.cs | 8 +- ...kSecurityPerimeterConfigurationResource.cs | 4 +- .../Sample_ResourceGroupResourceExtensions.cs | 53 ++ .../Sample_SubscriptionResourceExtensions.cs | 41 +- .../src/Generated/ArcGatewayCollection.cs | 494 ++++++++++++ .../Generated/ArcGatewayData.Serialization.cs | 491 ++++++++++++ .../src/Generated/ArcGatewayData.cs | 105 +++ .../ArcGatewayResource.Serialization.cs | 26 + .../src/Generated/ArcGatewayResource.cs | 699 ++++++++++++++++ .../Generated/ArmHybridComputeModelFactory.cs | 277 ++++++- .../Extensions/HybridComputeExtensions.cs | 313 +++++++- .../MockableHybridComputeArmClient.cs | 24 + ...kableHybridComputeResourceGroupResource.cs | 183 ++++- ...ckableHybridComputeSubscriptionResource.cs | 88 +- .../HybridComputeExtensionValueCollection.cs | 16 +- .../HybridComputeExtensionValueData.cs | 2 +- .../HybridComputeExtensionValueResource.cs | 4 +- .../HybridComputeLicenseCollection.cs | 20 +- .../HybridComputeLicenseProfileResource.cs | 28 +- .../Generated/HybridComputeLicenseResource.cs | 24 +- .../HybridComputeMachineCollection.cs | 20 +- .../HybridComputeMachineData.Serialization.cs | 98 +++ .../src/Generated/HybridComputeMachineData.cs | 23 +- ...HybridComputeMachineExtensionCollection.cs | 20 +- .../HybridComputeMachineExtensionResource.cs | 28 +- .../Generated/HybridComputeMachineResource.cs | 117 ++- ...putePrivateEndpointConnectionCollection.cs | 20 +- ...omputePrivateEndpointConnectionResource.cs | 12 +- .../HybridComputePrivateLinkResource.cs | 4 +- ...ridComputePrivateLinkResourceCollection.cs | 16 +- ...HybridComputePrivateLinkScopeCollection.cs | 20 +- .../HybridComputePrivateLinkScopeResource.cs | 36 +- .../ArcGatewayOperationSource.cs | 38 + .../MachineRunCommandOperationSource.cs | 38 + .../Generated/MachineRunCommandCollection.cs | 495 ++++++++++++ .../MachineRunCommandData.Serialization.cs | 753 ++++++++++++++++++ .../src/Generated/MachineRunCommandData.cs | 146 ++++ ...MachineRunCommandResource.Serialization.cs | 26 + .../Generated/MachineRunCommandResource.cs | 684 ++++++++++++++++ .../src/Generated/Models/AgentUpgrade.cs | 8 +- .../Models/ArcGatewayPatch.Serialization.cs | 159 ++++ .../src/Generated/Models/ArcGatewayPatch.cs | 35 + .../src/Generated/Models/ArcGatewayType.cs | 48 ++ .../Models/ArcSettings.Serialization.cs | 307 +++++++ .../src/Generated/Models/ArcSettings.cs | 77 ++ .../ExtensionsResourceStatus.Serialization.cs | 305 +++++++ .../Models/ExtensionsResourceStatus.cs | 86 ++ ...ExtensionsStatusLevelType.Serialization.cs | 30 + .../Models/ExtensionsStatusLevelType.cs | 20 + .../GatewaysListResult.Serialization.cs | 212 +++++ .../Generated/Models/GatewaysListResult.cs | 80 ++ .../Models/HybridComputeDisk.Serialization.cs | 370 +++++++++ .../src/Generated/Models/HybridComputeDisk.cs | 97 +++ .../Models/HybridComputeExecutionState.cs | 66 ++ ...ridComputeFirmwareProfile.Serialization.cs | 204 +++++ .../Models/HybridComputeFirmwareProfile.cs | 71 ++ ...ridComputeHardwareProfile.Serialization.cs | 245 ++++++ .../Models/HybridComputeHardwareProfile.cs | 77 ++ ...idComputeNetworkInterface.Serialization.cs | 100 ++- .../Models/HybridComputeNetworkInterface.cs | 18 +- .../HybridComputeProcessor.Serialization.cs | 200 +++++ .../Models/HybridComputeProcessor.cs | 71 ++ ...ineRunCommandInstanceView.Serialization.cs | 418 ++++++++++ .../Models/MachineRunCommandInstanceView.cs | 102 +++ ...ineRunCommandScriptSource.Serialization.cs | 264 ++++++ .../Models/MachineRunCommandScriptSource.cs | 81 ++ ...hineRunCommandsListResult.Serialization.cs | 219 +++++ .../Models/MachineRunCommandsListResult.cs | 70 ++ .../RunCommandInputParameter.Serialization.cs | 198 +++++ .../Models/RunCommandInputParameter.cs | 84 ++ ...RunCommandManagedIdentity.Serialization.cs | 196 +++++ .../Models/RunCommandManagedIdentity.cs | 71 ++ .../Models/StorageProfile.Serialization.cs | 185 +++++ .../src/Generated/Models/StorageProfile.cs | 67 ++ ...ecurityPerimeterConfigurationCollection.cs | 16 +- ...kSecurityPerimeterConfigurationResource.cs | 8 +- .../ExtensionMetadataRestOperations.cs | 2 +- .../RestOperations/GatewaysRestOperations.cs | 731 +++++++++++++++++ .../HybridComputeManagementRestOperations.cs | 2 +- .../LicenseProfilesRestOperations.cs | 2 +- .../RestOperations/LicensesRestOperations.cs | 2 +- .../MachineExtensionsRestOperations.cs | 6 +- .../MachineRunCommandsRestOperations.cs | 527 ++++++++++++ .../RestOperations/MachinesRestOperations.cs | 2 +- .../NetworkProfileRestOperations.cs | 2 +- ...tyPerimeterConfigurationsRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../PrivateLinkScopesRestOperations.cs | 2 +- .../RestOperations/SettingsRestOperations.cs | 165 ++++ .../src/autorest.md | 91 ++- .../tests/HybridComputeManagementTestBase.cs | 268 ++++--- .../HybridComputeManagementEsuLicenseTest.cs | 30 + ...idComputeManagementMachineExtensionTest.cs | 17 +- ...ComputeManagementMachineRunCommandsTest.cs | 68 ++ .../HybridComputeManagementMachineTest.cs | 1 + 119 files changed, 13322 insertions(+), 464 deletions(-) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayCollection.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayCollection.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/ArcGatewayOperationSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayType.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index 83ff4bc887df..a18ae7874097 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -1,14 +1,12 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2024-12-02) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Upgraded api-version tag from 'package-preview-2024-05' to 'package-preview-2024-07'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/0f300277e21972f20b32ffbff96180217875909b/specification/hybridcompute/resource-manager/readme.md. + - Added license profile operations for hybrid machine + - Added gateway and settings operations for hybrid machine ## 1.0.0 (2024-10-18) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.net8.0.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.net8.0.cs index a264619f6a21..7323ae07a2a4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.net8.0.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.net8.0.cs @@ -1,7 +1,70 @@ namespace Azure.ResourceManager.HybridCompute { + public partial class ArcGatewayCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ArcGatewayCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.HybridCompute.ArcGatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.HybridCompute.ArcGatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string gatewayName, 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 gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string gatewayName, 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 ArcGatewayData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcGatewayData(Azure.Core.AzureLocation location) { } + public System.Collections.Generic.IList AllowedFeatures { get { throw null; } } + public string GatewayEndpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier GatewayId { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.ArcGatewayType? GatewayType { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ArcGatewayResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ArcGatewayResource() { } + public virtual Azure.ResourceManager.HybridCompute.ArcGatewayData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string gatewayName) { 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 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; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class HybridComputeExtensions { + public static Azure.Response GetArcGateway(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetArcGatewayAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridCompute.ArcGatewayResource GetArcGatewayResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridCompute.ArcGatewayCollection GetArcGateways(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetArcGateways(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetArcGatewaysAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetHybridComputeExtensionValue(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHybridComputeExtensionValueAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -28,9 +91,12 @@ public static partial class HybridComputeExtensions public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetHybridComputePrivateLinkScopesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridCompute.MachineRunCommandResource GetMachineRunCommandResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetValidationDetailsPrivateLinkScope(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetValidationDetailsPrivateLinkScopeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response UpdateSetting(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> UpdateSettingAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ArmOperation ValidateLicenseLicense(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> ValidateLicenseLicenseAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -51,7 +117,7 @@ protected HybridComputeExtensionValueCollection() { } } public partial class HybridComputeExtensionValueData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal HybridComputeExtensionValueData() { } + public HybridComputeExtensionValueData() { } public string ExtensionType { get { throw null; } } public string Publisher { get { throw null; } } public string Version { get { throw null; } } @@ -218,6 +284,8 @@ public HybridComputeMachineData(Azure.Core.AzureLocation location) { } public string DomainName { get { throw null; } } public System.Collections.Generic.IReadOnlyList ErrorDetails { get { throw null; } } public System.Collections.Generic.IList Extensions { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile FirmwareProfile { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile HardwareProfile { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? Kind { get { throw null; } set { } } public System.DateTimeOffset? LastStatusChange { get { throw null; } } @@ -238,6 +306,7 @@ public HybridComputeMachineData(Azure.Core.AzureLocation location) { } public System.Collections.Generic.IReadOnlyList Resources { get { throw null; } } public Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses ServiceStatuses { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StorageDisks { get { throw null; } } public System.Guid? VmId { get { throw null; } set { } } public System.Guid? VmUuid { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -319,6 +388,9 @@ protected HybridComputeMachineResource() { } public virtual Azure.Response GetHybridComputeMachineExtension(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeMachineExtensionAsync(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() { throw null; } + public virtual Azure.Response GetMachineRunCommand(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMachineRunCommandAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandCollection GetMachineRunCommands() { throw null; } public virtual Azure.Response GetNetworkProfile(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNetworkProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetValidationDetailsForMachinePrivateLinkScope(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -489,6 +561,71 @@ protected HybridComputePrivateLinkScopeResource() { } public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MachineRunCommandCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MachineRunCommandCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string runCommandName, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string runCommandName, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string runCommandName, 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 MachineRunCommandData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MachineRunCommandData(Azure.Core.AzureLocation location) { } + public bool? AsyncExecution { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity ErrorBlobManagedIdentity { get { throw null; } set { } } + public System.Uri ErrorBlobUri { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView InstanceView { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity OutputBlobManagedIdentity { get { throw null; } set { } } + public System.Uri OutputBlobUri { get { throw null; } set { } } + public System.Collections.Generic.IList Parameters { get { throw null; } } + public System.Collections.Generic.IList ProtectedParameters { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public string RunAsPassword { get { throw null; } set { } } + public string RunAsUser { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource Source { get { throw null; } set { } } + public int? TimeoutInSeconds { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MachineRunCommandResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MachineRunCommandResource() { } + public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) { 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 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; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NetworkSecurityPerimeterConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NetworkSecurityPerimeterConfigurationCollection() { } @@ -542,6 +679,7 @@ namespace Azure.ResourceManager.HybridCompute.Mocking public partial class MockableHybridComputeArmClient : Azure.ResourceManager.ArmResource { protected MockableHybridComputeArmClient() { } + public virtual Azure.ResourceManager.HybridCompute.ArcGatewayResource GetArcGatewayResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileResource GetHybridComputeLicenseProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseResource GetHybridComputeLicenseResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -550,11 +688,15 @@ protected MockableHybridComputeArmClient() { } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateEndpointConnectionResource GetHybridComputePrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkResource GetHybridComputePrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeResource GetHybridComputePrivateLinkScopeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandResource GetMachineRunCommandResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableHybridComputeResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableHybridComputeResourceGroupResource() { } + public virtual Azure.Response GetArcGateway(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetArcGatewayAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.ArcGatewayCollection GetArcGateways() { throw null; } public virtual Azure.Response GetHybridComputeLicense(string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeLicenseAsync(string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseCollection GetHybridComputeLicenses() { throw null; } @@ -564,10 +706,14 @@ protected MockableHybridComputeResourceGroupResource() { } public virtual Azure.Response GetHybridComputePrivateLinkScope(string scopeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputePrivateLinkScopeAsync(string scopeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() { throw null; } + public virtual Azure.Response UpdateSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableHybridComputeSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableHybridComputeSubscriptionResource() { } + public virtual Azure.Pageable GetArcGateways(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetArcGatewaysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHybridComputeExtensionValue(Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeExtensionValueAsync(Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueCollection GetHybridComputeExtensionValues(Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } @@ -638,6 +784,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ArcGatewayPatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcGatewayPatch() { } + public System.Collections.Generic.IList AllowedFeatures { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArcGatewayType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArcGatewayType(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.ArcGatewayType Public { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.ArcGatewayType 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.HybridCompute.Models.ArcGatewayType left, Azure.ResourceManager.HybridCompute.Models.ArcGatewayType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.ArcGatewayType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.ArcGatewayType left, Azure.ResourceManager.HybridCompute.Models.ArcGatewayType right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ArcKindEnum : System.IEquatable { @@ -661,24 +835,46 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum left, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum right) { throw null; } public override string ToString() { throw null; } } + public partial class ArcSettings : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcSettings() { } + public Azure.Core.ResourceIdentifier GatewayResourceId { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmHybridComputeModelFactory { public static Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration(System.Uri proxyUri = null, System.Collections.Generic.IEnumerable incomingConnectionsPorts = null, System.Collections.Generic.IEnumerable extensionsAllowList = null, System.Collections.Generic.IEnumerable extensionsBlockList = null, System.Collections.Generic.IEnumerable proxyBypass = null, string extensionsEnabled = null, string guestConfigurationEnabled = null, Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode? configMode = default(Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.AgentUpgrade AgentUpgrade(string desiredVersion = null, System.Guid? correlationId = default(System.Guid?), bool? isAutomaticUpgradeEnabled = default(bool?), string lastAttemptDesiredVersion = null, System.DateTimeOffset? lastAttemptedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum? lastAttemptStatus = default(Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum?), string lastAttemptMessage = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.ArcGatewayData ArcGatewayData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.Core.ResourceIdentifier gatewayId = null, Azure.ResourceManager.HybridCompute.Models.ArcGatewayType? gatewayType = default(Azure.ResourceManager.HybridCompute.Models.ArcGatewayType?), string gatewayEndpoint = null, System.Collections.Generic.IEnumerable allowedFeatures = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.ArcSettings ArcSettings(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? tenantId = default(System.Guid?), Azure.Core.ResourceIdentifier gatewayResourceId = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification AvailablePatchCountByClassification(int? security = default(int?), int? critical = default(int?), int? definition = default(int?), int? updateRollup = default(int?), int? featurePack = default(int?), int? servicePack = default(int?), int? tools = default(int?), int? updates = default(int?), int? other = default(int?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.EsuKey EsuKey(string sku = null, int? licenseStatus = default(int?)) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus ExtensionsResourceStatus(string code = null, Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType? level = default(Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType?), string displayStatus = null, string message = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRule HybridComputeAccessRule(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRuleDirection? direction = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRuleDirection?), System.Collections.Generic.IEnumerable addressPrefixes = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeConfigurationExtension HybridComputeConfigurationExtension(string publisher = null, string configurationExtensionType = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeConnectionDetail HybridComputeConnectionDetail(Azure.Core.ResourceIdentifier id = null, string privateIPAddress = null, string linkIdentifier = null, string groupId = null, string memberName = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeDisk HybridComputeDisk(string path = null, string diskType = null, string generatedId = null, Azure.Core.ResourceIdentifier id = null, string name = null, long? maxSizeInBytes = default(long?), long? usedSpaceInBytes = default(long?)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueData HybridComputeExtensionValueData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string version = null, string extensionType = null, string publisher = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile HybridComputeFirmwareProfile(string serialNumber = null, string firmwareProfileType = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile HybridComputeHardwareProfile(long? totalPhysicalMemoryInBytes = default(long?), int? numberOfCpuSockets = default(int?), System.Collections.Generic.IEnumerable processors = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeIPAddress HybridComputeIPAddress(string address = null, string ipAddressVersion = null, string subnetAddressPrefix = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseData HybridComputeLicenseData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType? licenseType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails licenseDetails = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails HybridComputeLicenseDetails(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState? state = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget? target = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition? edition = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition?), Azure.ResourceManager.HybridCompute.Models.LicenseCoreType? licenseCoreType = default(Azure.ResourceManager.HybridCompute.Models.LicenseCoreType?), int? processors = default(int?), int? assignedLicenses = default(int?), string immutableId = null, System.Collections.Generic.IEnumerable volumeLicenseDetails = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData HybridComputeLicenseProfileData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), string assignedLicense = null, bool? softwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration HybridComputeLinuxConfiguration(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? assessmentMode = default(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType?), Azure.ResourceManager.HybridCompute.Models.PatchModeType? patchMode = default(Azure.ResourceManager.HybridCompute.Models.PatchModeType?), bool? isHotpatchingEnabled = default(bool?), Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus status = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(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), System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind = default(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, System.Guid? vmId = default(System.Guid?), string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, System.Guid? vmUuid = default(System.Guid?), System.Collections.Generic.IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, Azure.Core.ResourceIdentifier privateLinkScopeResourceId = null, Azure.Core.ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(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), System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind = default(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile hardwareProfile = null, System.Collections.Generic.IEnumerable storageDisks = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile firmwareProfile = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, System.Guid? vmId = default(System.Guid?), string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, System.Guid? vmUuid = default(System.Guid?), System.Collections.Generic.IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, Azure.Core.ResourceIdentifier privateLinkScopeResourceId = null, Azure.Core.ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable resources, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind, Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses, string cloudMetadataProvider, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile, string provisioningState, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status, System.DateTimeOffset? lastStatusChange, System.Collections.Generic.IEnumerable errorDetails, string agentVersion, System.Guid? vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, System.Guid? vmUuid, System.Collections.Generic.IEnumerable extensions, string osSku, string osEdition, string domainName, string adFqdn, string dnsFqdn, Azure.Core.ResourceIdentifier privateLinkScopeResourceId, Azure.Core.ResourceIdentifier parentClusterResourceId, string msSqlDiscovered, System.Collections.Generic.IReadOnlyDictionary detectedProperties, System.Collections.Generic.IEnumerable networkInterfaces) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionData HybridComputeMachineExtensionData(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), Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties properties = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(System.Collections.Generic.IEnumerable ipAddresses = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(System.Collections.Generic.IEnumerable ipAddresses) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(string macAddress = null, Azure.Core.ResourceIdentifier id = null, string name = null, System.Collections.Generic.IEnumerable ipAddresses = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkProfile HybridComputeNetworkProfile(System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile HybridComputeOSProfile(string computerName = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsConfiguration windowsConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration linuxConfiguration = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus HybridComputePatchSettingsStatus(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus? hotpatchEnablementStatus = default(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus?), Azure.ResponseError error = null) { throw null; } @@ -689,6 +885,7 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeData HybridComputePrivateLinkScopeData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopeProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopeProperties HybridComputePrivateLinkScopeProperties(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType?), string provisioningState = null, string privateLinkScopeId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkServiceConnectionStateProperty HybridComputePrivateLinkServiceConnectionStateProperty(string status = null, string description = null, string actionsRequired = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProcessor HybridComputeProcessor(string name = null, int? numberOfCores = default(int?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProductFeature HybridComputeProductFeature(string name = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssue HybridComputeProvisioningIssue(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueType? issueType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueSeverity? severity = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueSeverity?), string description = null, System.Collections.Generic.IEnumerable suggestedResourceIds = null, System.Collections.Generic.IEnumerable suggestedAccessRules = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation HybridComputeResourceAssociation(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode? accessMode = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode?)) { throw null; } @@ -701,6 +898,8 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties MachineExtensionProperties(string forceUpdateTag = null, string publisher = null, string machineExtensionPropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = default(bool?), bool? autoUpgradeMinorVersion = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView instanceView = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesContent MachineInstallPatchesContent(System.TimeSpan maximumDuration = default(System.TimeSpan), Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting rebootSetting = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting), Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsParameters windowsParameters = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxParameters linuxParameters = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesResult MachineInstallPatchesResult(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus? status = default(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus?), string installationActivityId = null, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus? rebootStatus = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus?), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? startedBy = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy?), Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? patchServiceUsed = default(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed?), Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType? osType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.MachineRunCommandData MachineRunCommandData(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), Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource source = null, System.Collections.Generic.IEnumerable parameters = null, System.Collections.Generic.IEnumerable protectedParameters = null, bool? asyncExecution = default(bool?), string runAsUser = null, string runAsPassword = null, int? timeoutInSeconds = default(int?), System.Uri outputBlobUri = null, System.Uri errorBlobUri = null, Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity outputBlobManagedIdentity = null, Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity errorBlobManagedIdentity = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView instanceView = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView MachineRunCommandInstanceView(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState? executionState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState?), string executionMessage = null, int? exitCode = default(int?), string output = null, string error = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeter NetworkSecurityPerimeter(string id = null, string perimeterGuid = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation resourceAssociation = null, Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterProfile profile = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterConfigurationReconcileResult NetworkSecurityPerimeterConfigurationReconcileResult(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } @@ -812,6 +1011,27 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.EsuServerType left, Azure.ResourceManager.HybridCompute.Models.EsuServerType right) { throw null; } public override string ToString() { throw null; } } + public partial class ExtensionsResourceStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExtensionsResourceStatus() { } + public string Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType? Level { get { throw null; } } + public string Message { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public enum ExtensionsStatusLevelType + { + Info = 0, + Warning = 1, + Error = 2, + } public partial class ExtensionTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExtensionTargetProperties() { } @@ -921,6 +1141,71 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class HybridComputeDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeDisk() { } + public string DiskType { get { throw null; } } + public string GeneratedId { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public long? MaxSizeInBytes { get { throw null; } } + public string Name { get { throw null; } } + public string Path { get { throw null; } } + public long? UsedSpaceInBytes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridComputeExecutionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridComputeExecutionState(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Canceled { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Failed { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Pending { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Running { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Succeeded { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState TimedOut { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState 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.HybridCompute.Models.HybridComputeExecutionState left, Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState left, Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HybridComputeFirmwareProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeFirmwareProfile() { } + public string FirmwareProfileType { get { throw null; } } + public string SerialNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HybridComputeHardwareProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeHardwareProfile() { } + public int? NumberOfCpuSockets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Processors { get { throw null; } } + public long? TotalPhysicalMemoryInBytes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class HybridComputeIPAddress : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal HybridComputeIPAddress() { } @@ -1141,7 +1426,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class HybridComputeNetworkInterface : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal HybridComputeNetworkInterface() { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public string Name { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1268,6 +1556,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class HybridComputeProcessor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeProcessor() { } + public string Name { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeProcessor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeProcessor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class HybridComputeProductFeature : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HybridComputeProductFeature() { } @@ -1838,6 +2138,38 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus left, Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class MachineRunCommandInstanceView : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MachineRunCommandInstanceView() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Error { get { throw null; } } + public string ExecutionMessage { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState? ExecutionState { get { throw null; } } + public int? ExitCode { get { throw null; } } + public string Output { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MachineRunCommandScriptSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MachineRunCommandScriptSource() { } + public string CommandId { get { throw null; } set { } } + public string Script { get { throw null; } set { } } + public System.Uri ScriptUri { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity ScriptUriManagedIdentity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NetworkSecurityPerimeter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NetworkSecurityPerimeter() { } @@ -1961,6 +2293,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class RunCommandInputParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RunCommandInputParameter(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandInputParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandInputParameter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RunCommandManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RunCommandManagedIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VmGuestPatchClassificationLinux : System.IEquatable { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs index a264619f6a21..7323ae07a2a4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs @@ -1,7 +1,70 @@ namespace Azure.ResourceManager.HybridCompute { + public partial class ArcGatewayCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ArcGatewayCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.HybridCompute.ArcGatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.HybridCompute.ArcGatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string gatewayName, 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 gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string gatewayName, 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 ArcGatewayData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcGatewayData(Azure.Core.AzureLocation location) { } + public System.Collections.Generic.IList AllowedFeatures { get { throw null; } } + public string GatewayEndpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier GatewayId { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.ArcGatewayType? GatewayType { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ArcGatewayResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ArcGatewayResource() { } + public virtual Azure.ResourceManager.HybridCompute.ArcGatewayData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string gatewayName) { 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 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; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.ArcGatewayData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class HybridComputeExtensions { + public static Azure.Response GetArcGateway(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetArcGatewayAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridCompute.ArcGatewayResource GetArcGatewayResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridCompute.ArcGatewayCollection GetArcGateways(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetArcGateways(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetArcGatewaysAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetHybridComputeExtensionValue(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHybridComputeExtensionValueAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -28,9 +91,12 @@ public static partial class HybridComputeExtensions public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetHybridComputePrivateLinkScopesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridCompute.MachineRunCommandResource GetMachineRunCommandResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetValidationDetailsPrivateLinkScope(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetValidationDetailsPrivateLinkScopeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response UpdateSetting(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> UpdateSettingAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ArmOperation ValidateLicenseLicense(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> ValidateLicenseLicenseAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -51,7 +117,7 @@ protected HybridComputeExtensionValueCollection() { } } public partial class HybridComputeExtensionValueData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal HybridComputeExtensionValueData() { } + public HybridComputeExtensionValueData() { } public string ExtensionType { get { throw null; } } public string Publisher { get { throw null; } } public string Version { get { throw null; } } @@ -218,6 +284,8 @@ public HybridComputeMachineData(Azure.Core.AzureLocation location) { } public string DomainName { get { throw null; } } public System.Collections.Generic.IReadOnlyList ErrorDetails { get { throw null; } } public System.Collections.Generic.IList Extensions { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile FirmwareProfile { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile HardwareProfile { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? Kind { get { throw null; } set { } } public System.DateTimeOffset? LastStatusChange { get { throw null; } } @@ -238,6 +306,7 @@ public HybridComputeMachineData(Azure.Core.AzureLocation location) { } public System.Collections.Generic.IReadOnlyList Resources { get { throw null; } } public Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses ServiceStatuses { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList StorageDisks { get { throw null; } } public System.Guid? VmId { get { throw null; } set { } } public System.Guid? VmUuid { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -319,6 +388,9 @@ protected HybridComputeMachineResource() { } public virtual Azure.Response GetHybridComputeMachineExtension(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeMachineExtensionAsync(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() { throw null; } + public virtual Azure.Response GetMachineRunCommand(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMachineRunCommandAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandCollection GetMachineRunCommands() { throw null; } public virtual Azure.Response GetNetworkProfile(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNetworkProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetValidationDetailsForMachinePrivateLinkScope(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -489,6 +561,71 @@ protected HybridComputePrivateLinkScopeResource() { } public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MachineRunCommandCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MachineRunCommandCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string runCommandName, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string runCommandName, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string runCommandName, 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 MachineRunCommandData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MachineRunCommandData(Azure.Core.AzureLocation location) { } + public bool? AsyncExecution { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity ErrorBlobManagedIdentity { get { throw null; } set { } } + public System.Uri ErrorBlobUri { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView InstanceView { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity OutputBlobManagedIdentity { get { throw null; } set { } } + public System.Uri OutputBlobUri { get { throw null; } set { } } + public System.Collections.Generic.IList Parameters { get { throw null; } } + public System.Collections.Generic.IList ProtectedParameters { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public string RunAsPassword { get { throw null; } set { } } + public string RunAsUser { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource Source { get { throw null; } set { } } + public int? TimeoutInSeconds { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MachineRunCommandResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MachineRunCommandResource() { } + public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) { 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 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; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NetworkSecurityPerimeterConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NetworkSecurityPerimeterConfigurationCollection() { } @@ -542,6 +679,7 @@ namespace Azure.ResourceManager.HybridCompute.Mocking public partial class MockableHybridComputeArmClient : Azure.ResourceManager.ArmResource { protected MockableHybridComputeArmClient() { } + public virtual Azure.ResourceManager.HybridCompute.ArcGatewayResource GetArcGatewayResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileResource GetHybridComputeLicenseProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseResource GetHybridComputeLicenseResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -550,11 +688,15 @@ protected MockableHybridComputeArmClient() { } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateEndpointConnectionResource GetHybridComputePrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkResource GetHybridComputePrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeResource GetHybridComputePrivateLinkScopeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandResource GetMachineRunCommandResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableHybridComputeResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableHybridComputeResourceGroupResource() { } + public virtual Azure.Response GetArcGateway(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetArcGatewayAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.ArcGatewayCollection GetArcGateways() { throw null; } public virtual Azure.Response GetHybridComputeLicense(string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeLicenseAsync(string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseCollection GetHybridComputeLicenses() { throw null; } @@ -564,10 +706,14 @@ protected MockableHybridComputeResourceGroupResource() { } public virtual Azure.Response GetHybridComputePrivateLinkScope(string scopeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputePrivateLinkScopeAsync(string scopeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() { throw null; } + public virtual Azure.Response UpdateSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.ArcSettings arcSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableHybridComputeSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableHybridComputeSubscriptionResource() { } + public virtual Azure.Pageable GetArcGateways(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetArcGatewaysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHybridComputeExtensionValue(Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeExtensionValueAsync(Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueCollection GetHybridComputeExtensionValues(Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } @@ -638,6 +784,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ArcGatewayPatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcGatewayPatch() { } + public System.Collections.Generic.IList AllowedFeatures { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcGatewayPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArcGatewayType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArcGatewayType(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.ArcGatewayType Public { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.ArcGatewayType 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.HybridCompute.Models.ArcGatewayType left, Azure.ResourceManager.HybridCompute.Models.ArcGatewayType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.ArcGatewayType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.ArcGatewayType left, Azure.ResourceManager.HybridCompute.Models.ArcGatewayType right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ArcKindEnum : System.IEquatable { @@ -661,24 +835,46 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum left, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum right) { throw null; } public override string ToString() { throw null; } } + public partial class ArcSettings : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ArcSettings() { } + public Azure.Core.ResourceIdentifier GatewayResourceId { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ArcSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public static partial class ArmHybridComputeModelFactory { public static Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration(System.Uri proxyUri = null, System.Collections.Generic.IEnumerable incomingConnectionsPorts = null, System.Collections.Generic.IEnumerable extensionsAllowList = null, System.Collections.Generic.IEnumerable extensionsBlockList = null, System.Collections.Generic.IEnumerable proxyBypass = null, string extensionsEnabled = null, string guestConfigurationEnabled = null, Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode? configMode = default(Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.AgentUpgrade AgentUpgrade(string desiredVersion = null, System.Guid? correlationId = default(System.Guid?), bool? isAutomaticUpgradeEnabled = default(bool?), string lastAttemptDesiredVersion = null, System.DateTimeOffset? lastAttemptedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum? lastAttemptStatus = default(Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum?), string lastAttemptMessage = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.ArcGatewayData ArcGatewayData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.Core.ResourceIdentifier gatewayId = null, Azure.ResourceManager.HybridCompute.Models.ArcGatewayType? gatewayType = default(Azure.ResourceManager.HybridCompute.Models.ArcGatewayType?), string gatewayEndpoint = null, System.Collections.Generic.IEnumerable allowedFeatures = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.ArcSettings ArcSettings(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? tenantId = default(System.Guid?), Azure.Core.ResourceIdentifier gatewayResourceId = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification AvailablePatchCountByClassification(int? security = default(int?), int? critical = default(int?), int? definition = default(int?), int? updateRollup = default(int?), int? featurePack = default(int?), int? servicePack = default(int?), int? tools = default(int?), int? updates = default(int?), int? other = default(int?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.EsuKey EsuKey(string sku = null, int? licenseStatus = default(int?)) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus ExtensionsResourceStatus(string code = null, Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType? level = default(Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType?), string displayStatus = null, string message = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRule HybridComputeAccessRule(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRuleDirection? direction = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRuleDirection?), System.Collections.Generic.IEnumerable addressPrefixes = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeConfigurationExtension HybridComputeConfigurationExtension(string publisher = null, string configurationExtensionType = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeConnectionDetail HybridComputeConnectionDetail(Azure.Core.ResourceIdentifier id = null, string privateIPAddress = null, string linkIdentifier = null, string groupId = null, string memberName = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeDisk HybridComputeDisk(string path = null, string diskType = null, string generatedId = null, Azure.Core.ResourceIdentifier id = null, string name = null, long? maxSizeInBytes = default(long?), long? usedSpaceInBytes = default(long?)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueData HybridComputeExtensionValueData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string version = null, string extensionType = null, string publisher = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile HybridComputeFirmwareProfile(string serialNumber = null, string firmwareProfileType = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile HybridComputeHardwareProfile(long? totalPhysicalMemoryInBytes = default(long?), int? numberOfCpuSockets = default(int?), System.Collections.Generic.IEnumerable processors = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeIPAddress HybridComputeIPAddress(string address = null, string ipAddressVersion = null, string subnetAddressPrefix = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseData HybridComputeLicenseData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType? licenseType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails licenseDetails = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails HybridComputeLicenseDetails(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState? state = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget? target = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition? edition = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition?), Azure.ResourceManager.HybridCompute.Models.LicenseCoreType? licenseCoreType = default(Azure.ResourceManager.HybridCompute.Models.LicenseCoreType?), int? processors = default(int?), int? assignedLicenses = default(int?), string immutableId = null, System.Collections.Generic.IEnumerable volumeLicenseDetails = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData HybridComputeLicenseProfileData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), string assignedLicense = null, bool? softwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration HybridComputeLinuxConfiguration(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? assessmentMode = default(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType?), Azure.ResourceManager.HybridCompute.Models.PatchModeType? patchMode = default(Azure.ResourceManager.HybridCompute.Models.PatchModeType?), bool? isHotpatchingEnabled = default(bool?), Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus status = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(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), System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind = default(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, System.Guid? vmId = default(System.Guid?), string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, System.Guid? vmUuid = default(System.Guid?), System.Collections.Generic.IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, Azure.Core.ResourceIdentifier privateLinkScopeResourceId = null, Azure.Core.ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(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), System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind = default(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile hardwareProfile = null, System.Collections.Generic.IEnumerable storageDisks = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile firmwareProfile = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, System.Guid? vmId = default(System.Guid?), string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, System.Guid? vmUuid = default(System.Guid?), System.Collections.Generic.IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, Azure.Core.ResourceIdentifier privateLinkScopeResourceId = null, Azure.Core.ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable resources, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind, Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses, string cloudMetadataProvider, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile, string provisioningState, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status, System.DateTimeOffset? lastStatusChange, System.Collections.Generic.IEnumerable errorDetails, string agentVersion, System.Guid? vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, System.Guid? vmUuid, System.Collections.Generic.IEnumerable extensions, string osSku, string osEdition, string domainName, string adFqdn, string dnsFqdn, Azure.Core.ResourceIdentifier privateLinkScopeResourceId, Azure.Core.ResourceIdentifier parentClusterResourceId, string msSqlDiscovered, System.Collections.Generic.IReadOnlyDictionary detectedProperties, System.Collections.Generic.IEnumerable networkInterfaces) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionData HybridComputeMachineExtensionData(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), Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties properties = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(System.Collections.Generic.IEnumerable ipAddresses = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(System.Collections.Generic.IEnumerable ipAddresses) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(string macAddress = null, Azure.Core.ResourceIdentifier id = null, string name = null, System.Collections.Generic.IEnumerable ipAddresses = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkProfile HybridComputeNetworkProfile(System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile HybridComputeOSProfile(string computerName = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsConfiguration windowsConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration linuxConfiguration = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus HybridComputePatchSettingsStatus(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus? hotpatchEnablementStatus = default(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus?), Azure.ResponseError error = null) { throw null; } @@ -689,6 +885,7 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeData HybridComputePrivateLinkScopeData(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), Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopeProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopeProperties HybridComputePrivateLinkScopeProperties(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType?), string provisioningState = null, string privateLinkScopeId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkServiceConnectionStateProperty HybridComputePrivateLinkServiceConnectionStateProperty(string status = null, string description = null, string actionsRequired = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProcessor HybridComputeProcessor(string name = null, int? numberOfCores = default(int?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProductFeature HybridComputeProductFeature(string name = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssue HybridComputeProvisioningIssue(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueType? issueType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueSeverity? severity = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueSeverity?), string description = null, System.Collections.Generic.IEnumerable suggestedResourceIds = null, System.Collections.Generic.IEnumerable suggestedAccessRules = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation HybridComputeResourceAssociation(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode? accessMode = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode?)) { throw null; } @@ -701,6 +898,8 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties MachineExtensionProperties(string forceUpdateTag = null, string publisher = null, string machineExtensionPropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = default(bool?), bool? autoUpgradeMinorVersion = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView instanceView = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesContent MachineInstallPatchesContent(System.TimeSpan maximumDuration = default(System.TimeSpan), Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting rebootSetting = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting), Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsParameters windowsParameters = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxParameters linuxParameters = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesResult MachineInstallPatchesResult(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus? status = default(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus?), string installationActivityId = null, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus? rebootStatus = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus?), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? startedBy = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy?), Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? patchServiceUsed = default(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed?), Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType? osType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.MachineRunCommandData MachineRunCommandData(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), Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource source = null, System.Collections.Generic.IEnumerable parameters = null, System.Collections.Generic.IEnumerable protectedParameters = null, bool? asyncExecution = default(bool?), string runAsUser = null, string runAsPassword = null, int? timeoutInSeconds = default(int?), System.Uri outputBlobUri = null, System.Uri errorBlobUri = null, Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity outputBlobManagedIdentity = null, Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity errorBlobManagedIdentity = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView instanceView = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView MachineRunCommandInstanceView(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState? executionState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState?), string executionMessage = null, int? exitCode = default(int?), string output = null, string error = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeter NetworkSecurityPerimeter(string id = null, string perimeterGuid = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation resourceAssociation = null, Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterProfile profile = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterConfigurationReconcileResult NetworkSecurityPerimeterConfigurationReconcileResult(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } @@ -812,6 +1011,27 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.EsuServerType left, Azure.ResourceManager.HybridCompute.Models.EsuServerType right) { throw null; } public override string ToString() { throw null; } } + public partial class ExtensionsResourceStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ExtensionsResourceStatus() { } + public string Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType? Level { get { throw null; } } + public string Message { get { throw null; } } + public System.DateTimeOffset? Time { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public enum ExtensionsStatusLevelType + { + Info = 0, + Warning = 1, + Error = 2, + } public partial class ExtensionTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExtensionTargetProperties() { } @@ -921,6 +1141,71 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class HybridComputeDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeDisk() { } + public string DiskType { get { throw null; } } + public string GeneratedId { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public long? MaxSizeInBytes { get { throw null; } } + public string Name { get { throw null; } } + public string Path { get { throw null; } } + public long? UsedSpaceInBytes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HybridComputeExecutionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HybridComputeExecutionState(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Canceled { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Failed { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Pending { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Running { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Succeeded { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState TimedOut { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState 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.HybridCompute.Models.HybridComputeExecutionState left, Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState left, Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HybridComputeFirmwareProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeFirmwareProfile() { } + public string FirmwareProfileType { get { throw null; } } + public string SerialNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeFirmwareProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HybridComputeHardwareProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeHardwareProfile() { } + public int? NumberOfCpuSockets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Processors { get { throw null; } } + public long? TotalPhysicalMemoryInBytes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeHardwareProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class HybridComputeIPAddress : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal HybridComputeIPAddress() { } @@ -1141,7 +1426,10 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public partial class HybridComputeNetworkInterface : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal HybridComputeNetworkInterface() { } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } + public string MacAddress { get { throw null; } } + public string Name { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1268,6 +1556,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class HybridComputeProcessor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputeProcessor() { } + public string Name { get { throw null; } } + public int? NumberOfCores { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeProcessor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeProcessor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class HybridComputeProductFeature : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HybridComputeProductFeature() { } @@ -1838,6 +2138,38 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus left, Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class MachineRunCommandInstanceView : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MachineRunCommandInstanceView() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Error { get { throw null; } } + public string ExecutionMessage { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState? ExecutionState { get { throw null; } } + public int? ExitCode { get { throw null; } } + public string Output { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MachineRunCommandScriptSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MachineRunCommandScriptSource() { } + public string CommandId { get { throw null; } set { } } + public string Script { get { throw null; } set { } } + public System.Uri ScriptUri { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity ScriptUriManagedIdentity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NetworkSecurityPerimeter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NetworkSecurityPerimeter() { } @@ -1961,6 +2293,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class RunCommandInputParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RunCommandInputParameter(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandInputParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandInputParameter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RunCommandManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RunCommandManagedIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VmGuestPatchClassificationLinux : System.IEquatable { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index 5cb272e590b5..1850fbf1f7e2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_a837b681f8" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_331d7c5d31" } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayCollection.cs new file mode 100644 index 000000000000..2aceec4cc28b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayCollection.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_ArcGatewayCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateAGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_CreateOrUpdate.json + // this example is just showing the usage of "Gateways_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ArcGatewayResource + ArcGatewayCollection collection = resourceGroupResource.GetArcGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + ArcGatewayData data = new ArcGatewayData(new AzureLocation("eastus2euap")) + { + GatewayType = ArcGatewayType.Public, + AllowedFeatures = { "*" }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, gatewayName, data); + ArcGatewayResource 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 + ArcGatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Get.json + // this example is just showing the usage of "Gateways_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ArcGatewayResource + ArcGatewayCollection collection = resourceGroupResource.GetArcGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + ArcGatewayResource result = await collection.GetAsync(gatewayName); + + // 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 + ArcGatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListGatewaysByResourceGroup() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_ListByResourceGroup.json + // this example is just showing the usage of "Gateways_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ArcGatewayResource + ArcGatewayCollection collection = resourceGroupResource.GetArcGateways(); + + // invoke the operation and iterate over the result + await foreach (ArcGatewayResource 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 + ArcGatewayData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Get.json + // this example is just showing the usage of "Gateways_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ArcGatewayResource + ArcGatewayCollection collection = resourceGroupResource.GetArcGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + bool result = await collection.ExistsAsync(gatewayName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Get.json + // this example is just showing the usage of "Gateways_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ArcGatewayResource + ArcGatewayCollection collection = resourceGroupResource.GetArcGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + NullableResponse response = await collection.GetIfExistsAsync(gatewayName); + ArcGatewayResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // 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 + ArcGatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayResource.cs new file mode 100644 index 000000000000..a746219d8270 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ArcGatewayResource.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_ArcGatewayResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Get.json + // this example is just showing the usage of "Gateways_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 ArcGatewayResource created on azure + // for more information of creating ArcGatewayResource, please refer to the document of ArcGatewayResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + string gatewayName = "{gatewayName}"; + ResourceIdentifier arcGatewayResourceId = ArcGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + ArcGatewayResource arcGateway = client.GetArcGatewayResource(arcGatewayResourceId); + + // invoke the operation + ArcGatewayResource result = await arcGateway.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 + ArcGatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Delete.json + // this example is just showing the usage of "Gateways_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 ArcGatewayResource created on azure + // for more information of creating ArcGatewayResource, please refer to the document of ArcGatewayResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + string gatewayName = "{gatewayName}"; + ResourceIdentifier arcGatewayResourceId = ArcGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + ArcGatewayResource arcGateway = client.GetArcGatewayResource(arcGatewayResourceId); + + // invoke the operation + await arcGateway.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAGateway() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_Update.json + // this example is just showing the usage of "Gateways_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 ArcGatewayResource created on azure + // for more information of creating ArcGatewayResource, please refer to the document of ArcGatewayResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + string gatewayName = "{gatewayName}"; + ResourceIdentifier arcGatewayResourceId = ArcGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + ArcGatewayResource arcGateway = client.GetArcGatewayResource(arcGatewayResourceId); + + // invoke the operation + ArcGatewayPatch patch = new ArcGatewayPatch + { + AllowedFeatures = { "*" }, + }; + ArcGatewayResource result = await arcGateway.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 + ArcGatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs index c169f4638f71..e279ce6ab711 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeExtensionValueCollection [Ignore("Only validating compilation of examples")] public async Task Get_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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_GETAnExtensionsMetadata() [Ignore("Only validating compilation of examples")] public async Task GetAll_GETAListOfExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_List.json // this example is just showing the usage of "ExtensionMetadata_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 @@ -92,7 +92,7 @@ public async Task GetAll_GETAListOfExtensions() [Ignore("Only validating compilation of examples")] public async Task Exists_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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 @@ -123,7 +123,7 @@ public async Task Exists_GETAnExtensionsMetadata() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs index 666ac239ca20..53cc0c7ae544 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs @@ -19,7 +19,7 @@ public partial class Sample_HybridComputeExtensionValueResource [Ignore("Only validating compilation of examples")] public async Task Get_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs index 2e8c37f1ec14..bfa07ba63b7e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_HybridComputeLicenseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_CreateOrUpdate.json // this example is just showing the usage of "Licenses_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 @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateOrUpdateALicense() [Ignore("Only validating compilation of examples")] public async Task Get_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 @@ -100,7 +100,7 @@ public async Task Get_GetLicense() [Ignore("Only validating compilation of examples")] public async Task GetAll_GETAllMachineExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_ListByResourceGroup.json // this example is just showing the usage of "Licenses_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 @@ -135,7 +135,7 @@ public async Task GetAll_GETAllMachineExtensions() [Ignore("Only validating compilation of examples")] public async Task Exists_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 @@ -164,7 +164,7 @@ public async Task Exists_GetLicense() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs index 51766006f5a8..73a7eaeda5cd 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeLicenseProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_GetLicenseProfile() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_Get.json // this example is just showing the usage of "LicenseProfiles_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 @@ -50,7 +50,7 @@ public async Task Get_GetLicenseProfile() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteALicenseProfile() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_Delete.json // this example is just showing the usage of "LicenseProfiles_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 @@ -76,7 +76,7 @@ public async Task Delete_DeleteALicenseProfile() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateALicenseProfile() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_Update.json // this example is just showing the usage of "LicenseProfiles_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 @@ -119,7 +119,7 @@ public async Task Update_UpdateALicenseProfile() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateALicenseProfile() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json // this example is just showing the usage of "LicenseProfiles_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs index d3bbafefbb0a..54868a38816c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeLicenseResource [Ignore("Only validating compilation of examples")] public async Task Get_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 @@ -50,7 +50,7 @@ public async Task Get_GetLicense() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_Delete.json // this example is just showing the usage of "Licenses_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 @@ -76,7 +76,7 @@ public async Task Delete_DeleteALicense() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_CreateOrUpdate.json // this example is just showing the usage of "Licenses_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs index fa173821c05e..4a212ec60e00 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_HybridComputeMachineCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_CreateOrUpdate.json // this example is just showing the usage of "Machines_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 @@ -72,7 +72,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachine() [Ignore("Only validating compilation of examples")] public async Task Get_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -105,7 +105,7 @@ public async Task Get_GetMachine() [Ignore("Only validating compilation of examples")] public async Task Get_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -139,7 +139,7 @@ public async Task Get_GetMachineWithLicenseProfileInstanceView() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListMachinesByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_ListByResourceGroup.json // this example is just showing the usage of "Machines_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 @@ -174,7 +174,7 @@ public async Task GetAll_ListMachinesByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -203,7 +203,7 @@ public async Task Exists_GetMachine() [Ignore("Only validating compilation of examples")] public async Task Exists_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -233,7 +233,7 @@ public async Task Exists_GetMachineWithLicenseProfileInstanceView() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -274,7 +274,7 @@ public async Task GetIfExists_GetMachine() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs index 5bd0920162c9..54c09eaead09 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeMachineExtensionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_CreateOrUpdate.json // this example is just showing the usage of "MachineExtensions_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 @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() [Ignore("Only validating compilation of examples")] public async Task Get_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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 @@ -102,7 +102,7 @@ public async Task Get_GETMachineExtension() [Ignore("Only validating compilation of examples")] public async Task GetAll_GETAllMachineExtensionsList() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_List.json // this example is just showing the usage of "MachineExtensions_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 @@ -138,7 +138,7 @@ public async Task GetAll_GETAllMachineExtensionsList() [Ignore("Only validating compilation of examples")] public async Task Exists_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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 @@ -168,7 +168,7 @@ public async Task Exists_GETMachineExtension() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs index a077628f5768..39cdccb2a39a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeMachineExtensionResource [Ignore("Only validating compilation of examples")] public async Task Get_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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 @@ -51,7 +51,7 @@ public async Task Get_GETMachineExtension() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Delete.json // this example is just showing the usage of "MachineExtensions_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 @@ -78,7 +78,7 @@ public async Task Delete_DeleteAMachineExtension() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extension_Update.json // this example is just showing the usage of "MachineExtensions_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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs index a3aee38421ce..6486bafd6a56 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs @@ -22,7 +22,7 @@ public partial class Sample_HybridComputeMachineResource [Ignore("Only validating compilation of examples")] public async Task Get_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -52,7 +52,7 @@ public async Task Get_GetMachine() [Ignore("Only validating compilation of examples")] public async Task Get_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -83,7 +83,7 @@ public async Task Get_GetMachineWithLicenseProfileInstanceView() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Delete.json // this example is just showing the usage of "Machines_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 @@ -109,7 +109,7 @@ public async Task Delete_DeleteAMachine() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_Update.json // this example is just showing the usage of "Machines_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 @@ -160,7 +160,7 @@ public async Task Update_UpdateAMachine() [Ignore("Only validating compilation of examples")] public async Task AssessPatches_AssessPatchStateOfAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machine_AssessPatches.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machine_AssessPatches.json // this example is just showing the usage of "Machines_AssessPatches" 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 @@ -187,7 +187,7 @@ public async Task AssessPatches_AssessPatchStateOfAMachine() [Ignore("Only validating compilation of examples")] public async Task InstallPatches_InstallPatchStateOfAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machine_InstallPatches.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machine_InstallPatches.json // this example is just showing the usage of "Machines_InstallPatches" 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 @@ -222,7 +222,7 @@ public async Task InstallPatches_InstallPatchStateOfAMachine() [Ignore("Only validating compilation of examples")] public async Task UpgradeExtensions_UpgradeMachineExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extensions_Upgrade.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/extension/Extensions_Upgrade.json // this example is just showing the usage of "UpgradeExtensions" 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 @@ -262,7 +262,7 @@ public async Task UpgradeExtensions_UpgradeMachineExtensions() [Ignore("Only validating compilation of examples")] public async Task GetNetworkProfile_GETNetworkProfile() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/NetworkProfile_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/NetworkProfile_Get.json // this example is just showing the usage of "NetworkProfile_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 @@ -288,7 +288,7 @@ public async Task GetNetworkProfile_GETNetworkProfile() [Ignore("Only validating compilation of examples")] public async Task GetValidationDetailsForMachinePrivateLinkScope_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json // this example is just showing the usage of "PrivateLinkScopes_GetValidationDetailsForMachine" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs index ab51a8ab59d5..dcc9d40d46bb 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAG [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -96,7 +96,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json // this example is just showing the usage of "PrivateEndpointConnections_ListByPrivateLinkScope" 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 GetAll_GetsListOfPrivateEndpointConnectionsOnAPrivateLinkScope [Ignore("Only validating compilation of examples")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -162,7 +162,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs index 189620cd8c2d..bda70713b2dd 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -51,7 +51,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -78,7 +78,7 @@ public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() [Ignore("Only validating compilation of examples")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json // this example is just showing the usage of "PrivateEndpointConnections_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs index 2f0aca4ff3ef..290263fa8a43 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_HybridComputePrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs index 679b9ed43509..0fa15e7f991c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_HybridComputePrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_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 @@ -53,7 +53,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByPrivateLinkScope" 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 GetAll_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_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 @@ -119,7 +119,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs index 3d343d1ae59c..9f112991a03b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateLinkScopeCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateLinkScopeCreate() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Create.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -55,7 +55,7 @@ public async Task CreateOrUpdate_PrivateLinkScopeCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateLinkScopeUpdate() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -96,7 +96,7 @@ public async Task CreateOrUpdate_PrivateLinkScopeUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -129,7 +129,7 @@ public async Task Get_PrivateLinkScopeGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateLinkScopeListByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -164,7 +164,7 @@ public async Task GetAll_PrivateLinkScopeListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -193,7 +193,7 @@ public async Task Exists_PrivateLinkScopeGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs index 25b9e48ea2a5..1d8397923412 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateLinkScopeResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -50,7 +50,7 @@ public async Task Get_PrivateLinkScopeGet() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateLinkScopesDelete() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -76,7 +76,7 @@ public async Task Delete_PrivateLinkScopesDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateLinkScopeUpdateTagsOnly() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json // this example is just showing the usage of "PrivateLinkScopes_UpdateTags" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs new file mode 100644 index 000000000000..9d23ede650fc --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_MachineRunCommandCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateARunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_CreateOrUpdate.json + // this example is just showing the usage of "MachineRunCommands_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // get the collection of this MachineRunCommandResource + MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); + + // invoke the operation + string runCommandName = "myRunCommand"; + MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("eastus2")) + { + Source = new MachineRunCommandScriptSource + { + Script = "Write-Host Hello World!", + }, + Parameters = { new RunCommandInputParameter("param1", "value1"), new RunCommandInputParameter("param2", "value2") }, + AsyncExecution = false, + RunAsUser = "user1", + RunAsPassword = "", + TimeoutInSeconds = 3600, + OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), + ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, runCommandName, data); + MachineRunCommandResource 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 + MachineRunCommandData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetARunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Get.json + // this example is just showing the usage of "MachineRunCommands_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 HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // get the collection of this MachineRunCommandResource + MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); + + // invoke the operation + string runCommandName = "myRunCommand"; + MachineRunCommandResource result = await collection.GetAsync(runCommandName); + + // 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 + MachineRunCommandData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GETAllMachineRunCommands() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_List.json + // this example is just showing the usage of "MachineRunCommands_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 HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // get the collection of this MachineRunCommandResource + MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); + + // invoke the operation and iterate over the result + await foreach (MachineRunCommandResource 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 + MachineRunCommandData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetARunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Get.json + // this example is just showing the usage of "MachineRunCommands_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 HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // get the collection of this MachineRunCommandResource + MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); + + // invoke the operation + string runCommandName = "myRunCommand"; + bool result = await collection.ExistsAsync(runCommandName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetARunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Get.json + // this example is just showing the usage of "MachineRunCommands_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 HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // get the collection of this MachineRunCommandResource + MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); + + // invoke the operation + string runCommandName = "myRunCommand"; + NullableResponse response = await collection.GetIfExistsAsync(runCommandName); + MachineRunCommandResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // 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 + MachineRunCommandData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs new file mode 100644 index 000000000000..44683a0ecab2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.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.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_MachineRunCommandResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetARunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Get.json + // this example is just showing the usage of "MachineRunCommands_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 MachineRunCommandResource created on azure + // for more information of creating MachineRunCommandResource, please refer to the document of MachineRunCommandResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + string runCommandName = "myRunCommand"; + ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); + MachineRunCommandResource machineRunCommand = client.GetMachineRunCommandResource(machineRunCommandResourceId); + + // invoke the operation + MachineRunCommandResource result = await machineRunCommand.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 + MachineRunCommandData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAMachineRunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_Delete.json + // this example is just showing the usage of "MachineRunCommands_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 MachineRunCommandResource created on azure + // for more information of creating MachineRunCommandResource, please refer to the document of MachineRunCommandResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + string runCommandName = "myRunCommand"; + ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); + MachineRunCommandResource machineRunCommand = client.GetMachineRunCommandResource(machineRunCommandResourceId); + + // invoke the operation + await machineRunCommand.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateARunCommand() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/runCommand/RunCommands_CreateOrUpdate.json + // this example is just showing the usage of "MachineRunCommands_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineRunCommandResource created on azure + // for more information of creating MachineRunCommandResource, please refer to the document of MachineRunCommandResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + string runCommandName = "myRunCommand"; + ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); + MachineRunCommandResource machineRunCommand = client.GetMachineRunCommandResource(machineRunCommandResourceId); + + // invoke the operation + MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("eastus2")) + { + Source = new MachineRunCommandScriptSource + { + Script = "Write-Host Hello World!", + }, + Parameters = { new RunCommandInputParameter("param1", "value1"), new RunCommandInputParameter("param2", "value2") }, + AsyncExecution = false, + RunAsUser = "user1", + RunAsPassword = "", + TimeoutInSeconds = 3600, + OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), + ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), + }; + ArmOperation lro = await machineRunCommand.UpdateAsync(WaitUntil.Completed, data); + MachineRunCommandResource 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 + MachineRunCommandData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs index af2f33e395c5..53d98d3bdbb5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" 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 @@ -53,7 +53,7 @@ public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLi [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsTheListOfNetworkSecurityPerimeterConfigurationsOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_ListByPrivateLinkScope" 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 GetAll_GetsTheListOfNetworkSecurityPerimeterConfigurationsOfTh [Ignore("Only validating compilation of examples")] public async Task Exists_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" 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 @@ -119,7 +119,7 @@ public async Task Exists_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivat [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs index 65cf5d12f310..2f82d48e2297 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" 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 @@ -51,7 +51,7 @@ public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLi [Ignore("Only validating compilation of examples")] public async Task ReconcileForPrivateLinkScope_ReconcilesTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_ReconcileForPrivateLinkScope" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs new file mode 100644 index 000000000000..4e4d78681c32 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_ResourceGroupResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task UpdateSetting_SettingsUpdate() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/settings/SettingsUpdate.json + // this example is just showing the usage of "Settings_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "hybridRG"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string baseProvider = "Microsoft.HybridCompute"; + string baseResourceType = "machines"; + string baseResourceName = "testMachine"; + string settingsResourceName = "default"; + ArcSettings arcSettings = new ArcSettings + { + GatewayResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), + }; + ArcSettings result = await resourceGroupResource.UpdateSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 7c90db3d8343..c72c99722122 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task ValidateLicenseLicense_ValidateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ValidateLicense.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_ValidateLicense.json // this example is just showing the usage of "Licenses_ValidateLicense" 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 @@ -62,7 +62,7 @@ public async Task ValidateLicenseLicense_ValidateALicense() [Ignore("Only validating compilation of examples")] public async Task GetHybridComputeLicenses_ListLicensesBySubscription() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/license/License_ListBySubscription.json // this example is just showing the usage of "Licenses_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 @@ -93,7 +93,7 @@ public async Task GetHybridComputeLicenses_ListLicensesBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetHybridComputeMachines_ListMachinesByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/machine/Machines_ListBySubscription.json // this example is just showing the usage of "Machines_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 @@ -120,11 +120,42 @@ public async Task GetHybridComputeMachines_ListMachinesByResourceGroup() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetArcGateways_ListGatewaysBySubscription() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/gateway/Gateway_ListBySubscription.json + // this example is just showing the usage of "Gateways_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ArcGatewayResource item in subscriptionResource.GetArcGatewaysAsync()) + { + // 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 + ArcGatewayData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetHybridComputePrivateLinkScopes_PrivateLinkScopesListJson() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_List.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -155,7 +186,7 @@ public async Task GetHybridComputePrivateLinkScopes_PrivateLinkScopesListJson() [Ignore("Only validating compilation of examples")] public async Task GetValidationDetailsPrivateLinkScope_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-07-31-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json // this example is just showing the usage of "PrivateLinkScopes_GetValidationDetails" 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayCollection.cs new file mode 100644 index 000000000000..3a0c1fdd8481 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayCollection.cs @@ -0,0 +1,494 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetArcGateways method from an instance of . + /// + public partial class ArcGatewayCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _arcGatewayGatewaysClientDiagnostics; + private readonly GatewaysRestOperations _arcGatewayGatewaysRestClient; + + /// Initializes a new instance of the class for mocking. + protected ArcGatewayCollection() + { + } + + /// 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 ArcGatewayCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _arcGatewayGatewaysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ArcGatewayResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ArcGatewayResource.ResourceType, out string arcGatewayGatewaysApiVersion); + _arcGatewayGatewaysRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, arcGatewayGatewaysApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// The operation to create or update a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Gateway. + /// Parameters supplied to the Create gateway operation. + /// 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 gatewayName, ArcGatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new ArcGatewayOperationSource(Client), _arcGatewayGatewaysClientDiagnostics, Pipeline, _arcGatewayGatewaysRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create or update a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Gateway. + /// Parameters supplied to the Create gateway operation. + /// 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 gatewayName, ArcGatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken); + var operation = new HybridComputeArmOperation(new ArcGatewayOperationSource(Client), _arcGatewayGatewaysClientDiagnostics, Pipeline, _arcGatewayGatewaysRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.Get"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.Get"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _arcGatewayGatewaysRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _arcGatewayGatewaysRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArcGatewayResource(Client, ArcGatewayData.DeserializeArcGatewayData(e)), _arcGatewayGatewaysClientDiagnostics, Pipeline, "ArcGatewayCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _arcGatewayGatewaysRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _arcGatewayGatewaysRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArcGatewayResource(Client, ArcGatewayData.DeserializeArcGatewayData(e)), _arcGatewayGatewaysClientDiagnostics, Pipeline, "ArcGatewayCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.Exists"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, 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.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.Exists"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayCollection.GetIfExists"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.Serialization.cs new file mode 100644 index 000000000000..99189db66b0e --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.Serialization.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class ArcGatewayData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArcGatewayData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(GatewayId)) + { + writer.WritePropertyName("gatewayId"u8); + writer.WriteStringValue(GatewayId); + } + if (Optional.IsDefined(GatewayType)) + { + writer.WritePropertyName("gatewayType"u8); + writer.WriteStringValue(GatewayType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(GatewayEndpoint)) + { + writer.WritePropertyName("gatewayEndpoint"u8); + writer.WriteStringValue(GatewayEndpoint); + } + if (Optional.IsCollectionDefined(AllowedFeatures)) + { + writer.WritePropertyName("allowedFeatures"u8); + writer.WriteStartArray(); + foreach (var item in AllowedFeatures) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + ArcGatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArcGatewayData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArcGatewayData(document.RootElement, options); + } + + internal static ArcGatewayData DeserializeArcGatewayData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + HybridComputeProvisioningState? provisioningState = default; + ResourceIdentifier gatewayId = default; + ArcGatewayType? gatewayType = default; + string gatewayEndpoint = default; + IList allowedFeatures = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + 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("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HybridComputeProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("gatewayId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("gatewayType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayType = new ArcGatewayType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("gatewayEndpoint"u8)) + { + gatewayEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("allowedFeatures"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedFeatures = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArcGatewayData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + provisioningState, + gatewayId, + gatewayType, + gatewayEndpoint, + allowedFeatures ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gatewayId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GatewayId)) + { + builder.Append(" gatewayId: "); + builder.AppendLine($"'{GatewayId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gatewayType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GatewayType)) + { + builder.Append(" gatewayType: "); + builder.AppendLine($"'{GatewayType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gatewayEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GatewayEndpoint)) + { + builder.Append(" gatewayEndpoint: "); + if (GatewayEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GatewayEndpoint}'''"); + } + else + { + builder.AppendLine($"'{GatewayEndpoint}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AllowedFeatures), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" allowedFeatures: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AllowedFeatures)) + { + if (AllowedFeatures.Any()) + { + builder.Append(" allowedFeatures: "); + builder.AppendLine("["); + foreach (var item in AllowedFeatures) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ArcGatewayData)} does not support writing '{options.Format}' format."); + } + } + + ArcGatewayData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeArcGatewayData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArcGatewayData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.cs new file mode 100644 index 000000000000..6435c0e740ce --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayData.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing the ArcGateway data model. + /// Describes an Arc Gateway. + /// + public partial class ArcGatewayData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public ArcGatewayData(AzureLocation location) : base(location) + { + AllowedFeatures = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state, which only appears in the response. + /// A unique, immutable, identifier for the Gateway. + /// The type of the Gateway resource. + /// The endpoint fqdn for the Gateway. + /// Specifies the list of features that are enabled for this Gateway. + /// Keeps track of any properties unknown to the library. + internal ArcGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, ResourceIdentifier gatewayId, ArcGatewayType? gatewayType, string gatewayEndpoint, IList allowedFeatures, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + GatewayId = gatewayId; + GatewayType = gatewayType; + GatewayEndpoint = gatewayEndpoint; + AllowedFeatures = allowedFeatures; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ArcGatewayData() + { + } + + /// The provisioning state, which only appears in the response. + [WirePath("properties.provisioningState")] + public HybridComputeProvisioningState? ProvisioningState { get; } + /// A unique, immutable, identifier for the Gateway. + [WirePath("properties.gatewayId")] + public ResourceIdentifier GatewayId { get; } + /// The type of the Gateway resource. + [WirePath("properties.gatewayType")] + public ArcGatewayType? GatewayType { get; set; } + /// The endpoint fqdn for the Gateway. + [WirePath("properties.gatewayEndpoint")] + public string GatewayEndpoint { get; } + /// Specifies the list of features that are enabled for this Gateway. + [WirePath("properties.allowedFeatures")] + public IList AllowedFeatures { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.Serialization.cs new file mode 100644 index 000000000000..f89ed85ed2d6 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class ArcGatewayResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ArcGatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ArcGatewayData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.cs new file mode 100644 index 000000000000..f58c3205c5f0 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArcGatewayResource.cs @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A Class representing an ArcGateway along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetArcGatewayResource method. + /// Otherwise you can get one from its parent resource using the GetArcGateway method. + /// + public partial class ArcGatewayResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The gatewayName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string gatewayName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _arcGatewayGatewaysClientDiagnostics; + private readonly GatewaysRestOperations _arcGatewayGatewaysRestClient; + private readonly ArcGatewayData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/gateways"; + + /// Initializes a new instance of the class for mocking. + protected ArcGatewayResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ArcGatewayResource(ArmClient client, ArcGatewayData 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 ArcGatewayResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _arcGatewayGatewaysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string arcGatewayGatewaysApiVersion); + _arcGatewayGatewaysRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, arcGatewayGatewaysApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 ArcGatewayData 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)); + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.Get"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.Get"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to delete a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Delete + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.Delete"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(_arcGatewayGatewaysClientDiagnostics, Pipeline, _arcGatewayGatewaysRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to delete a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Delete + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.Delete"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new HybridComputeArmOperation(_arcGatewayGatewaysClientDiagnostics, Pipeline, _arcGatewayGatewaysRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to update a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Update + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters supplied to the Update gateway operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ArcGatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.Update"); + scope.Start(); + try + { + var response = await _arcGatewayGatewaysRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to update a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Update + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters supplied to the Update gateway operation. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ArcGatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.Update"); + scope.Start(); + try + { + var response = _arcGatewayGatewaysRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new ArcGatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArcGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ArcGatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ArcGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ArcGatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArcGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ArcGatewayPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ArcGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ArcGatewayPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _arcGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArcGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ArcGatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _arcGatewayGatewaysClientDiagnostics.CreateScope("ArcGatewayResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _arcGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ArcGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ArcGatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs index d7776820c59c..b24d2e663169 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -85,6 +86,9 @@ public static HybridComputeLicenseDetails HybridComputeLicenseDetails(HybridComp /// Metadata pertaining to the geographic location of the resource. /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. /// Statuses of dependent services that are reported back to ARM. + /// Information about the machine's hardware. + /// Information about the machine's storage. + /// Information about the machine's firmware. /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). /// The info of the machine w.r.t Agent Upgrade. /// Specifies the operating system settings for the hybrid machine. @@ -114,10 +118,11 @@ public static HybridComputeLicenseDetails HybridComputeLicenseDetails(HybridComp /// Detected properties from the machine. /// Information about the network the machine is on. /// A new instance for mocking. - public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resources = null, ManagedServiceIdentity identity = null, ArcKindEnum? kind = null, HybridComputeLocation locationData = null, AgentConfiguration agentConfiguration = null, HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, AgentUpgrade agentUpgrade = null, HybridComputeOSProfile osProfile = null, LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, HybridComputeStatusType? status = null, DateTimeOffset? lastStatusChange = null, IEnumerable errorDetails = null, string agentVersion = null, Guid? vmId = null, string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, Guid? vmUuid = null, IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, ResourceIdentifier privateLinkScopeResourceId = null, ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, IReadOnlyDictionary detectedProperties = null, IEnumerable networkInterfaces = null) + public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resources = null, ManagedServiceIdentity identity = null, ArcKindEnum? kind = null, HybridComputeLocation locationData = null, AgentConfiguration agentConfiguration = null, HybridComputeServiceStatuses serviceStatuses = null, HybridComputeHardwareProfile hardwareProfile = null, IEnumerable storageDisks = null, HybridComputeFirmwareProfile firmwareProfile = null, string cloudMetadataProvider = null, AgentUpgrade agentUpgrade = null, HybridComputeOSProfile osProfile = null, LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, HybridComputeStatusType? status = null, DateTimeOffset? lastStatusChange = null, IEnumerable errorDetails = null, string agentVersion = null, Guid? vmId = null, string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, Guid? vmUuid = null, IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, ResourceIdentifier privateLinkScopeResourceId = null, ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, IReadOnlyDictionary detectedProperties = null, IEnumerable networkInterfaces = null) { tags ??= new Dictionary(); resources ??= new List(); + storageDisks ??= new List(); errorDetails ??= new List(); extensions ??= new List(); detectedProperties ??= new Dictionary(); @@ -136,6 +141,9 @@ public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifi locationData, agentConfiguration, serviceStatuses, + hardwareProfile, + storageDisks != null ? new StorageProfile(storageDisks?.ToList(), serializedAdditionalRawData: null) : null, + firmwareProfile, cloudMetadataProvider != null ? new HybridComputeCloudMetadata(cloudMetadataProvider, serializedAdditionalRawData: null) : null, agentUpgrade, osProfile, @@ -205,10 +213,62 @@ public static HybridComputeConfigurationExtension HybridComputeConfigurationExte return new HybridComputeConfigurationExtension(publisher, configurationExtensionType, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The total physical memory on the machine. + /// The total number of CPU sockets available on the machine. + /// The physical processors of the machine. + /// A new instance for mocking. + public static HybridComputeHardwareProfile HybridComputeHardwareProfile(long? totalPhysicalMemoryInBytes = null, int? numberOfCpuSockets = null, IEnumerable processors = null) + { + processors ??= new List(); + + return new HybridComputeHardwareProfile(totalPhysicalMemoryInBytes, numberOfCpuSockets, processors?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the processor. + /// The total number of physical cores on the processor. + /// A new instance for mocking. + public static HybridComputeProcessor HybridComputeProcessor(string name = null, int? numberOfCores = null) + { + return new HybridComputeProcessor(name, numberOfCores, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The path of the disk. + /// The type of the disk. + /// The generated ID of the disk. + /// The ID of the disk. + /// The name of the disk. + /// The size of the disk, in bytes. + /// The amount of space used on the disk, in bytes. + /// A new instance for mocking. + public static HybridComputeDisk HybridComputeDisk(string path = null, string diskType = null, string generatedId = null, ResourceIdentifier id = null, string name = null, long? maxSizeInBytes = null, long? usedSpaceInBytes = null) + { + return new HybridComputeDisk( + path, + diskType, + generatedId, + id, + name, + maxSizeInBytes, + usedSpaceInBytes, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The serial number of the firmware. + /// The type of the firmware. + /// A new instance for mocking. + public static HybridComputeFirmwareProfile HybridComputeFirmwareProfile(string serialNumber = null, string firmwareProfileType = null) + { + return new HybridComputeFirmwareProfile(serialNumber, firmwareProfileType, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Specifies the version info w.r.t AgentUpgrade for the machine. - /// The correlation ID passed in from RSM per upgrade. - /// Specifies if RSM should try to upgrade this machine. + /// The correlation ID associated with an agent upgrade operation. + /// Specifies if the machine's agent should be upgraded. /// Specifies the version of the last attempt. /// Timestamp of last upgrade attempt. /// Specifies the status of Agent Upgrade. @@ -399,13 +459,16 @@ public static HybridComputeNetworkProfile HybridComputeNetworkProfile(IEnumerabl } /// Initializes a new instance of . + /// Represents MAC address of the network interface. + /// Represents the ID of the network interface. + /// Represents the name of the network interface. /// The list of IP addresses in this interface. /// A new instance for mocking. - public static HybridComputeNetworkInterface HybridComputeNetworkInterface(IEnumerable ipAddresses = null) + public static HybridComputeNetworkInterface HybridComputeNetworkInterface(string macAddress = null, ResourceIdentifier id = null, string name = null, IEnumerable ipAddresses = null) { ipAddresses ??= new List(); - return new HybridComputeNetworkInterface(ipAddresses?.ToList(), serializedAdditionalRawData: null); + return new HybridComputeNetworkInterface(macAddress, id, name, ipAddresses?.ToList(), serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -654,6 +717,153 @@ public static HybridComputeExtensionValueData HybridComputeExtensionValueData(Re serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The source of the run command script. + /// The parameters used by the script. + /// The parameters used by the script. + /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. + /// Specifies the user account on the machine when executing the run command. + /// Specifies the user account password on the machine when executing the run command. + /// The timeout in seconds to execute the run command. + /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. + /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. + /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + /// The provisioning state, which only appears in the response. + /// The machine run command instance view. + /// A new instance for mocking. + public static MachineRunCommandData MachineRunCommandData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineRunCommandScriptSource source = null, IEnumerable parameters = null, IEnumerable protectedParameters = null, bool? asyncExecution = null, string runAsUser = null, string runAsPassword = null, int? timeoutInSeconds = null, Uri outputBlobUri = null, Uri errorBlobUri = null, RunCommandManagedIdentity outputBlobManagedIdentity = null, RunCommandManagedIdentity errorBlobManagedIdentity = null, string provisioningState = null, MachineRunCommandInstanceView instanceView = null) + { + tags ??= new Dictionary(); + parameters ??= new List(); + protectedParameters ??= new List(); + + return new MachineRunCommandData( + id, + name, + resourceType, + systemData, + tags, + location, + source, + parameters?.ToList(), + protectedParameters?.ToList(), + asyncExecution, + runAsUser, + runAsPassword, + timeoutInSeconds, + outputBlobUri, + errorBlobUri, + outputBlobManagedIdentity, + errorBlobManagedIdentity, + provisioningState, + instanceView, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Script execution status. + /// Communicate script configuration errors or execution messages. + /// Exit code returned from script execution. + /// Script output stream. + /// Script error stream. + /// Script start time. + /// Script end time. + /// The status information. + /// A new instance for mocking. + public static MachineRunCommandInstanceView MachineRunCommandInstanceView(HybridComputeExecutionState? executionState = null, string executionMessage = null, int? exitCode = null, string output = null, string error = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable statuses = null) + { + statuses ??= new List(); + + return new MachineRunCommandInstanceView( + executionState, + executionMessage, + exitCode, + output, + error, + startOn, + endOn, + statuses?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status code. + /// The level code. + /// The short localizable label for the status. + /// The detailed status message, including for alerts and error messages. + /// The time of the status. + /// A new instance for mocking. + public static ExtensionsResourceStatus ExtensionsResourceStatus(string code = null, ExtensionsStatusLevelType? level = null, string displayStatus = null, string message = null, DateTimeOffset? time = null) + { + return new ExtensionsResourceStatus( + code, + level, + displayStatus, + message, + time, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state, which only appears in the response. + /// A unique, immutable, identifier for the Gateway. + /// The type of the Gateway resource. + /// The endpoint fqdn for the Gateway. + /// Specifies the list of features that are enabled for this Gateway. + /// A new instance for mocking. + public static ArcGatewayData ArcGatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, ResourceIdentifier gatewayId = null, ArcGatewayType? gatewayType = null, string gatewayEndpoint = null, IEnumerable allowedFeatures = null) + { + tags ??= new Dictionary(); + allowedFeatures ??= new List(); + + return new ArcGatewayData( + id, + name, + resourceType, + systemData, + tags, + location, + provisioningState, + gatewayId, + gatewayType, + gatewayEndpoint, + allowedFeatures?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure resource tenant Id. + /// Associated Gateway Resource Id. + /// A new instance for mocking. + public static ArcSettings ArcSettings(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? tenantId = null, ResourceIdentifier gatewayResourceId = null) + { + return new ArcSettings( + id, + name, + resourceType, + systemData, + tenantId, + gatewayResourceId, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -921,5 +1131,62 @@ public static NetworkSecurityPerimeterConfigurationReconcileResult NetworkSecuri { return new NetworkSecurityPerimeterConfigurationReconcileResult(location, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The list of extensions affiliated to the machine. + /// Identity for the resource. Current supported identity types: SystemAssigned. + /// Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. + /// Metadata pertaining to the geographic location of the resource. + /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + /// Statuses of dependent services that are reported back to ARM. + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + /// The info of the machine w.r.t Agent Upgrade. + /// Specifies the operating system settings for the hybrid machine. + /// Specifies the License related properties for a machine. + /// The provisioning state, which only appears in the response. + /// The status of the hybrid machine agent. + /// The time of the last status change. + /// Details about the error state. + /// The hybrid machine agent full version. + /// Specifies the hybrid machine unique ID. + /// Specifies the hybrid machine display name. + /// Specifies the hybrid machine FQDN. + /// Public Key that the client provides to be used during initial resource onboarding. + /// The Operating System running on the hybrid machine. + /// The version of Operating System running on the hybrid machine. + /// The type of Operating System (windows/linux). + /// Specifies the Arc Machine's unique SMBIOS ID. + /// Machine Extensions information (deprecated field). + /// Specifies the Operating System product SKU. + /// The edition of the Operating System. + /// Specifies the Windows domain name. + /// Specifies the AD fully qualified display name. + /// Specifies the DNS fully qualified display name. + /// The resource id of the private link scope this machine is assigned to, if any. + /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + /// Specifies whether any MS SQL instance is discovered on the machine. + /// Detected properties from the machine. + /// Information about the network the machine is on. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IEnumerable resources, ManagedServiceIdentity identity, ArcKindEnum? kind, HybridComputeLocation locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, string cloudMetadataProvider, AgentUpgrade agentUpgrade, HybridComputeOSProfile osProfile, LicenseProfileMachineInstanceView licenseProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IEnumerable errorDetails, string agentVersion, Guid? vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, Guid? vmUuid, IEnumerable extensions, string osSku, string osEdition, string domainName, string adFqdn, string dnsFqdn, ResourceIdentifier privateLinkScopeResourceId, ResourceIdentifier parentClusterResourceId, string msSqlDiscovered, IReadOnlyDictionary detectedProperties, IEnumerable networkInterfaces) + { + return HybridComputeMachineData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, resources: resources, identity: identity, kind: kind, locationData: locationData, agentConfiguration: agentConfiguration, serviceStatuses: serviceStatuses, hardwareProfile: default, storageDisks: default, firmwareProfile: default, cloudMetadataProvider: cloudMetadataProvider, agentUpgrade: agentUpgrade, osProfile: osProfile, licenseProfile: licenseProfile, provisioningState: provisioningState, status: status, lastStatusChange: lastStatusChange, errorDetails: errorDetails, agentVersion: agentVersion, vmId: vmId, displayName: displayName, machineFqdn: machineFqdn, clientPublicKey: clientPublicKey, osName: osName, osVersion: osVersion, osType: osType, vmUuid: vmUuid, extensions: extensions, osSku: osSku, osEdition: osEdition, domainName: domainName, adFqdn: adFqdn, dnsFqdn: dnsFqdn, privateLinkScopeResourceId: privateLinkScopeResourceId, parentClusterResourceId: parentClusterResourceId, msSqlDiscovered: msSqlDiscovered, detectedProperties: detectedProperties, networkInterfaces: networkInterfaces); + } + + /// Initializes a new instance of . + /// The list of IP addresses in this interface. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HybridComputeNetworkInterface HybridComputeNetworkInterface(IEnumerable ipAddresses) + { + return HybridComputeNetworkInterface(macAddress: default, id: default, name: default, ipAddresses: ipAddresses); + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs index 38fd0b7b7629..4ef5ae9741ac 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -128,6 +128,44 @@ public static HybridComputeExtensionValueResource GetHybridComputeExtensionValue return GetMockableHybridComputeArmClient(client).GetHybridComputeExtensionValueResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineRunCommandResource GetMachineRunCommandResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridComputeArmClient(client).GetMachineRunCommandResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ArcGatewayResource GetArcGatewayResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridComputeArmClient(client).GetArcGatewayResource(id); + } + /// /// 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. @@ -234,7 +272,7 @@ public static HybridComputeLicenseCollection GetHybridComputeLicenses(this Resou /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -272,7 +310,7 @@ public static async Task> GetHybridComput /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -327,7 +365,7 @@ public static HybridComputeMachineCollection GetHybridComputeMachines(this Resou /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -366,7 +404,7 @@ public static async Task> GetHybridComput /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -392,6 +430,99 @@ public static Response GetHybridComputeMachine(thi return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeMachine(machineName, expand, cancellationToken); } + /// + /// Gets a collection of ArcGatewayResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ArcGatewayResources and their operations over a ArcGatewayResource. + public static ArcGatewayCollection GetArcGateways(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetArcGateways(); + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Gateway. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetArcGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetArcGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Gateway. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetArcGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetArcGateway(gatewayName, cancellationToken); + } + /// /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. /// @@ -422,7 +553,7 @@ public static HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -460,7 +591,7 @@ public static async Task> GetHyb /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -485,6 +616,80 @@ public static Response GetHybridComputePr return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputePrivateLinkScope(scopeName, cancellationToken); } + /// + /// Updates the base Settings of the target resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} + /// + /// + /// Operation Id + /// Settings_Update + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the base Resource Provider. + /// The name of the base Resource Type. + /// The name of the base resource. + /// The name of the settings resource. + /// Settings details. + /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , , , or is null. + public static async Task> UpdateSettingAsync(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the base Settings of the target resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} + /// + /// + /// Operation Id + /// Settings_Update + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the base Resource Provider. + /// The name of the base Resource Type. + /// The name of the base resource. + /// The name of the settings resource. + /// Settings details. + /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , , , or is null. + public static Response UpdateSetting(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateSetting(baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings, cancellationToken); + } + /// /// Gets a collection of HybridComputeExtensionValueResources in the SubscriptionResource. /// @@ -519,7 +724,7 @@ public static HybridComputeExtensionValueCollection GetHybridComputeExtensionVal /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -560,7 +765,7 @@ public static async Task> GetHybri /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -601,7 +806,7 @@ public static Response GetHybridComputeExte /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -638,7 +843,7 @@ public static async Task> ValidateLic /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -675,7 +880,7 @@ public static ArmOperation ValidateLicenseLicense( /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -711,7 +916,7 @@ public static AsyncPageable GetHybridComputeLicens /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -747,7 +952,7 @@ public static Pageable GetHybridComputeLicenses(th /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -783,7 +988,7 @@ public static AsyncPageable GetHybridComputeMachin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -806,6 +1011,78 @@ public static Pageable GetHybridComputeMachines(th return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeMachines(cancellationToken); } + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetArcGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetArcGatewaysAsync(cancellationToken); + } + + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetArcGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetArcGateways(cancellationToken); + } + /// /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// @@ -819,7 +1096,7 @@ public static Pageable GetHybridComputeMachines(th /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -855,7 +1132,7 @@ public static AsyncPageable GetHybridComp /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -891,7 +1168,7 @@ public static Pageable GetHybridComputePr /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -929,7 +1206,7 @@ public static async Task> GetValidat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs index 317c7b7485b9..81fdfe414eab 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs @@ -94,6 +94,30 @@ public virtual HybridComputeExtensionValueResource GetHybridComputeExtensionValu return new HybridComputeExtensionValueResource(Client, id); } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual MachineRunCommandResource GetMachineRunCommandResource(ResourceIdentifier id) + { + MachineRunCommandResource.ValidateResourceId(id); + return new MachineRunCommandResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ArcGatewayResource GetArcGatewayResource(ResourceIdentifier id) + { + ArcGatewayResource.ValidateResourceId(id); + return new ArcGatewayResource(Client, id); + } + /// /// 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. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs index 475986939d06..155a43a8062c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs @@ -9,12 +9,17 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; namespace Azure.ResourceManager.HybridCompute.Mocking { /// A class to add extension methods to ResourceGroupResource. public partial class MockableHybridComputeResourceGroupResource : ArmResource { + private ClientDiagnostics _settingsClientDiagnostics; + private SettingsRestOperations _settingsRestClient; + /// Initializes a new instance of the class for mocking. protected MockableHybridComputeResourceGroupResource() { @@ -27,6 +32,9 @@ internal MockableHybridComputeResourceGroupResource(ArmClient client, ResourceId { } + private ClientDiagnostics SettingsClientDiagnostics => _settingsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private SettingsRestOperations SettingsRestClient => _settingsRestClient ??= new SettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); @@ -53,7 +61,7 @@ public virtual HybridComputeLicenseCollection GetHybridComputeLicenses() /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -84,7 +92,7 @@ public virtual async Task> GetHybridCompu /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -122,7 +130,7 @@ public virtual HybridComputeMachineCollection GetHybridComputeMachines() /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -154,7 +162,7 @@ public virtual async Task> GetHybridCompu /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -173,6 +181,75 @@ public virtual Response GetHybridComputeMachine(st return GetHybridComputeMachines().Get(machineName, expand, cancellationToken); } + /// Gets a collection of ArcGatewayResources in the ResourceGroupResource. + /// An object representing collection of ArcGatewayResources and their operations over a ArcGatewayResource. + public virtual ArcGatewayCollection GetArcGateways() + { + return GetCachedClient(client => new ArcGatewayCollection(client, Id)); + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArcGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) + { + return await GetArcGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves information about the view of a gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateways_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Gateway. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArcGateway(string gatewayName, CancellationToken cancellationToken = default) + { + return GetArcGateways().Get(gatewayName, cancellationToken); + } + /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. /// An object representing collection of HybridComputePrivateLinkScopeResources and their operations over a HybridComputePrivateLinkScopeResource. public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() @@ -193,7 +270,7 @@ public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLi /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -224,7 +301,7 @@ public virtual async Task> GetHy /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -241,5 +318,99 @@ public virtual Response GetHybridComputeP { return GetHybridComputePrivateLinkScopes().Get(scopeName, cancellationToken); } + + /// + /// Updates the base Settings of the target resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} + /// + /// + /// Operation Id + /// Settings_Update + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// + /// The name of the base Resource Provider. + /// The name of the base Resource Type. + /// The name of the base resource. + /// The name of the settings resource. + /// Settings details. + /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. + public virtual async Task> UpdateSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); + Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); + Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); + Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); + Argument.AssertNotNull(arcSettings, nameof(arcSettings)); + + using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateSetting"); + scope.Start(); + try + { + var response = await SettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the base Settings of the target resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} + /// + /// + /// Operation Id + /// Settings_Update + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// + /// The name of the base Resource Provider. + /// The name of the base Resource Type. + /// The name of the base resource. + /// The name of the settings resource. + /// Settings details. + /// The cancellation token to use. + /// , , or is an empty string, and was expected to be non-empty. + /// , , , or is null. + public virtual Response UpdateSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); + Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); + Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); + Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); + Argument.AssertNotNull(arcSettings, nameof(arcSettings)); + + using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateSetting"); + scope.Start(); + try + { + var response = SettingsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs index 59489434be50..cb894c33b773 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs @@ -22,6 +22,8 @@ public partial class MockableHybridComputeSubscriptionResource : ArmResource private LicensesRestOperations _hybridComputeLicenseLicensesRestClient; private ClientDiagnostics _hybridComputeMachineMachinesClientDiagnostics; private MachinesRestOperations _hybridComputeMachineMachinesRestClient; + private ClientDiagnostics _arcGatewayGatewaysClientDiagnostics; + private GatewaysRestOperations _arcGatewayGatewaysRestClient; private ClientDiagnostics _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics; private PrivateLinkScopesRestOperations _hybridComputePrivateLinkScopePrivateLinkScopesRestClient; @@ -41,6 +43,8 @@ internal MockableHybridComputeSubscriptionResource(ArmClient client, ResourceIde private LicensesRestOperations HybridComputeLicenseLicensesRestClient => _hybridComputeLicenseLicensesRestClient ??= new LicensesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputeLicenseResource.ResourceType)); private ClientDiagnostics HybridComputeMachineMachinesClientDiagnostics => _hybridComputeMachineMachinesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputeMachineResource.ResourceType.Namespace, Diagnostics); private MachinesRestOperations HybridComputeMachineMachinesRestClient => _hybridComputeMachineMachinesRestClient ??= new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputeMachineResource.ResourceType)); + private ClientDiagnostics ArcGatewayGatewaysClientDiagnostics => _arcGatewayGatewaysClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ArcGatewayResource.ResourceType.Namespace, Diagnostics); + private GatewaysRestOperations ArcGatewayGatewaysRestClient => _arcGatewayGatewaysRestClient ??= new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ArcGatewayResource.ResourceType)); private ClientDiagnostics HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics => _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputePrivateLinkScopeResource.ResourceType.Namespace, Diagnostics); private PrivateLinkScopesRestOperations HybridComputePrivateLinkScopePrivateLinkScopesRestClient => _hybridComputePrivateLinkScopePrivateLinkScopesRestClient ??= new PrivateLinkScopesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputePrivateLinkScopeResource.ResourceType)); @@ -75,7 +79,7 @@ public virtual HybridComputeExtensionValueCollection GetHybridComputeExtensionVa /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -109,7 +113,7 @@ public virtual async Task> GetHybr /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -143,7 +147,7 @@ public virtual Response GetHybridComputeExt /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -189,7 +193,7 @@ public virtual async Task> ValidateLi /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -235,7 +239,7 @@ public virtual ArmOperation ValidateLicenseLicense /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -265,7 +269,7 @@ public virtual AsyncPageable GetHybridComputeLicen /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -295,7 +299,7 @@ public virtual Pageable GetHybridComputeLicenses(C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -325,7 +329,7 @@ public virtual AsyncPageable GetHybridComputeMachi /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -342,6 +346,66 @@ public virtual Pageable GetHybridComputeMachines(C return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeMachines", "value", "nextLink", cancellationToken); } + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetArcGatewaysAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ArcGatewayGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ArcGatewayGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArcGatewayResource(Client, ArcGatewayData.DeserializeArcGatewayData(e)), ArcGatewayGatewaysClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetArcGateways", "value", "nextLink", cancellationToken); + } + + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetArcGateways(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ArcGatewayGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ArcGatewayGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArcGatewayResource(Client, ArcGatewayData.DeserializeArcGatewayData(e)), ArcGatewayGatewaysClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetArcGateways", "value", "nextLink", cancellationToken); + } + /// /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// @@ -355,7 +419,7 @@ public virtual Pageable GetHybridComputeMachines(C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -385,7 +449,7 @@ public virtual AsyncPageable GetHybridCom /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -415,7 +479,7 @@ public virtual Pageable GetHybridComputeP /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -459,7 +523,7 @@ public virtual async Task> GetValida /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs index 538d5f7ffa10..3e4da2de4e10 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs @@ -76,7 +76,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -121,7 +121,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -195,7 +195,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs index d5a7d035dd89..5e9928bfe1b5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs @@ -51,7 +51,7 @@ public partial class HybridComputeExtensionValueData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal HybridComputeExtensionValueData() + public HybridComputeExtensionValueData() { } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs index 15b320990465..46307c77cd5e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs index 52411a343903..30e0a0757cc9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string licenseName, Ca /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string licenseName, Cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string licenseName, CancellationToken cance /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs index 954cf8f5c364..e980c0769e8b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUnti /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -450,7 +450,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -512,7 +512,7 @@ public virtual async Task> AddTagA /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -574,7 +574,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -631,7 +631,7 @@ public virtual async Task> SetTags /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -688,7 +688,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -748,7 +748,7 @@ public virtual async Task> RemoveT /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs index 30dc2a905899..326d7c71adca 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil waitU /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -415,7 +415,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -472,7 +472,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -584,7 +584,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs index 6b43a8f2f6da..ae9f1fc2b4d2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -261,7 +261,7 @@ public virtual Response Get(string machineName, st /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(string ex /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(string expand = nul /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -367,7 +367,7 @@ public virtual async Task> ExistsAsync(string machineName, string /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -411,7 +411,7 @@ public virtual Response Exists(string machineName, string expand = null, C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -457,7 +457,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs index 5656ab07c4ef..84b3c81126ad 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs @@ -76,6 +76,21 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("serviceStatuses"u8); writer.WriteObjectValue(ServiceStatuses, options); } + if (options.Format != "W" && Optional.IsDefined(HardwareProfile)) + { + writer.WritePropertyName("hardwareProfile"u8); + writer.WriteObjectValue(HardwareProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(StorageProfile)) + { + writer.WritePropertyName("storageProfile"u8); + writer.WriteObjectValue(StorageProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareProfile)) + { + writer.WritePropertyName("firmwareProfile"u8); + writer.WriteObjectValue(FirmwareProfile, options); + } if (Optional.IsDefined(CloudMetadata)) { writer.WritePropertyName("cloudMetadata"u8); @@ -267,6 +282,9 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso HybridComputeLocation locationData = default; AgentConfiguration agentConfiguration = default; HybridComputeServiceStatuses serviceStatuses = default; + HybridComputeHardwareProfile hardwareProfile = default; + StorageProfile storageProfile = default; + HybridComputeFirmwareProfile firmwareProfile = default; HybridComputeCloudMetadata cloudMetadata = default; AgentUpgrade agentUpgrade = default; HybridComputeOSProfile osProfile = default; @@ -410,6 +428,33 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso serviceStatuses = HybridComputeServiceStatuses.DeserializeHybridComputeServiceStatuses(property0.Value, options); continue; } + if (property0.NameEquals("hardwareProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareProfile = HybridComputeHardwareProfile.DeserializeHybridComputeHardwareProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("storageProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageProfile = StorageProfile.DeserializeStorageProfile(property0.Value, options); + continue; + } + if (property0.NameEquals("firmwareProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + firmwareProfile = HybridComputeFirmwareProfile.DeserializeHybridComputeFirmwareProfile(property0.Value, options); + continue; + } if (property0.NameEquals("cloudMetadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -643,6 +688,9 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso locationData, agentConfiguration, serviceStatuses, + hardwareProfile, + storageProfile, + firmwareProfile, cloudMetadata, agentUpgrade, osProfile, @@ -887,6 +935,56 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HardwareProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" hardwareProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HardwareProfile)) + { + builder.Append(" hardwareProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, HardwareProfile, options, 4, false, " hardwareProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("StorageDisks", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" storageProfile: {"); + builder.Append(" disks: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(StorageProfile)) + { + builder.Append(" storageProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, StorageProfile, options, 4, false, " storageProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FirmwareProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" firmwareProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FirmwareProfile)) + { + builder.Append(" firmwareProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, FirmwareProfile, options, 4, false, " firmwareProfile: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CloudMetadataProvider", out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs index 2763ddd3a213..ea42dedffca6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs @@ -74,6 +74,9 @@ public HybridComputeMachineData(AzureLocation location) : base(location) /// Metadata pertaining to the geographic location of the resource. /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. /// Statuses of dependent services that are reported back to ARM. + /// Information about the machine's hardware. + /// Information about the machine's storage. + /// Information about the machine's firmware. /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). /// The info of the machine w.r.t Agent Upgrade. /// Specifies the operating system settings for the hybrid machine. @@ -103,7 +106,7 @@ public HybridComputeMachineData(AzureLocation location) : base(location) /// Detected properties from the machine. /// Information about the network the machine is on. /// Keeps track of any properties unknown to the library. - internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IReadOnlyList resources, ManagedServiceIdentity identity, ArcKindEnum? kind, HybridComputeLocation locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, HybridComputeCloudMetadata cloudMetadata, AgentUpgrade agentUpgrade, HybridComputeOSProfile osProfile, LicenseProfileMachineInstanceView licenseProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IReadOnlyList errorDetails, string agentVersion, Guid? vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, Guid? vmUuid, IList extensions, string osSku, string osEdition, string domainName, string adFqdn, string dnsFqdn, ResourceIdentifier privateLinkScopeResourceId, ResourceIdentifier parentClusterResourceId, string msSqlDiscovered, IReadOnlyDictionary detectedProperties, HybridComputeNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IReadOnlyList resources, ManagedServiceIdentity identity, ArcKindEnum? kind, HybridComputeLocation locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, HybridComputeHardwareProfile hardwareProfile, StorageProfile storageProfile, HybridComputeFirmwareProfile firmwareProfile, HybridComputeCloudMetadata cloudMetadata, AgentUpgrade agentUpgrade, HybridComputeOSProfile osProfile, LicenseProfileMachineInstanceView licenseProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IReadOnlyList errorDetails, string agentVersion, Guid? vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, Guid? vmUuid, IList extensions, string osSku, string osEdition, string domainName, string adFqdn, string dnsFqdn, ResourceIdentifier privateLinkScopeResourceId, ResourceIdentifier parentClusterResourceId, string msSqlDiscovered, IReadOnlyDictionary detectedProperties, HybridComputeNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Resources = resources; Identity = identity; @@ -111,6 +114,9 @@ internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceTy LocationData = locationData; AgentConfiguration = agentConfiguration; ServiceStatuses = serviceStatuses; + HardwareProfile = hardwareProfile; + StorageProfile = storageProfile; + FirmwareProfile = firmwareProfile; CloudMetadata = cloudMetadata; AgentUpgrade = agentUpgrade; OSProfile = osProfile; @@ -165,6 +171,21 @@ internal HybridComputeMachineData() /// Statuses of dependent services that are reported back to ARM. [WirePath("properties.serviceStatuses")] public HybridComputeServiceStatuses ServiceStatuses { get; set; } + /// Information about the machine's hardware. + [WirePath("properties.hardwareProfile")] + public HybridComputeHardwareProfile HardwareProfile { get; } + /// Information about the machine's storage. + internal StorageProfile StorageProfile { get; } + /// The disks on the machine. + [WirePath("properties.storageProfile.disks")] + public IReadOnlyList StorageDisks + { + get => StorageProfile?.Disks; + } + + /// Information about the machine's firmware. + [WirePath("properties.firmwareProfile")] + public HybridComputeFirmwareProfile FirmwareProfile { get; } /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). internal HybridComputeCloudMetadata CloudMetadata { get; set; } /// Specifies the cloud provider (Azure/AWS/GCP...). diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs index 36fbec06c804..3f38be502baf 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string extens /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string exp /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string extensionName, Canc /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string extensionName, CancellationToken can /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs index eb5d376240d3..5af5cf99eb20 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -255,7 +255,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// The operation to update the extension. + /// The operation to create or update the extension. /// /// /// Request Path @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task> U } /// - /// The operation to update the extension. + /// The operation to create or update the extension. /// /// /// Request Path @@ -313,7 +313,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUn /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs index 8550132f7f75..5eed278afd64 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs @@ -130,7 +130,7 @@ public virtual HybridComputeMachineExtensionCollection GetHybridComputeMachineEx /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -161,7 +161,7 @@ public virtual async Task> GetHy /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -179,6 +179,75 @@ public virtual Response GetHybridComputeM return GetHybridComputeMachineExtensions().Get(extensionName, cancellationToken); } + /// Gets a collection of MachineRunCommandResources in the HybridComputeMachine. + /// An object representing collection of MachineRunCommandResources and their operations over a MachineRunCommandResource. + public virtual MachineRunCommandCollection GetMachineRunCommands() + { + return GetCachedClient(client => new MachineRunCommandCollection(client, Id)); + } + + /// + /// The operation to get a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineRunCommandAsync(string runCommandName, CancellationToken cancellationToken = default) + { + return await GetMachineRunCommands().GetAsync(runCommandName, cancellationToken).ConfigureAwait(false); + } + + /// + /// The operation to get a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineRunCommand(string runCommandName, CancellationToken cancellationToken = default) + { + return GetMachineRunCommands().Get(runCommandName, cancellationToken); + } + /// /// Retrieves information about the model view or the instance view of a hybrid machine. /// @@ -192,7 +261,7 @@ public virtual Response GetHybridComputeM /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -233,7 +302,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -274,7 +343,7 @@ public virtual Response Get(string expand = null, /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -318,7 +387,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -362,7 +431,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -404,7 +473,7 @@ public virtual async Task> UpdateAsync(Hy /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -446,7 +515,7 @@ public virtual Response Update(HybridComputeMachin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -488,7 +557,7 @@ public virtual async Task> AssessPatche /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -530,7 +599,7 @@ public virtual ArmOperation AssessPatches(WaitUntil /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -576,7 +645,7 @@ public virtual async Task> InstallPatc /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -622,7 +691,7 @@ public virtual ArmOperation InstallPatches(WaitUnti /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// @@ -664,7 +733,7 @@ public virtual async Task UpgradeExtensionsAsync(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// @@ -706,7 +775,7 @@ public virtual ArmOperation UpgradeExtensions(WaitUntil waitUntil, MachineExtens /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// @@ -740,7 +809,7 @@ public virtual async Task> GetNetworkProfi /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// @@ -774,7 +843,7 @@ public virtual Response GetNetworkProfile(Cancellat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -812,7 +881,7 @@ public virtual async Task> GetValida /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -850,7 +919,7 @@ public virtual Response GetValidationDetailsF /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -912,7 +981,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -974,7 +1043,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -1031,7 +1100,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -1088,7 +1157,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -1148,7 +1217,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs index 13fce51dccf3..008c3ee741d9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Crea /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs index d5d755611014..2526abda4e23 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Canc /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs index f4cd857abc78..7f89f2a1897e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs index de2459b0c546..4b8e70646b9a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs index f5732c02d91e..d95cfc6baa54 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string scopeN /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string scopeName, Cancella /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string scopeName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs index b83789afd32a..a3083593d9ec 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs @@ -110,7 +110,7 @@ public virtual HybridComputePrivateLinkResourceCollection GetHybridComputePrivat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetHybridC /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -179,7 +179,7 @@ public virtual HybridComputePrivateEndpointConnectionCollection GetHybridCompute /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -248,7 +248,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -279,7 +279,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response GetNetwor /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -350,7 +350,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -390,7 +390,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -432,7 +432,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -474,7 +474,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -516,7 +516,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -558,7 +558,7 @@ public virtual Response Update(HybridComp /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -620,7 +620,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -739,7 +739,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -796,7 +796,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -856,7 +856,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/ArcGatewayOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/ArcGatewayOperationSource.cs new file mode 100644 index 000000000000..0a39fe6a6263 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/ArcGatewayOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class ArcGatewayOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ArcGatewayOperationSource(ArmClient client) + { + _client = client; + } + + ArcGatewayResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ArcGatewayData.DeserializeArcGatewayData(document.RootElement); + return new ArcGatewayResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ArcGatewayData.DeserializeArcGatewayData(document.RootElement); + return new ArcGatewayResource(_client, data); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs new file mode 100644 index 000000000000..82b1b4e7c8b2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class MachineRunCommandOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MachineRunCommandOperationSource(ArmClient client) + { + _client = client; + } + + MachineRunCommandResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); + return new MachineRunCommandResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); + return new MachineRunCommandResource(_client, data); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs new file mode 100644 index 000000000000..c8bf4df5ba4f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs @@ -0,0 +1,495 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// 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 GetMachineRunCommands method from an instance of . + /// + public partial class MachineRunCommandCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _machineRunCommandClientDiagnostics; + private readonly MachineRunCommandsRestOperations _machineRunCommandRestClient; + + /// Initializes a new instance of the class for mocking. + protected MachineRunCommandCollection() + { + } + + /// 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 MachineRunCommandCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _machineRunCommandClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", MachineRunCommandResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MachineRunCommandResource.ResourceType, out string machineRunCommandApiVersion); + _machineRunCommandRestClient = new MachineRunCommandsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineRunCommandApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != HybridComputeMachineResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridComputeMachineResource.ResourceType), nameof(id)); + } + + /// + /// The operation to create or update a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 run command. + /// Parameters supplied to the Create Run Command. + /// 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 runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create or update a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 run command. + /// Parameters supplied to the Create Run Command. + /// 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 runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data, cancellationToken); + var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to get a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Get"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to get a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Get"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to get all the run commands of a non-Azure machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands + /// + /// + /// Operation Id + /// MachineRunCommands_List + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The expand expression to apply on the operation. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRunCommandRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRunCommandRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineRunCommandResource(Client, MachineRunCommandData.DeserializeMachineRunCommandData(e)), _machineRunCommandClientDiagnostics, Pipeline, "MachineRunCommandCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// The operation to get all the run commands of a non-Azure machine. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands + /// + /// + /// Operation Id + /// MachineRunCommands_List + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The expand expression to apply on the operation. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRunCommandRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRunCommandRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineRunCommandResource(Client, MachineRunCommandData.DeserializeMachineRunCommandData(e)), _machineRunCommandClientDiagnostics, Pipeline, "MachineRunCommandCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Exists"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, 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.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Exists"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the run command. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.GetIfExists"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MachineRunCommandResource(Client, response.Value), 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs new file mode 100644 index 000000000000..cae0ef0e767e --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs @@ -0,0 +1,753 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class MachineRunCommandData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + } + if (Optional.IsCollectionDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteStartArray(); + foreach (var item in Parameters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ProtectedParameters)) + { + writer.WritePropertyName("protectedParameters"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedParameters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AsyncExecution)) + { + writer.WritePropertyName("asyncExecution"u8); + writer.WriteBooleanValue(AsyncExecution.Value); + } + if (Optional.IsDefined(RunAsUser)) + { + writer.WritePropertyName("runAsUser"u8); + writer.WriteStringValue(RunAsUser); + } + if (Optional.IsDefined(RunAsPassword)) + { + writer.WritePropertyName("runAsPassword"u8); + writer.WriteStringValue(RunAsPassword); + } + if (Optional.IsDefined(TimeoutInSeconds)) + { + writer.WritePropertyName("timeoutInSeconds"u8); + writer.WriteNumberValue(TimeoutInSeconds.Value); + } + if (Optional.IsDefined(OutputBlobUri)) + { + writer.WritePropertyName("outputBlobUri"u8); + writer.WriteStringValue(OutputBlobUri.AbsoluteUri); + } + if (Optional.IsDefined(ErrorBlobUri)) + { + writer.WritePropertyName("errorBlobUri"u8); + writer.WriteStringValue(ErrorBlobUri.AbsoluteUri); + } + if (Optional.IsDefined(OutputBlobManagedIdentity)) + { + writer.WritePropertyName("outputBlobManagedIdentity"u8); + writer.WriteObjectValue(OutputBlobManagedIdentity, options); + } + if (Optional.IsDefined(ErrorBlobManagedIdentity)) + { + writer.WritePropertyName("errorBlobManagedIdentity"u8); + writer.WriteObjectValue(ErrorBlobManagedIdentity, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + if (options.Format != "W" && Optional.IsDefined(InstanceView)) + { + writer.WritePropertyName("instanceView"u8); + writer.WriteObjectValue(InstanceView, options); + } + writer.WriteEndObject(); + } + + MachineRunCommandData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineRunCommandData(document.RootElement, options); + } + + internal static MachineRunCommandData DeserializeMachineRunCommandData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + MachineRunCommandScriptSource source = default; + IList parameters = default; + IList protectedParameters = default; + bool? asyncExecution = default; + string runAsUser = default; + string runAsPassword = default; + int? timeoutInSeconds = default; + Uri outputBlobUri = default; + Uri errorBlobUri = default; + RunCommandManagedIdentity outputBlobManagedIdentity = default; + RunCommandManagedIdentity errorBlobManagedIdentity = default; + string provisioningState = default; + MachineRunCommandInstanceView instanceView = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + 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("source"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = MachineRunCommandScriptSource.DeserializeMachineRunCommandScriptSource(property0.Value, options); + continue; + } + if (property0.NameEquals("parameters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(RunCommandInputParameter.DeserializeRunCommandInputParameter(item, options)); + } + parameters = array; + continue; + } + if (property0.NameEquals("protectedParameters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(RunCommandInputParameter.DeserializeRunCommandInputParameter(item, options)); + } + protectedParameters = array; + continue; + } + if (property0.NameEquals("asyncExecution"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asyncExecution = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("runAsUser"u8)) + { + runAsUser = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("runAsPassword"u8)) + { + runAsPassword = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("timeoutInSeconds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeoutInSeconds = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("outputBlobUri"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputBlobUri = new Uri(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("errorBlobUri"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errorBlobUri = new Uri(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("outputBlobManagedIdentity"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputBlobManagedIdentity = RunCommandManagedIdentity.DeserializeRunCommandManagedIdentity(property0.Value, options); + continue; + } + if (property0.NameEquals("errorBlobManagedIdentity"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errorBlobManagedIdentity = RunCommandManagedIdentity.DeserializeRunCommandManagedIdentity(property0.Value, options); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceView"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceView = MachineRunCommandInstanceView.DeserializeMachineRunCommandInstanceView(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineRunCommandData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + source, + parameters ?? new ChangeTrackingList(), + protectedParameters ?? new ChangeTrackingList(), + asyncExecution, + runAsUser, + runAsPassword, + timeoutInSeconds, + outputBlobUri, + errorBlobUri, + outputBlobManagedIdentity, + errorBlobManagedIdentity, + provisioningState, + instanceView, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Parameters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" parameters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Parameters)) + { + if (Parameters.Any()) + { + builder.Append(" parameters: "); + builder.AppendLine("["); + foreach (var item in Parameters) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " parameters: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProtectedParameters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" protectedParameters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProtectedParameters)) + { + if (ProtectedParameters.Any()) + { + builder.Append(" protectedParameters: "); + builder.AppendLine("["); + foreach (var item in ProtectedParameters) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " protectedParameters: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AsyncExecution), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" asyncExecution: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AsyncExecution)) + { + builder.Append(" asyncExecution: "); + var boolValue = AsyncExecution.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RunAsUser), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" runAsUser: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RunAsUser)) + { + builder.Append(" runAsUser: "); + if (RunAsUser.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RunAsUser}'''"); + } + else + { + builder.AppendLine($"'{RunAsUser}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RunAsPassword), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" runAsPassword: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RunAsPassword)) + { + builder.Append(" runAsPassword: "); + if (RunAsPassword.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RunAsPassword}'''"); + } + else + { + builder.AppendLine($"'{RunAsPassword}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TimeoutInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timeoutInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TimeoutInSeconds)) + { + builder.Append(" timeoutInSeconds: "); + builder.AppendLine($"{TimeoutInSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputBlobUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" outputBlobUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OutputBlobUri)) + { + builder.Append(" outputBlobUri: "); + builder.AppendLine($"'{OutputBlobUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorBlobUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorBlobUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorBlobUri)) + { + builder.Append(" errorBlobUri: "); + builder.AppendLine($"'{ErrorBlobUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputBlobManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" outputBlobManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OutputBlobManagedIdentity)) + { + builder.Append(" outputBlobManagedIdentity: "); + BicepSerializationHelpers.AppendChildObject(builder, OutputBlobManagedIdentity, options, 4, false, " outputBlobManagedIdentity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorBlobManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorBlobManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorBlobManagedIdentity)) + { + builder.Append(" errorBlobManagedIdentity: "); + BicepSerializationHelpers.AppendChildObject(builder, ErrorBlobManagedIdentity, options, 4, false, " errorBlobManagedIdentity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + if (ProvisioningState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ProvisioningState}'''"); + } + else + { + builder.AppendLine($"'{ProvisioningState}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceView), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" instanceView: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InstanceView)) + { + builder.Append(" instanceView: "); + BicepSerializationHelpers.AppendChildObject(builder, InstanceView, options, 4, false, " instanceView: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support writing '{options.Format}' format."); + } + } + + MachineRunCommandData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineRunCommandData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs new file mode 100644 index 000000000000..d6369c6d0fae --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing the MachineRunCommand data model. + /// Describes a Run Command + /// + public partial class MachineRunCommandData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public MachineRunCommandData(AzureLocation location) : base(location) + { + Parameters = new ChangeTrackingList(); + ProtectedParameters = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The source of the run command script. + /// The parameters used by the script. + /// The parameters used by the script. + /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. + /// Specifies the user account on the machine when executing the run command. + /// Specifies the user account password on the machine when executing the run command. + /// The timeout in seconds to execute the run command. + /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. + /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. + /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + /// The provisioning state, which only appears in the response. + /// The machine run command instance view. + /// Keeps track of any properties unknown to the library. + internal MachineRunCommandData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MachineRunCommandScriptSource source, IList parameters, IList protectedParameters, bool? asyncExecution, string runAsUser, string runAsPassword, int? timeoutInSeconds, Uri outputBlobUri, Uri errorBlobUri, RunCommandManagedIdentity outputBlobManagedIdentity, RunCommandManagedIdentity errorBlobManagedIdentity, string provisioningState, MachineRunCommandInstanceView instanceView, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Source = source; + Parameters = parameters; + ProtectedParameters = protectedParameters; + AsyncExecution = asyncExecution; + RunAsUser = runAsUser; + RunAsPassword = runAsPassword; + TimeoutInSeconds = timeoutInSeconds; + OutputBlobUri = outputBlobUri; + ErrorBlobUri = errorBlobUri; + OutputBlobManagedIdentity = outputBlobManagedIdentity; + ErrorBlobManagedIdentity = errorBlobManagedIdentity; + ProvisioningState = provisioningState; + InstanceView = instanceView; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MachineRunCommandData() + { + } + + /// The source of the run command script. + [WirePath("properties.source")] + public MachineRunCommandScriptSource Source { get; set; } + /// The parameters used by the script. + [WirePath("properties.parameters")] + public IList Parameters { get; } + /// The parameters used by the script. + [WirePath("properties.protectedParameters")] + public IList ProtectedParameters { get; } + /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. + [WirePath("properties.asyncExecution")] + public bool? AsyncExecution { get; set; } + /// Specifies the user account on the machine when executing the run command. + [WirePath("properties.runAsUser")] + public string RunAsUser { get; set; } + /// Specifies the user account password on the machine when executing the run command. + [WirePath("properties.runAsPassword")] + public string RunAsPassword { get; set; } + /// The timeout in seconds to execute the run command. + [WirePath("properties.timeoutInSeconds")] + public int? TimeoutInSeconds { get; set; } + /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. + [WirePath("properties.outputBlobUri")] + public Uri OutputBlobUri { get; set; } + /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. + [WirePath("properties.errorBlobUri")] + public Uri ErrorBlobUri { get; set; } + /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + [WirePath("properties.outputBlobManagedIdentity")] + public RunCommandManagedIdentity OutputBlobManagedIdentity { get; set; } + /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + [WirePath("properties.errorBlobManagedIdentity")] + public RunCommandManagedIdentity ErrorBlobManagedIdentity { get; set; } + /// The provisioning state, which only appears in the response. + [WirePath("properties.provisioningState")] + public string ProvisioningState { get; } + /// The machine run command instance view. + [WirePath("properties.instanceView")] + public MachineRunCommandInstanceView InstanceView { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs new file mode 100644 index 000000000000..07be5d5c241a --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class MachineRunCommandResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MachineRunCommandData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MachineRunCommandData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs new file mode 100644 index 000000000000..4d876986348e --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs @@ -0,0 +1,684 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A Class representing a MachineRunCommand 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 GetMachineRunCommandResource method. + /// Otherwise you can get one from its parent resource using the GetMachineRunCommand method. + /// + public partial class MachineRunCommandResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The machineName. + /// The runCommandName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _machineRunCommandClientDiagnostics; + private readonly MachineRunCommandsRestOperations _machineRunCommandRestClient; + private readonly MachineRunCommandData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/machines/runCommands"; + + /// Initializes a new instance of the class for mocking. + protected MachineRunCommandResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MachineRunCommandResource(ArmClient client, MachineRunCommandData 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 MachineRunCommandResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _machineRunCommandClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string machineRunCommandApiVersion); + _machineRunCommandRestClient = new MachineRunCommandsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineRunCommandApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 MachineRunCommandData 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)); + } + + /// + /// The operation to get a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Get"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.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 MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to get a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Get"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to delete a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Delete + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Delete"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(_machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to delete a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Delete + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Delete"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new HybridComputeArmOperation(_machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create or update a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Parameters supplied to the Create Run Command. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MachineRunCommandData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Update"); + scope.Start(); + try + { + var response = await _machineRunCommandRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create or update a run command. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Parameters supplied to the Create Run Command. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MachineRunCommandData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Update"); + scope.Start(); + try + { + var response = _machineRunCommandRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags[key] = value; + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// + /// + /// Operation Id + /// MachineRunCommands_Get + /// + /// + /// Default Api Version + /// 2024-07-31-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.Remove(key); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs index 385ee381cf9a..6b5a9336d4a1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs @@ -52,8 +52,8 @@ public AgentUpgrade() /// Initializes a new instance of . /// Specifies the version info w.r.t AgentUpgrade for the machine. - /// The correlation ID passed in from RSM per upgrade. - /// Specifies if RSM should try to upgrade this machine. + /// The correlation ID associated with an agent upgrade operation. + /// Specifies if the machine's agent should be upgraded. /// Specifies the version of the last attempt. /// Timestamp of last upgrade attempt. /// Specifies the status of Agent Upgrade. @@ -74,10 +74,10 @@ internal AgentUpgrade(string desiredVersion, Guid? correlationId, bool? isAutoma /// Specifies the version info w.r.t AgentUpgrade for the machine. [WirePath("desiredVersion")] public string DesiredVersion { get; set; } - /// The correlation ID passed in from RSM per upgrade. + /// The correlation ID associated with an agent upgrade operation. [WirePath("correlationId")] public Guid? CorrelationId { get; set; } - /// Specifies if RSM should try to upgrade this machine. + /// Specifies if the machine's agent should be upgraded. [WirePath("enableAutomaticUpgrade")] public bool? IsAutomaticUpgradeEnabled { get; set; } /// Specifies the version of the last attempt. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.Serialization.cs new file mode 100644 index 000000000000..395163665e87 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class ArcGatewayPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArcGatewayPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AllowedFeatures)) + { + writer.WritePropertyName("allowedFeatures"u8); + writer.WriteStartArray(); + foreach (var item in AllowedFeatures) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + ArcGatewayPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArcGatewayPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArcGatewayPatch(document.RootElement, options); + } + + internal static ArcGatewayPatch DeserializeArcGatewayPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IList allowedFeatures = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + 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("allowedFeatures"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedFeatures = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArcGatewayPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, allowedFeatures ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ArcGatewayPatch)} does not support writing '{options.Format}' format."); + } + } + + ArcGatewayPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeArcGatewayPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArcGatewayPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.cs new file mode 100644 index 000000000000..2fb0e123b8df --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayPatch.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes a License Update. + public partial class ArcGatewayPatch : HybridComputeResourceUpdate + { + /// Initializes a new instance of . + public ArcGatewayPatch() + { + AllowedFeatures = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + /// Specifies the list of features that are enabled for this Gateway. + internal ArcGatewayPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList allowedFeatures) : base(tags, serializedAdditionalRawData) + { + AllowedFeatures = allowedFeatures; + } + + /// Specifies the list of features that are enabled for this Gateway. + [WirePath("properties.allowedFeatures")] + public IList AllowedFeatures { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayType.cs new file mode 100644 index 000000000000..9afb326e1bae --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcGatewayType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The type of the Gateway resource. + public readonly partial struct ArcGatewayType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ArcGatewayType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PublicValue = "Public"; + + /// Public. + public static ArcGatewayType Public { get; } = new ArcGatewayType(PublicValue); + /// Determines if two values are the same. + public static bool operator ==(ArcGatewayType left, ArcGatewayType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ArcGatewayType left, ArcGatewayType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ArcGatewayType(string value) => new ArcGatewayType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ArcGatewayType other && Equals(other); + /// + public bool Equals(ArcGatewayType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.Serialization.cs new file mode 100644 index 000000000000..d26a33c1f106 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.Serialization.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class ArcSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArcSettings)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + writer.WritePropertyName("gatewayProperties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(GatewayResourceId)) + { + writer.WritePropertyName("gatewayResourceId"u8); + writer.WriteStringValue(GatewayResourceId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + ArcSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ArcSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeArcSettings(document.RootElement, options); + } + + internal static ArcSettings DeserializeArcSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + Guid? tenantId = default; + ResourceIdentifier gatewayResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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("tenantId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("gatewayProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("gatewayResourceId"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayResourceId = new ResourceIdentifier(property1.Value.GetString()); + continue; + } + } + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ArcSettings( + id, + name, + type, + systemData, + tenantId, + gatewayResourceId, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TenantId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tenantId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TenantId)) + { + builder.Append(" tenantId: "); + builder.AppendLine($"'{TenantId.Value.ToString()}'"); + } + } + + builder.Append(" gatewayProperties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gatewayResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GatewayResourceId)) + { + builder.Append(" gatewayResourceId: "); + builder.AppendLine($"'{GatewayResourceId.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ArcSettings)} does not support writing '{options.Format}' format."); + } + } + + ArcSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeArcSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ArcSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.cs new file mode 100644 index 000000000000..5c7452a2167a --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ArcSettings.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The ArcSettings. + public partial class ArcSettings : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ArcSettings() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure resource tenant Id. + /// Associated Gateway Resource Id. + /// Keeps track of any properties unknown to the library. + internal ArcSettings(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? tenantId, ResourceIdentifier gatewayResourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + TenantId = tenantId; + GatewayResourceId = gatewayResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Azure resource tenant Id. + [WirePath("properties.tenantId")] + public Guid? TenantId { get; } + /// Associated Gateway Resource Id. + [WirePath("properties.gatewayResourceId")] + public ResourceIdentifier GatewayResourceId { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs new file mode 100644 index 000000000000..283792a02ff9 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class ExtensionsResourceStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExtensionsResourceStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Level)) + { + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level.Value.ToSerialString()); + } + if (Optional.IsDefined(DisplayStatus)) + { + writer.WritePropertyName("displayStatus"u8); + writer.WriteStringValue(DisplayStatus); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExtensionsResourceStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExtensionsResourceStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExtensionsResourceStatus(document.RootElement, options); + } + + internal static ExtensionsResourceStatus DeserializeExtensionsResourceStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + ExtensionsStatusLevelType? level = default; + string displayStatus = default; + string message = default; + DateTimeOffset? time = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("level"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + level = property.Value.GetString().ToExtensionsStatusLevelType(); + continue; + } + if (property.NameEquals("displayStatus"u8)) + { + displayStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + time = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExtensionsResourceStatus( + code, + level, + displayStatus, + message, + time, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" code: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Code)) + { + builder.Append(" code: "); + if (Code.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Code}'''"); + } + else + { + builder.AppendLine($"'{Code}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Level), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" level: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Level)) + { + builder.Append(" level: "); + builder.AppendLine($"'{Level.Value.ToSerialString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisplayStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" displayStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DisplayStatus)) + { + builder.Append(" displayStatus: "); + if (DisplayStatus.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DisplayStatus}'''"); + } + else + { + builder.AppendLine($"'{DisplayStatus}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" message: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Message)) + { + builder.Append(" message: "); + if (Message.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Message}'''"); + } + else + { + builder.AppendLine($"'{Message}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Time), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" time: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Time)) + { + builder.Append(" time: "); + var formattedDateTimeString = TypeFormatters.ToString(Time.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ExtensionsResourceStatus)} does not support writing '{options.Format}' format."); + } + } + + ExtensionsResourceStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeExtensionsResourceStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExtensionsResourceStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs new file mode 100644 index 000000000000..70e489109b5b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Instance view status. + public partial class ExtensionsResourceStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ExtensionsResourceStatus() + { + } + + /// Initializes a new instance of . + /// The status code. + /// The level code. + /// The short localizable label for the status. + /// The detailed status message, including for alerts and error messages. + /// The time of the status. + /// Keeps track of any properties unknown to the library. + internal ExtensionsResourceStatus(string code, ExtensionsStatusLevelType? level, string displayStatus, string message, DateTimeOffset? time, IDictionary serializedAdditionalRawData) + { + Code = code; + Level = level; + DisplayStatus = displayStatus; + Message = message; + Time = time; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The status code. + [WirePath("code")] + public string Code { get; } + /// The level code. + [WirePath("level")] + public ExtensionsStatusLevelType? Level { get; } + /// The short localizable label for the status. + [WirePath("displayStatus")] + public string DisplayStatus { get; } + /// The detailed status message, including for alerts and error messages. + [WirePath("message")] + public string Message { get; } + /// The time of the status. + [WirePath("time")] + public DateTimeOffset? Time { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs new file mode 100644 index 000000000000..8f03c2a919c9 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal static partial class ExtensionsStatusLevelTypeExtensions + { + public static string ToSerialString(this ExtensionsStatusLevelType value) => value switch + { + ExtensionsStatusLevelType.Info => "Info", + ExtensionsStatusLevelType.Warning => "Warning", + ExtensionsStatusLevelType.Error => "Error", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ExtensionsStatusLevelType value.") + }; + + public static ExtensionsStatusLevelType ToExtensionsStatusLevelType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Info")) return ExtensionsStatusLevelType.Info; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Warning")) return ExtensionsStatusLevelType.Warning; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Error")) return ExtensionsStatusLevelType.Error; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ExtensionsStatusLevelType value."); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs new file mode 100644 index 000000000000..d686e042015a --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The level code. + public enum ExtensionsStatusLevelType + { + /// Info. + Info, + /// Warning. + Warning, + /// Error. + Error + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs new file mode 100644 index 000000000000..e71350cfb7f5 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class GatewaysListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GatewaysListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewaysListResult(document.RootElement, options); + } + + internal static GatewaysListResult DeserializeGatewaysListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ArcGatewayData.DeserializeArcGatewayData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GatewaysListResult(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{options.Format}' format."); + } + } + + GatewaysListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeGatewaysListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs new file mode 100644 index 000000000000..0726b1e0a45d --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The List license operation response. + internal partial class GatewaysListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of Gateways. + /// is null. + internal GatewaysListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The list of Gateways. + /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. + /// Keeps track of any properties unknown to the library. + internal GatewaysListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GatewaysListResult() + { + } + + /// The list of Gateways. + public IReadOnlyList Value { get; } + /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. + public string NextLink { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.Serialization.cs new file mode 100644 index 000000000000..9ec3066f5611 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.Serialization.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class HybridComputeDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeDisk)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (Optional.IsDefined(GeneratedId)) + { + writer.WritePropertyName("generatedId"u8); + writer.WriteStringValue(GeneratedId); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(MaxSizeInBytes)) + { + writer.WritePropertyName("maxSizeInBytes"u8); + writer.WriteNumberValue(MaxSizeInBytes.Value); + } + if (Optional.IsDefined(UsedSpaceInBytes)) + { + writer.WritePropertyName("usedSpaceInBytes"u8); + writer.WriteNumberValue(UsedSpaceInBytes.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HybridComputeDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridComputeDisk(document.RootElement, options); + } + + internal static HybridComputeDisk DeserializeHybridComputeDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string path = default; + string diskType = default; + string generatedId = default; + ResourceIdentifier id = default; + string name = default; + long? maxSizeInBytes = default; + long? usedSpaceInBytes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + if (property.NameEquals("generatedId"u8)) + { + generatedId = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("maxSizeInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxSizeInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("usedSpaceInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedSpaceInBytes = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridComputeDisk( + path, + diskType, + generatedId, + id, + name, + maxSizeInBytes, + usedSpaceInBytes, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" path: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Path)) + { + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DiskType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diskType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DiskType)) + { + builder.Append(" diskType: "); + if (DiskType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DiskType}'''"); + } + else + { + builder.AppendLine($"'{DiskType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GeneratedId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" generatedId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GeneratedId)) + { + builder.Append(" generatedId: "); + if (GeneratedId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GeneratedId}'''"); + } + else + { + builder.AppendLine($"'{GeneratedId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxSizeInBytes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxSizeInBytes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxSizeInBytes)) + { + builder.Append(" maxSizeInBytes: "); + builder.AppendLine($"'{MaxSizeInBytes.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UsedSpaceInBytes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" usedSpaceInBytes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UsedSpaceInBytes)) + { + builder.Append(" usedSpaceInBytes: "); + builder.AppendLine($"'{UsedSpaceInBytes.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HybridComputeDisk)} does not support writing '{options.Format}' format."); + } + } + + HybridComputeDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHybridComputeDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridComputeDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.cs new file mode 100644 index 000000000000..f969c7055940 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeDisk.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes a disk on the machine. + public partial class HybridComputeDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HybridComputeDisk() + { + } + + /// Initializes a new instance of . + /// The path of the disk. + /// The type of the disk. + /// The generated ID of the disk. + /// The ID of the disk. + /// The name of the disk. + /// The size of the disk, in bytes. + /// The amount of space used on the disk, in bytes. + /// Keeps track of any properties unknown to the library. + internal HybridComputeDisk(string path, string diskType, string generatedId, ResourceIdentifier id, string name, long? maxSizeInBytes, long? usedSpaceInBytes, IDictionary serializedAdditionalRawData) + { + Path = path; + DiskType = diskType; + GeneratedId = generatedId; + Id = id; + Name = name; + MaxSizeInBytes = maxSizeInBytes; + UsedSpaceInBytes = usedSpaceInBytes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The path of the disk. + [WirePath("path")] + public string Path { get; } + /// The type of the disk. + [WirePath("diskType")] + public string DiskType { get; } + /// The generated ID of the disk. + [WirePath("generatedId")] + public string GeneratedId { get; } + /// The ID of the disk. + [WirePath("id")] + public ResourceIdentifier Id { get; } + /// The name of the disk. + [WirePath("name")] + public string Name { get; } + /// The size of the disk, in bytes. + [WirePath("maxSizeInBytes")] + public long? MaxSizeInBytes { get; } + /// The amount of space used on the disk, in bytes. + [WirePath("usedSpaceInBytes")] + public long? UsedSpaceInBytes { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs new file mode 100644 index 000000000000..578ddd1f2e84 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Script execution status. + public readonly partial struct HybridComputeExecutionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HybridComputeExecutionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string PendingValue = "Pending"; + private const string RunningValue = "Running"; + private const string FailedValue = "Failed"; + private const string SucceededValue = "Succeeded"; + private const string TimedOutValue = "TimedOut"; + private const string CanceledValue = "Canceled"; + + /// Unknown. + public static HybridComputeExecutionState Unknown { get; } = new HybridComputeExecutionState(UnknownValue); + /// Pending. + public static HybridComputeExecutionState Pending { get; } = new HybridComputeExecutionState(PendingValue); + /// Running. + public static HybridComputeExecutionState Running { get; } = new HybridComputeExecutionState(RunningValue); + /// Failed. + public static HybridComputeExecutionState Failed { get; } = new HybridComputeExecutionState(FailedValue); + /// Succeeded. + public static HybridComputeExecutionState Succeeded { get; } = new HybridComputeExecutionState(SucceededValue); + /// TimedOut. + public static HybridComputeExecutionState TimedOut { get; } = new HybridComputeExecutionState(TimedOutValue); + /// Canceled. + public static HybridComputeExecutionState Canceled { get; } = new HybridComputeExecutionState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(HybridComputeExecutionState left, HybridComputeExecutionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HybridComputeExecutionState left, HybridComputeExecutionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HybridComputeExecutionState(string value) => new HybridComputeExecutionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HybridComputeExecutionState other && Equals(other); + /// + public bool Equals(HybridComputeExecutionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.Serialization.cs new file mode 100644 index 000000000000..ca8b4922eff3 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class HybridComputeFirmwareProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeFirmwareProfile)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SerialNumber)) + { + writer.WritePropertyName("serialNumber"u8); + writer.WriteStringValue(SerialNumber); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareProfileType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(FirmwareProfileType); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HybridComputeFirmwareProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeFirmwareProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridComputeFirmwareProfile(document.RootElement, options); + } + + internal static HybridComputeFirmwareProfile DeserializeHybridComputeFirmwareProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string serialNumber = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serialNumber"u8)) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridComputeFirmwareProfile(serialNumber, type, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SerialNumber), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serialNumber: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SerialNumber)) + { + builder.Append(" serialNumber: "); + if (SerialNumber.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SerialNumber}'''"); + } + else + { + builder.AppendLine($"'{SerialNumber}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FirmwareProfileType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FirmwareProfileType)) + { + builder.Append(" type: "); + if (FirmwareProfileType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FirmwareProfileType}'''"); + } + else + { + builder.AppendLine($"'{FirmwareProfileType}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HybridComputeFirmwareProfile)} does not support writing '{options.Format}' format."); + } + } + + HybridComputeFirmwareProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHybridComputeFirmwareProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridComputeFirmwareProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.cs new file mode 100644 index 000000000000..12696b1c2551 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeFirmwareProfile.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the firmware of the machine. + public partial class HybridComputeFirmwareProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HybridComputeFirmwareProfile() + { + } + + /// Initializes a new instance of . + /// The serial number of the firmware. + /// The type of the firmware. + /// Keeps track of any properties unknown to the library. + internal HybridComputeFirmwareProfile(string serialNumber, string firmwareProfileType, IDictionary serializedAdditionalRawData) + { + SerialNumber = serialNumber; + FirmwareProfileType = firmwareProfileType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The serial number of the firmware. + [WirePath("serialNumber")] + public string SerialNumber { get; } + /// The type of the firmware. + [WirePath("type")] + public string FirmwareProfileType { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.Serialization.cs new file mode 100644 index 000000000000..a0b5f6b23d49 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.Serialization.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class HybridComputeHardwareProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeHardwareProfile)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TotalPhysicalMemoryInBytes)) + { + writer.WritePropertyName("totalPhysicalMemoryInBytes"u8); + writer.WriteNumberValue(TotalPhysicalMemoryInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCpuSockets)) + { + writer.WritePropertyName("numberOfCpuSockets"u8); + writer.WriteNumberValue(NumberOfCpuSockets.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HybridComputeHardwareProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeHardwareProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridComputeHardwareProfile(document.RootElement, options); + } + + internal static HybridComputeHardwareProfile DeserializeHybridComputeHardwareProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? totalPhysicalMemoryInBytes = default; + int? numberOfCpuSockets = default; + IReadOnlyList processors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalPhysicalMemoryInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalPhysicalMemoryInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("numberOfCpuSockets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCpuSockets = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("processors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HybridComputeProcessor.DeserializeHybridComputeProcessor(item, options)); + } + processors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridComputeHardwareProfile(totalPhysicalMemoryInBytes, numberOfCpuSockets, processors ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalPhysicalMemoryInBytes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalPhysicalMemoryInBytes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalPhysicalMemoryInBytes)) + { + builder.Append(" totalPhysicalMemoryInBytes: "); + builder.AppendLine($"'{TotalPhysicalMemoryInBytes.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NumberOfCpuSockets), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" numberOfCpuSockets: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NumberOfCpuSockets)) + { + builder.Append(" numberOfCpuSockets: "); + builder.AppendLine($"{NumberOfCpuSockets.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Processors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Processors)) + { + if (Processors.Any()) + { + builder.Append(" processors: "); + builder.AppendLine("["); + foreach (var item in Processors) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " processors: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HybridComputeHardwareProfile)} does not support writing '{options.Format}' format."); + } + } + + HybridComputeHardwareProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHybridComputeHardwareProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridComputeHardwareProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.cs new file mode 100644 index 000000000000..ea0eb8be91ee --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeHardwareProfile.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the hardware of the machine. + public partial class HybridComputeHardwareProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HybridComputeHardwareProfile() + { + Processors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The total physical memory on the machine. + /// The total number of CPU sockets available on the machine. + /// The physical processors of the machine. + /// Keeps track of any properties unknown to the library. + internal HybridComputeHardwareProfile(long? totalPhysicalMemoryInBytes, int? numberOfCpuSockets, IReadOnlyList processors, IDictionary serializedAdditionalRawData) + { + TotalPhysicalMemoryInBytes = totalPhysicalMemoryInBytes; + NumberOfCpuSockets = numberOfCpuSockets; + Processors = processors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The total physical memory on the machine. + [WirePath("totalPhysicalMemoryInBytes")] + public long? TotalPhysicalMemoryInBytes { get; } + /// The total number of CPU sockets available on the machine. + [WirePath("numberOfCpuSockets")] + public int? NumberOfCpuSockets { get; } + /// The physical processors of the machine. + [WirePath("processors")] + public IReadOnlyList Processors { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs index 8299e0f4054f..6187576cc55a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs @@ -36,6 +36,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(HybridComputeNetworkInterface)} does not support writing '{format}' format."); } + if (Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } if (Optional.IsCollectionDefined(IPAddresses)) { writer.WritePropertyName("ipAddresses"u8); @@ -83,11 +98,33 @@ internal static HybridComputeNetworkInterface DeserializeHybridComputeNetworkInt { return null; } + string macAddress = default; + ResourceIdentifier id = default; + string name = default; IReadOnlyList ipAddresses = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } if (property.NameEquals("ipAddresses"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -108,7 +145,7 @@ internal static HybridComputeNetworkInterface DeserializeHybridComputeNetworkInt } } serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeNetworkInterface(ipAddresses ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new HybridComputeNetworkInterface(macAddress, id, name, ipAddresses ?? new ChangeTrackingList(), serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -122,6 +159,67 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MacAddress), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" macAddress: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MacAddress)) + { + builder.Append(" macAddress: "); + if (MacAddress.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MacAddress}'''"); + } + else + { + builder.AppendLine($"'{MacAddress}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IPAddresses), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs index 6ab24bc2b696..626f300f5b3f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.HybridCompute.Models { @@ -52,14 +53,29 @@ internal HybridComputeNetworkInterface() } /// Initializes a new instance of . + /// Represents MAC address of the network interface. + /// Represents the ID of the network interface. + /// Represents the name of the network interface. /// The list of IP addresses in this interface. /// Keeps track of any properties unknown to the library. - internal HybridComputeNetworkInterface(IReadOnlyList ipAddresses, IDictionary serializedAdditionalRawData) + internal HybridComputeNetworkInterface(string macAddress, ResourceIdentifier id, string name, IReadOnlyList ipAddresses, IDictionary serializedAdditionalRawData) { + MacAddress = macAddress; + Id = id; + Name = name; IPAddresses = ipAddresses; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Represents MAC address of the network interface. + [WirePath("macAddress")] + public string MacAddress { get; } + /// Represents the ID of the network interface. + [WirePath("id")] + public ResourceIdentifier Id { get; } + /// Represents the name of the network interface. + [WirePath("name")] + public string Name { get; } /// The list of IP addresses in this interface. [WirePath("ipAddresses")] public IReadOnlyList IPAddresses { get; } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.Serialization.cs new file mode 100644 index 000000000000..085d184d5089 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class HybridComputeProcessor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeProcessor)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(NumberOfCores)) + { + writer.WritePropertyName("numberOfCores"u8); + writer.WriteNumberValue(NumberOfCores.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HybridComputeProcessor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeProcessor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridComputeProcessor(document.RootElement, options); + } + + internal static HybridComputeProcessor DeserializeHybridComputeProcessor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + int? numberOfCores = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("numberOfCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfCores = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridComputeProcessor(name, numberOfCores, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NumberOfCores), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" numberOfCores: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NumberOfCores)) + { + builder.Append(" numberOfCores: "); + builder.AppendLine($"{NumberOfCores.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HybridComputeProcessor)} does not support writing '{options.Format}' format."); + } + } + + HybridComputeProcessor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHybridComputeProcessor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridComputeProcessor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.cs new file mode 100644 index 000000000000..9886a0779390 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProcessor.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the firmware of the machine. + public partial class HybridComputeProcessor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HybridComputeProcessor() + { + } + + /// Initializes a new instance of . + /// The name of the processor. + /// The total number of physical cores on the processor. + /// Keeps track of any properties unknown to the library. + internal HybridComputeProcessor(string name, int? numberOfCores, IDictionary serializedAdditionalRawData) + { + Name = name; + NumberOfCores = numberOfCores; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the processor. + [WirePath("name")] + public string Name { get; } + /// The total number of physical cores on the processor. + [WirePath("numberOfCores")] + public int? NumberOfCores { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs new file mode 100644 index 000000000000..7530d6c203cf --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class MachineRunCommandInstanceView : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandInstanceView)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExecutionState)) + { + writer.WritePropertyName("executionState"u8); + writer.WriteStringValue(ExecutionState.Value.ToString()); + } + if (Optional.IsDefined(ExecutionMessage)) + { + writer.WritePropertyName("executionMessage"u8); + writer.WriteStringValue(ExecutionMessage); + } + if (Optional.IsDefined(ExitCode)) + { + writer.WritePropertyName("exitCode"u8); + writer.WriteNumberValue(ExitCode.Value); + } + if (Optional.IsDefined(Output)) + { + writer.WritePropertyName("output"u8); + writer.WriteStringValue(Output); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsCollectionDefined(Statuses)) + { + writer.WritePropertyName("statuses"u8); + writer.WriteStartArray(); + foreach (var item in Statuses) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineRunCommandInstanceView IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandInstanceView)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineRunCommandInstanceView(document.RootElement, options); + } + + internal static MachineRunCommandInstanceView DeserializeMachineRunCommandInstanceView(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HybridComputeExecutionState? executionState = default; + string executionMessage = default; + int? exitCode = default; + string output = default; + string error = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IReadOnlyList statuses = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("executionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionState = new HybridComputeExecutionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("executionMessage"u8)) + { + executionMessage = property.Value.GetString(); + continue; + } + if (property.NameEquals("exitCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + exitCode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("output"u8)) + { + output = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("statuses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExtensionsResourceStatus.DeserializeExtensionsResourceStatus(item, options)); + } + statuses = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineRunCommandInstanceView( + executionState, + executionMessage, + exitCode, + output, + error, + startTime, + endTime, + statuses ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExecutionState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" executionState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExecutionState)) + { + builder.Append(" executionState: "); + builder.AppendLine($"'{ExecutionState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExecutionMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" executionMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExecutionMessage)) + { + builder.Append(" executionMessage: "); + if (ExecutionMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ExecutionMessage}'''"); + } + else + { + builder.AppendLine($"'{ExecutionMessage}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExitCode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" exitCode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExitCode)) + { + builder.Append(" exitCode: "); + builder.AppendLine($"{ExitCode.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Output), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" output: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Output)) + { + builder.Append(" output: "); + if (Output.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Output}'''"); + } + else + { + builder.AppendLine($"'{Output}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartOn)) + { + builder.Append(" startTime: "); + var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" endTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EndOn)) + { + builder.Append(" endTime: "); + var formattedDateTimeString = TypeFormatters.ToString(EndOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Statuses), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" statuses: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Statuses)) + { + if (Statuses.Any()) + { + builder.Append(" statuses: "); + builder.AppendLine("["); + foreach (var item in Statuses) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " statuses: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineRunCommandInstanceView)} does not support writing '{options.Format}' format."); + } + } + + MachineRunCommandInstanceView IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineRunCommandInstanceView(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineRunCommandInstanceView)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs new file mode 100644 index 000000000000..7d4e909db720 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The instance view of a machine run command. + public partial class MachineRunCommandInstanceView + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MachineRunCommandInstanceView() + { + Statuses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Script execution status. + /// Communicate script configuration errors or execution messages. + /// Exit code returned from script execution. + /// Script output stream. + /// Script error stream. + /// Script start time. + /// Script end time. + /// The status information. + /// Keeps track of any properties unknown to the library. + internal MachineRunCommandInstanceView(HybridComputeExecutionState? executionState, string executionMessage, int? exitCode, string output, string error, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList statuses, IDictionary serializedAdditionalRawData) + { + ExecutionState = executionState; + ExecutionMessage = executionMessage; + ExitCode = exitCode; + Output = output; + Error = error; + StartOn = startOn; + EndOn = endOn; + Statuses = statuses; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Script execution status. + [WirePath("executionState")] + public HybridComputeExecutionState? ExecutionState { get; } + /// Communicate script configuration errors or execution messages. + [WirePath("executionMessage")] + public string ExecutionMessage { get; } + /// Exit code returned from script execution. + [WirePath("exitCode")] + public int? ExitCode { get; } + /// Script output stream. + [WirePath("output")] + public string Output { get; } + /// Script error stream. + [WirePath("error")] + public string Error { get; } + /// Script start time. + [WirePath("startTime")] + public DateTimeOffset? StartOn { get; } + /// Script end time. + [WirePath("endTime")] + public DateTimeOffset? EndOn { get; } + /// The status information. + [WirePath("statuses")] + public IReadOnlyList Statuses { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs new file mode 100644 index 000000000000..b384126ebc01 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class MachineRunCommandScriptSource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandScriptSource)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Script)) + { + writer.WritePropertyName("script"u8); + writer.WriteStringValue(Script); + } + if (Optional.IsDefined(ScriptUri)) + { + writer.WritePropertyName("scriptUri"u8); + writer.WriteStringValue(ScriptUri.AbsoluteUri); + } + if (Optional.IsDefined(CommandId)) + { + writer.WritePropertyName("commandId"u8); + writer.WriteStringValue(CommandId); + } + if (Optional.IsDefined(ScriptUriManagedIdentity)) + { + writer.WritePropertyName("scriptUriManagedIdentity"u8); + writer.WriteObjectValue(ScriptUriManagedIdentity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineRunCommandScriptSource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandScriptSource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineRunCommandScriptSource(document.RootElement, options); + } + + internal static MachineRunCommandScriptSource DeserializeMachineRunCommandScriptSource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string script = default; + Uri scriptUri = default; + string commandId = default; + RunCommandManagedIdentity scriptUriManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("script"u8)) + { + script = property.Value.GetString(); + continue; + } + if (property.NameEquals("scriptUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scriptUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("commandId"u8)) + { + commandId = property.Value.GetString(); + continue; + } + if (property.NameEquals("scriptUriManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scriptUriManagedIdentity = RunCommandManagedIdentity.DeserializeRunCommandManagedIdentity(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineRunCommandScriptSource(script, scriptUri, commandId, scriptUriManagedIdentity, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Script), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" script: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Script)) + { + builder.Append(" script: "); + if (Script.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Script}'''"); + } + else + { + builder.AppendLine($"'{Script}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScriptUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scriptUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ScriptUri)) + { + builder.Append(" scriptUri: "); + builder.AppendLine($"'{ScriptUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CommandId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" commandId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CommandId)) + { + builder.Append(" commandId: "); + if (CommandId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CommandId}'''"); + } + else + { + builder.AppendLine($"'{CommandId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScriptUriManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scriptUriManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ScriptUriManagedIdentity)) + { + builder.Append(" scriptUriManagedIdentity: "); + BicepSerializationHelpers.AppendChildObject(builder, ScriptUriManagedIdentity, options, 2, false, " scriptUriManagedIdentity: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineRunCommandScriptSource)} does not support writing '{options.Format}' format."); + } + } + + MachineRunCommandScriptSource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineRunCommandScriptSource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineRunCommandScriptSource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs new file mode 100644 index 000000000000..2e5fc9bf1ee3 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. + public partial class MachineRunCommandScriptSource + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MachineRunCommandScriptSource() + { + } + + /// Initializes a new instance of . + /// Specifies the script content to be executed on the machine. + /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. + /// Specifies the commandId of predefined built-in script. + /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + /// Keeps track of any properties unknown to the library. + internal MachineRunCommandScriptSource(string script, Uri scriptUri, string commandId, RunCommandManagedIdentity scriptUriManagedIdentity, IDictionary serializedAdditionalRawData) + { + Script = script; + ScriptUri = scriptUri; + CommandId = commandId; + ScriptUriManagedIdentity = scriptUriManagedIdentity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the script content to be executed on the machine. + [WirePath("script")] + public string Script { get; set; } + /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. + [WirePath("scriptUri")] + public Uri ScriptUri { get; set; } + /// Specifies the commandId of predefined built-in script. + [WirePath("commandId")] + public string CommandId { get; set; } + /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + [WirePath("scriptUriManagedIdentity")] + public RunCommandManagedIdentity ScriptUriManagedIdentity { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs new file mode 100644 index 000000000000..bc9fb76f71b2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class MachineRunCommandsListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandsListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MachineRunCommandsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MachineRunCommandsListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMachineRunCommandsListResult(document.RootElement, options); + } + + internal static MachineRunCommandsListResult DeserializeMachineRunCommandsListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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(MachineRunCommandData.DeserializeMachineRunCommandData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MachineRunCommandsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MachineRunCommandsListResult)} does not support writing '{options.Format}' format."); + } + } + + MachineRunCommandsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMachineRunCommandsListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MachineRunCommandsListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs new file mode 100644 index 000000000000..259a29d2891d --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the Run Commands List Result. + internal partial class MachineRunCommandsListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MachineRunCommandsListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of run commands. + /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. + /// Keeps track of any properties unknown to the library. + internal MachineRunCommandsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of run commands. + public IReadOnlyList Value { get; } + /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. + public string NextLink { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs new file mode 100644 index 000000000000..fc81240deaae --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class RunCommandInputParameter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RunCommandInputParameter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RunCommandInputParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RunCommandInputParameter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRunCommandInputParameter(document.RootElement, options); + } + + internal static RunCommandInputParameter DeserializeRunCommandInputParameter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RunCommandInputParameter(name, value, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(RunCommandInputParameter)} does not support writing '{options.Format}' format."); + } + } + + RunCommandInputParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRunCommandInputParameter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RunCommandInputParameter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs new file mode 100644 index 000000000000..055d761f8885 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the properties of a run command parameter. + public partial class RunCommandInputParameter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The run command parameter name. + /// The run command parameter value. + /// or is null. + public RunCommandInputParameter(string name, string value) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(value, nameof(value)); + + Name = name; + Value = value; + } + + /// Initializes a new instance of . + /// The run command parameter name. + /// The run command parameter value. + /// Keeps track of any properties unknown to the library. + internal RunCommandInputParameter(string name, string value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RunCommandInputParameter() + { + } + + /// The run command parameter name. + [WirePath("name")] + public string Name { get; set; } + /// The run command parameter value. + [WirePath("value")] + public string Value { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs new file mode 100644 index 000000000000..66e7e2557820 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class RunCommandManagedIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.Value); + } + if (Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RunCommandManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRunCommandManagedIdentity(document.RootElement, options); + } + + internal static RunCommandManagedIdentity DeserializeRunCommandManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid? clientId = default; + Guid? objectId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RunCommandManagedIdentity(clientId, objectId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientId)) + { + builder.Append(" clientId: "); + builder.AppendLine($"'{ClientId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ObjectId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" objectId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ObjectId)) + { + builder.Append(" objectId: "); + builder.AppendLine($"'{ObjectId.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support writing '{options.Format}' format."); + } + } + + RunCommandManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRunCommandManagedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs new file mode 100644 index 000000000000..4bb36250f9c6 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. + public partial class RunCommandManagedIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RunCommandManagedIdentity() + { + } + + /// Initializes a new instance of . + /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. + /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. + /// Keeps track of any properties unknown to the library. + internal RunCommandManagedIdentity(Guid? clientId, Guid? objectId, IDictionary serializedAdditionalRawData) + { + ClientId = clientId; + ObjectId = objectId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. + [WirePath("clientId")] + public Guid? ClientId { get; set; } + /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. + [WirePath("objectId")] + public Guid? ObjectId { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.Serialization.cs new file mode 100644 index 000000000000..d371be39ac7c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class StorageProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Disks)) + { + writer.WritePropertyName("disks"u8); + writer.WriteStartArray(); + foreach (var item in Disks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageProfile(document.RootElement, options); + } + + internal static StorageProfile DeserializeStorageProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList disks = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HybridComputeDisk.DeserializeHybridComputeDisk(item, options)); + } + disks = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageProfile(disks ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Disks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" disks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Disks)) + { + if (Disks.Any()) + { + builder.Append(" disks: "); + builder.AppendLine("["); + foreach (var item in Disks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " disks: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(StorageProfile)} does not support writing '{options.Format}' format."); + } + } + + StorageProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeStorageProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.cs new file mode 100644 index 000000000000..8ed33d5fc468 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/StorageProfile.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the storage configuration of the machine. + internal partial class StorageProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal StorageProfile() + { + Disks = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The disks on the machine. + /// Keeps track of any properties unknown to the library. + internal StorageProfile(IReadOnlyList disks, IDictionary serializedAdditionalRawData) + { + Disks = disks; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disks on the machine. + [WirePath("disks")] + public IReadOnlyList Disks { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index ec2d7cd47818..01c130b3f3be 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string perimeterName, Canc /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string perimeterName, CancellationToken can /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index 3d6644b168c7..c5cb7c716515 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-07-10 + /// 2024-07-31-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs index 76e027678e6f..370b7531759a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs @@ -32,7 +32,7 @@ public ExtensionMetadataRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs new file mode 100644 index 000000000000..785bdb9cc08a --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs @@ -0,0 +1,731 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal partial class GatewaysRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GatewaysRestOperations. + /// 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 GatewaysRestOperations(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 ?? "2024-07-31-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, ArcGatewayData data) + { + 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, ArcGatewayData 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// The operation to create or update a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// Parameters supplied to the Create gateway operation. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string gatewayName, ArcGatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, gatewayName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to create or update a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// Parameters supplied to the Create gateway operation. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string gatewayName, ArcGatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, gatewayName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, ArcGatewayPatch 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, ArcGatewayPatch 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// The operation to update a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// Parameters supplied to the Update gateway operation. + /// 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 gatewayName, ArcGatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, gatewayName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArcGatewayData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArcGatewayData.DeserializeArcGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to update a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// Parameters supplied to the Update gateway operation. + /// 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 gatewayName, ArcGatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, gatewayName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArcGatewayData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArcGatewayData.DeserializeArcGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves information about the view of a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, gatewayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ArcGatewayData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArcGatewayData.DeserializeArcGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ArcGatewayData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves information about the view of a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, gatewayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ArcGatewayData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArcGatewayData.DeserializeArcGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ArcGatewayData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.HybridCompute/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to delete a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, gatewayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to delete a gateway. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Gateway. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, gatewayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + 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.HybridCompute/gateways", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + 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.HybridCompute/gateways", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to get all gateways of a non-Azure machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get all gateways of a non-Azure machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/gateways", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + 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("/providers/Microsoft.HybridCompute/gateways", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to get all gateways of a non-Azure machine. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get all gateways of a non-Azure machine. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + 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; + } + + /// The operation to get all gateways of a non-Azure machine. + /// 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 cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get all gateways of a non-Azure machine. + /// 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 cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + 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; + } + + /// The operation to get all gateways of a non-Azure machine. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get all gateways of a non-Azure machine. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GatewaysListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs index 9ed9e5f0dcd3..88f874f5fb25 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs @@ -31,7 +31,7 @@ public HybridComputeManagementRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs index 8c86ed242e38..e0a5b7c72a19 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs @@ -32,7 +32,7 @@ public LicenseProfilesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs index 517a1e17f9df..36af07990d6f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs @@ -32,7 +32,7 @@ public LicensesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs index a21c68e80b01..214760259067 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public MachineExtensionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -178,7 +178,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG return message; } - /// The operation to update the extension. + /// The operation to create or update the extension. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the machine where the extension should be created or updated. @@ -207,7 +207,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } } - /// The operation to update the extension. + /// The operation to create or update the extension. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the machine where the extension should be created or updated. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs new file mode 100644 index 000000000000..67fd0c0156be --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs @@ -0,0 +1,527 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal partial class MachineRunCommandsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MachineRunCommandsRestOperations. + /// 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 MachineRunCommandsRestOperations(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 ?? "2024-07-31-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands/", false); + uri.AppendPath(runCommandName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands/", false); + uri.AppendPath(runCommandName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// The operation to create or update a run command. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The name of the run command. + /// Parameters supplied to the Create Run Command. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, runCommandName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to create or update a run command. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The name of the run command. + /// Parameters supplied to the Create Run Command. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, runCommandName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands/", false); + uri.AppendPath(runCommandName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands/", false); + uri.AppendPath(runCommandName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to delete a run command. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The name of the run command. + /// 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 machineName, string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to delete a run command. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The name of the run command. + /// 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 machineName, string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands/", false); + uri.AppendPath(runCommandName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands/", false); + uri.AppendPath(runCommandName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to get a run command. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The name of the run command. + /// 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 machineName, string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineRunCommandData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineRunCommandData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get a run command. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The name of the run command. + /// 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 machineName, string runCommandName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineRunCommandData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineRunCommandData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string machineName, string expand) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands", false); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string machineName, string expand) + { + 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.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/runCommands", false); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to get all the run commands of a non-Azure machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. + /// 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 machineName, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, machineName, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineRunCommandsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get all the run commands of a non-Azure machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. + /// 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 machineName, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, machineName, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineRunCommandsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string machineName, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string machineName, string expand) + { + 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; + } + + /// The operation to get all the run commands of a non-Azure machine. + /// 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 hybrid machine. + /// The expand expression to apply on the operation. + /// 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 machineName, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, machineName, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineRunCommandsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get all the run commands of a non-Azure machine. + /// 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 hybrid machine. + /// The expand expression to apply on the operation. + /// 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 machineName, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, machineName, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineRunCommandsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs index 096dbaca21ca..0df92332ba4b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs @@ -32,7 +32,7 @@ public MachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs index 3de41308a598..cd31d730a364 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs @@ -32,7 +32,7 @@ public NetworkProfileRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs index dbd45b9fb0aa..3d00eb49c540 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 1aea81b239d5..81e58e5c272a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 0e66a472dbe0..554dbbb67615 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs index 1be5d5f18c88..c1b5b71e938a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkScopesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-07-10"; + _apiVersion = apiVersion ?? "2024-07-31-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs new file mode 100644 index 000000000000..e82df87a06e8 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs @@ -0,0 +1,165 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal partial class SettingsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SettingsRestOperations. + /// 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 SettingsRestOperations(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 ?? "2024-07-31-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings) + { + 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/", false); + uri.AppendPath(baseProvider, true); + uri.AppendPath("/", false); + uri.AppendPath(baseResourceType, true); + uri.AppendPath("/", false); + uri.AppendPath(baseResourceName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/settings/", false); + uri.AppendPath(settingsResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings) + { + 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/", false); + uri.AppendPath(baseProvider, true); + uri.AppendPath("/", false); + uri.AppendPath(baseResourceType, true); + uri.AppendPath("/", false); + uri.AppendPath(baseResourceName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/settings/", false); + uri.AppendPath(settingsResourceName, 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(arcSettings, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the base Settings of the target resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the base Resource Provider. + /// The name of the base Resource Type. + /// The name of the base resource. + /// The name of the settings resource. + /// Settings details. + /// 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 baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); + Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); + Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); + Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); + Argument.AssertNotNull(arcSettings, nameof(arcSettings)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + ArcSettings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ArcSettings.DeserializeArcSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the base Settings of the target resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the base Resource Provider. + /// The name of the base Resource Type. + /// The name of the base resource. + /// The name of the settings resource. + /// Settings details. + /// 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 baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, ArcSettings arcSettings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); + Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); + Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); + Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); + Argument.AssertNotNull(arcSettings, nameof(arcSettings)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, arcSettings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + ArcSettings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ArcSettings.DeserializeArcSettings(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index c692a6f32387..45c3595acfa2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -8,8 +8,8 @@ azure-arm: true csharp: true library-name: HybridCompute namespace: Azure.ResourceManager.HybridCompute -require: https://github.com/Azure/azure-rest-api-specs/blob/15b16d1b5c3cccdecdd1cfe936f6a8005680c557/specification/hybridcompute/resource-manager/readme.md -tag: package-2024-07 +require: https://github.com/Azure/azure-rest-api-specs/blob/0f300277e21972f20b32ffbff96180217875909b/specification/hybridcompute/resource-manager/readme.md +tag: package-preview-2024-07 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -66,6 +66,11 @@ prepend-rp-prefix: - LicenseProfile - LicenseProfileUpdate - ProductFeatureUpdate + - Disk + - HardwareProfile + - Processor + - ExecutionState + - FirmwareProfile list-exception: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} @@ -103,6 +108,14 @@ rename-mapping: OSProfileWindowsConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled PatchSettingsStatus: HybridComputePatchSettingsStatus OSProfileLinuxConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled + GatewayType: ArcGatewayType + GatewayUpdate: ArcGatewayUpdate + Gateway: ArcGateway + Settings: ArcSettings + NetworkInterface.id: -|arm-id + RunCommandManagedIdentity.clientId: -|uuid + RunCommandManagedIdentity.objectId: -|uuid + Disk.id: -|arm-id format-by-name-rules: 'tenantId': 'uuid' @@ -178,6 +191,10 @@ directive: where: $.definitions.MachineAssessPatchesResult.properties.assessmentActivityId transform: $['format'] = 'uuid' + - from: HybridCompute.json + where: $.definitions.GatewayProperties.properties.gatewayId + transform: $['format'] = 'arm-id' + # set expand property of list and show to be both strings - from: HybridCompute.json where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}"].get.parameters @@ -212,41 +229,41 @@ directive: ] # add 200 response to run-command delete - comment out for stable release - # - from: HybridCompute.json - # where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"].delete.responses - # transform: >- - # return { - # "200": { - # "description": "OK" - # }, - # "202": { - # "description": "Accepted", - # "headers": { - # "Location": { - # "description": "The URL of the resource used to check the status of the asynchronous operation.", - # "type": "string" - # }, - # "Retry-After": { - # "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", - # "type": "integer", - # "format": "int32" - # }, - # "Azure-AsyncOperation": { - # "description": "The URI to poll for completion status.", - # "type": "string" - # } - # } - # }, - # "204": { - # "description": "No Content" - # }, - # "default": { - # "description": "Error response describing why the operation failed.", - # "schema": { - # "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/f6278b35fb38d62aadb7a4327a876544d5d7e1e4/specification/common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - # } - # } - # } + - from: HybridCompute.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"].delete.responses + transform: >- + return { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted", + "headers": { + "Location": { + "description": "The URL of the resource used to check the status of the asynchronous operation.", + "type": "string" + }, + "Retry-After": { + "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", + "type": "integer", + "format": "int32" + }, + "Azure-AsyncOperation": { + "description": "The URI to poll for completion status.", + "type": "string" + } + } + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + } # we don't want user to interact with them / we don't support some operations - comment out for stable release # - remove-operation: MachineRunCommands_Update #PATCH diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs index 1d2d53782a5f..515ac26d0a32 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs @@ -26,16 +26,18 @@ public class HybridComputeManagementTestBase : ManagementRecordedTestBase installPatch() VmGuestPatchClassificationWindow.Critical,VmGuestPatchClassificationWindow.Security }, // The maximum published date for patches must be a DateTime value between last patch Tuesday and a week from today - MaxPatchPublishOn = DateTimeOffset.Parse("2024-10-15T02:36:43.0539904+00:00"), + MaxPatchPublishOn = DateTimeOffset.Parse("2024-11-20T02:36:43.0539904+00:00"), }, }; ArmOperation lro = await hybridComputeMachine.InstallPatchesAsync(WaitUntil.Completed, content); @@ -336,90 +338,90 @@ protected async Task getPrivat return connectionCollection; } - // protected async Task createRunCommand() - // { - // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - - // MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("centraluseuap")) - // { - // Source = new MachineRunCommandScriptSource() - // { - // Script = "Write-Host Hello World!", - // }, - // Parameters = - // { - // new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") - // }, - // // AsyncExecution = false, - // // RunAsUser = "user1", - // // RunAsPassword = "", - // // TimeoutInSeconds = 3600, - // // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // }; - // ArmOperation lro = await runCommandCollection.CreateOrUpdateAsync(WaitUntil.Completed, runCommandName, data); - // MachineRunCommandResource result = lro.Value; - - // return result.Data; - // } - - // protected async Task updateRunCommand() - // { - // ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); - // MachineRunCommandResource machineRunCommand = ArmClient.GetMachineRunCommandResource(machineRunCommandResourceId); - - // MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("centraluseuap")) - // { - // Source = new MachineRunCommandScriptSource() - // { - // Script = "Write-Host Hello World!", - // }, - // Parameters = - // { - // new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") - // }, - // // AsyncExecution = false, - // // RunAsUser = "user1", - // // RunAsPassword = "", - // // TimeoutInSeconds = 3600, - // // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // Tags = - // { - // ["Tag1"] = "Value1", - // ["Tag2"] = "Value2", - // }, - // }; - // ArmOperation lro = await machineRunCommand.UpdateAsync(WaitUntil.Completed, data); - // MachineRunCommandResource result = lro.Value; - - // return result.Data; - // } - - // protected async Task getRunCommand() - // { - // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - - // MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); - - // return result.Data; - // } - - // protected async Task getRunCommandCollection() - // { - // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - - // await foreach (MachineRunCommandResource item in runCommandCollection.GetAllAsync()) - // { - // MachineRunCommandData resourceData = item.Data; - // Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - // } - - // return runCommandCollection; - // } + protected async Task createRunCommand() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + + MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("eastus")) + { + Source = new MachineRunCommandScriptSource() + { + Script = "Write-Host Hello World!", + }, + Parameters = + { + new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") + }, + // AsyncExecution = false, + // RunAsUser = "user1", + // RunAsPassword = "", + // TimeoutInSeconds = 3600, + // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), + // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), + }; + ArmOperation lro = await runCommandCollection.CreateOrUpdateAsync(WaitUntil.Completed, runCommandName, data); + MachineRunCommandResource result = lro.Value; + + return result.Data; + } + + protected async Task updateRunCommand() + { + ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); + MachineRunCommandResource machineRunCommand = ArmClient.GetMachineRunCommandResource(machineRunCommandResourceId); + + MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("eastus")) + { + Source = new MachineRunCommandScriptSource() + { + Script = "Write-Host Hello World!", + }, + Parameters = + { + new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") + }, + // AsyncExecution = false, + // RunAsUser = "user1", + // RunAsPassword = "", + // TimeoutInSeconds = 3600, + // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), + // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), + Tags = + { + ["Tag1"] = "Value1", + ["Tag2"] = "Value2", + }, + }; + ArmOperation lro = await machineRunCommand.UpdateAsync(WaitUntil.Completed, data); + MachineRunCommandResource result = lro.Value; + + return result.Data; + } + + protected async Task getRunCommand() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + + MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); + + return result.Data; + } + + protected async Task getRunCommandCollection() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + + await foreach (MachineRunCommandResource item in runCommandCollection.GetAllAsync()) + { + MachineRunCommandData resourceData = item.Data; + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + return runCommandCollection; + } protected async Task createEsuLicense() { @@ -487,6 +489,65 @@ protected async Task updateEsuLicense() return result.Data; } + protected async Task createLicenseProfile() + { + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupNameProfile, machineNamePaygo); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = ArmClient.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); + + // invoke the operation + HybridComputeLicenseProfileData data = new HybridComputeLicenseProfileData(new AzureLocation("eastus")) + { + SubscriptionStatus = LicenseProfileSubscriptionStatus.Enabled, + ProductType = LicenseProfileProductType.WindowsServer, + ProductFeatures = + { + new HybridComputeProductFeature() + { + Name = "Hotpatch", + SubscriptionStatus = LicenseProfileSubscriptionStatus.Enabled, + } + }, + }; + ArmOperation lro = await hybridComputeLicenseProfile.CreateOrUpdateAsync(WaitUntil.Completed, data); + HybridComputeLicenseProfileResource result = lro.Value; + + return result.Data; + } + + protected async Task getLicenseProfile() + { + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupNameProfile, machineNamePaygo); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = ArmClient.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); + + HybridComputeLicenseProfileResource result = await hybridComputeLicenseProfile.GetAsync(); + + return result.Data; + } + + protected async Task updateLicenseProfile() + { + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupNameProfile, machineNamePaygo); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = ArmClient.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); + + HybridComputeLicenseProfilePatch patch = new HybridComputeLicenseProfilePatch() + { + SubscriptionStatus = LicenseProfileSubscriptionStatusUpdate.Enable, + ProductType = LicenseProfileProductType.WindowsServer, + ProductFeatures = + { + new HybridComputeProductFeatureUpdate() + { + Name = "Hotpatch", + SubscriptionStatus = LicenseProfileSubscriptionStatusUpdate.Enable, + } + }, + }; + ArmOperation lro = await hybridComputeLicenseProfile.UpdateAsync(WaitUntil.Completed, patch); + HybridComputeLicenseProfileResource result = lro.Value; + + return result.Data; + } + protected async Task getNspCollection() { ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupNameNSP, privateLinkScopeNameNSP); @@ -526,6 +587,15 @@ protected async Task invokeNsp() Console.WriteLine($"Invoke NSP Succeeded"); } + protected async Task deleteLicenseProfile() + { + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupNameProfile, machineNamePaygo); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = ArmClient.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); + + await hybridComputeLicenseProfile.DeleteAsync(WaitUntil.Completed); + Console.WriteLine($"Delete License Profile Succeeded"); + } + protected async Task deleteEsuLicense() { ResourceIdentifier hybridComputeLicenseResourceId = HybridComputeLicenseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, esuLicenseName); @@ -536,16 +606,16 @@ protected async Task deleteEsuLicense() Console.WriteLine($"Delete ESU License Succeeded"); } - // protected async Task deleteRunCommand() - // { - // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + protected async Task deleteRunCommand() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - // MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); + MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); - // await result.DeleteAsync(WaitUntil.Completed); - // Console.WriteLine($"Delete Machine Run Command Succeeded"); - // } + await result.DeleteAsync(WaitUntil.Completed); + Console.WriteLine($"Delete Machine Run Command Succeeded"); + } protected async Task deletePrivateLinkScope() { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementEsuLicenseTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementEsuLicenseTest.cs index 6c3bf6a5a556..e950afb7162e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementEsuLicenseTest.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementEsuLicenseTest.cs @@ -58,10 +58,40 @@ public async Task CanGetEsuLicenseCollection() Assert.IsNotNull(resourceCollection); } + [TestCase] + [RecordedTest] + public async Task CanCreateLicenseProfile() + { + HybridComputeLicenseProfileData resourceData = await createLicenseProfile(); + Assert.AreEqual("default", resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetLicenseProfile() + { + HybridComputeLicenseProfileData resourceData = await getLicenseProfile(); + Assert.AreEqual("default", resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanUpdateLicenseProfile() + { + HybridComputeLicenseProfileData resourceData = await updateLicenseProfile(); + Assert.AreEqual("default", resourceData.Name); + } + [TestCase] [RecordedTest] public async Task CanDeleteEsuLicense(){ await deleteEsuLicense(); } + + [TestCase] + [RecordedTest] + public async Task CanDeleteLicenseProfile(){ + await deleteLicenseProfile(); + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs index 55586f51ec50..0e57277d9c83 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs @@ -109,14 +109,7 @@ public async Task CanGetPrivateLinkResourceCollection() Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); } - [TestCase] - [RecordedTest] - public async Task CanUpdatePrivateEndpointConnection() - { - HybridComputePrivateEndpointConnectionData endpointData = await updatePrivateEndpointConnection(); - Assert.AreEqual(privateEndpointConnectionName, endpointData.Name); - } - + // you might have to create an endpoint connection and get its name before running this function [TestCase] [RecordedTest] public async Task CanGetPrivateEndpointConnection() @@ -134,6 +127,14 @@ public async Task CanGetPrivateEndpointConnectionCollection() Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); } + [TestCase] + [RecordedTest] + public async Task CanUpdatePrivateEndpointConnection() + { + HybridComputePrivateEndpointConnectionData endpointData = await updatePrivateEndpointConnection(); + Assert.AreEqual(privateEndpointConnectionName, endpointData.Name); + } + [TestCase] [RecordedTest] public async Task CanDeletePrivateEndpointConnection(){ diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs new file mode 100644 index 000000000000..086238d23d49 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.HybridCompute; +using NUnit.Framework; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using System.Diagnostics; + +namespace Azure.ResourceManager.HybridCompute.Tests.Scenario +{ + public class HybridComputeManagementMachineRunCommandsTest : HybridComputeManagementTestBase + { + public HybridComputeManagementMachineRunCommandsTest(bool isAsync) : base(isAsync) + { + } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task CanCreateMachineRunCommand() + { + MachineRunCommandData resourceData = await createRunCommand(); + Assert.AreEqual(runCommandName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanUpdateMachineRunCommand() + { + MachineRunCommandData resourceData = await updateRunCommand(); + Assert.AreEqual(runCommandName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetMachineRunCommand() + { + MachineRunCommandData resourceData = await getRunCommand(); + Assert.AreEqual(runCommandName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetMachineRunCommandCollection() + { + MachineRunCommandCollection resourceCollection = await getRunCommandCollection(); + string collectionId = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName; + Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanDeleteMachineRunCommand(){ + await deleteRunCommand(); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs index 6033aee95d75..43f230b1dfa9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs @@ -64,6 +64,7 @@ public async Task CanAssessPatch(){ Assert.AreEqual("Succeeded", resourceData.Status.ToString()); } + // have to have a valid private link scope before running this function [TestCase] [RecordedTest] public async Task CanUpdateMachine()