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 6000b9f53c0e5..f137792499165 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,41 @@ namespace Azure.ResourceManager.HybridCompute { + public partial class ExtensionValueCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ExtensionValueCollection() { } + public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string version, 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 version, 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 ExtensionValueData : Azure.ResourceManager.Models.ResourceData + { + public ExtensionValueData() { } + public string ExtensionType { get { throw null; } } + public string Publisher { get { throw null; } } + public string Version { get { throw null; } } + } + public partial class ExtensionValueResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ExtensionValueResource() { } + public virtual Azure.ResourceManager.HybridCompute.ExtensionValueData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, string publisher, string extensionType, string version) { 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 static partial class HybridComputeExtensions { + public static Azure.Response GetExtensionValue(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> GetExtensionValueAsync(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.ExtensionValueResource GetExtensionValueResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridCompute.ExtensionValueCollection GetExtensionValues(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } public static Azure.Response GetHybridComputeMachine(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string machineName, Azure.ResourceManager.HybridCompute.Models.InstanceViewType? expand = default(Azure.ResourceManager.HybridCompute.Models.InstanceViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHybridComputeMachineAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string machineName, Azure.ResourceManager.HybridCompute.Models.InstanceViewType? expand = default(Azure.ResourceManager.HybridCompute.Models.InstanceViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -38,9 +72,35 @@ protected HybridComputeMachineCollection() { } public partial class HybridComputeMachineData : Azure.ResourceManager.Models.TrackedResourceData { public HybridComputeMachineData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public string AdFqdn { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration { get { throw null; } } + public string AgentVersion { get { throw null; } } + public string ClientPublicKey { get { throw null; } set { } } + public string CloudMetadataProvider { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DetectedProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public string DnsFqdn { get { throw null; } } + 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.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineProperties Properties { get { throw null; } set { } } + public System.DateTimeOffset? LastStatusChange { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } + public string MachineFqdn { get { throw null; } } + public string MssqlDiscovered { get { throw null; } set { } } + public string OSName { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } + public string OSSku { get { throw null; } } + public string OSType { get { throw null; } set { } } + public string OSVersion { get { throw null; } } + public string ParentClusterResourceId { get { throw null; } set { } } + public string PrivateLinkScopeResourceId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } 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 string VmId { get { throw null; } set { } } + public string VmUuid { get { throw null; } } } public partial class HybridComputeMachineExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -60,7 +120,16 @@ protected HybridComputeMachineExtensionCollection() { } public partial class HybridComputeMachineExtensionData : Azure.ResourceManager.Models.TrackedResourceData { public HybridComputeMachineExtensionData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } - public Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties Properties { get { throw null; } set { } } + public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } + public bool? EnableAutomaticUpgrade { get { throw null; } set { } } + public string ForceUpdateTag { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView InstanceView { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + public string TypeHandlerVersion { get { throw null; } set { } } + public string TypePropertiesType { get { throw null; } set { } } } public partial class HybridComputeMachineExtensionResource : Azure.ResourceManager.ArmResource { @@ -291,13 +360,24 @@ public ExtensionTargetProperties() { } public partial class HybridComputeMachineExtensionPatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate { public HybridComputeMachineExtensionPatch() { } - public Azure.ResourceManager.HybridCompute.Models.MachineExtensionUpdateProperties Properties { get { throw null; } set { } } + public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } + public bool? EnableAutomaticUpgrade { get { throw null; } set { } } + public string ForceUpdateTag { get { throw null; } set { } } + public string MachineExtensionUpdatePropertiesType { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + public string TypeHandlerVersion { get { throw null; } set { } } } public partial class HybridComputeMachinePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate { public HybridComputeMachinePatch() { } + public string CloudMetadataProvider { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineUpdateProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } + public string ParentClusterResourceId { get { throw null; } set { } } + public string PrivateLinkScopeResourceId { get { throw null; } set { } } } public partial class HybridComputePrivateLinkResourceProperties { @@ -423,76 +503,11 @@ public MachineExtensionInstanceViewStatus() { } public string Message { get { throw null; } set { } } public System.DateTimeOffset? Time { get { throw null; } set { } } } - public partial class MachineExtensionProperties - { - public MachineExtensionProperties() { } - public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } - public bool? EnableAutomaticUpgrade { get { throw null; } set { } } - public string ForceUpdateTag { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView InstanceView { get { throw null; } set { } } - public string MachineExtensionPropertiesType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } - public string ProvisioningState { get { throw null; } } - public string Publisher { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Settings { get { throw null; } } - public string TypeHandlerVersion { get { throw null; } set { } } - } - public partial class MachineExtensionUpdateProperties - { - public MachineExtensionUpdateProperties() { } - public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } - public bool? EnableAutomaticUpgrade { get { throw null; } set { } } - public string ForceUpdateTag { get { throw null; } set { } } - public string MachineExtensionUpdatePropertiesType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } - public string Publisher { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Settings { get { throw null; } } - public string TypeHandlerVersion { get { throw null; } set { } } - } public partial class MachineExtensionUpgrade { public MachineExtensionUpgrade() { } public System.Collections.Generic.IDictionary ExtensionTargets { get { throw null; } } } - public partial class MachineProperties - { - public MachineProperties() { } - public string AdFqdn { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration { get { throw null; } } - public string AgentVersion { get { throw null; } } - public string ClientPublicKey { get { throw null; } set { } } - public string CloudMetadataProvider { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DetectedProperties { get { throw null; } } - public string DisplayName { get { throw null; } } - public string DnsFqdn { get { throw null; } } - public string DomainName { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ErrorDetails { get { throw null; } } - public System.DateTimeOffset? LastStatusChange { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } - public string MachineFqdn { get { throw null; } } - public string MssqlDiscovered { get { throw null; } set { } } - public string OSName { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } - public string OSSku { get { throw null; } } - public string OSType { get { throw null; } set { } } - public string OSVersion { get { throw null; } } - public string ParentClusterResourceId { get { throw null; } set { } } - public string PrivateLinkScopeResourceId { get { throw null; } set { } } - public string ProvisioningState { 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 string VmId { get { throw null; } set { } } - public string VmUuid { get { throw null; } } - } - public partial class MachineUpdateProperties - { - public MachineUpdateProperties() { } - public string CloudMetadataProvider { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } - public string ParentClusterResourceId { get { throw null; } set { } } - public string PrivateLinkScopeResourceId { get { throw null; } set { } } - } public partial class OSProfile { public OSProfile() { } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueCollection.cs new file mode 100644 index 0000000000000..3377f543b1367 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueCollection.cs @@ -0,0 +1,249 @@ +// 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.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +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 GetExtensionValues method from an instance of . + /// + public partial class ExtensionValueCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _extensionValueExtensionMetadataClientDiagnostics; + private readonly ExtensionMetadataRestOperations _extensionValueExtensionMetadataRestClient; + private readonly AzureLocation _location; + private readonly string _publisher; + private readonly string _extensionType; + + /// Initializes a new instance of the class for mocking. + protected ExtensionValueCollection() + { + } + + /// 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. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + internal ExtensionValueCollection(ArmClient client, ResourceIdentifier id, AzureLocation location, string publisher, string extensionType) : base(client, id) + { + _location = location; + _publisher = publisher; + _extensionType = extensionType; + _extensionValueExtensionMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ExtensionValueResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExtensionValueResource.ResourceType, out string extensionValueExtensionMetadataApiVersion); + _extensionValueExtensionMetadataRestClient = new ExtensionMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, extensionValueExtensionMetadataApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Get"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Get"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all Extension versions based on location, publisher, extensionType + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions + /// Operation Id: ExtensionMetadata_List + /// + /// 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) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.GetAll"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.ListAsync(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ExtensionValueResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Gets all Extension versions based on location, publisher, extensionType + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions + /// Operation Id: ExtensionMetadata_List + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.GetAll"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.List(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ExtensionValueResource(Client, value)), null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Exists"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, 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}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Exists"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueData.cs new file mode 100644 index 0000000000000..db8ff0b45576d --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + /// A class representing the ExtensionValue data model. + public partial class ExtensionValueData : ResourceData + { + /// Initializes a new instance of ExtensionValueData. + public ExtensionValueData() + { + } + + /// Initializes a new instance of ExtensionValueData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The version of the Extension being received. + /// The type of the Extension being received. + /// The publisher of the Extension being received. + internal ExtensionValueData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string version, string extensionType, string publisher) : base(id, name, resourceType, systemData) + { + Version = version; + ExtensionType = extensionType; + Publisher = publisher; + } + + /// The version of the Extension being received. + public string Version { get; } + /// The type of the Extension being received. + public string ExtensionType { get; } + /// The publisher of the Extension being received. + public string Publisher { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueResource.cs new file mode 100644 index 0000000000000..069541eaacc39 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueResource.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A Class representing an ExtensionValue 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 GetExtensionValueResource method. + /// Otherwise you can get one from its parent resource using the GetExtensionValue method. + /// + public partial class ExtensionValueResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string publisher, string extensionType, string version) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _extensionValueExtensionMetadataClientDiagnostics; + private readonly ExtensionMetadataRestOperations _extensionValueExtensionMetadataRestClient; + private readonly ExtensionValueData _data; + + /// Initializes a new instance of the class for mocking. + protected ExtensionValueResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExtensionValueResource(ArmClient client, ExtensionValueData 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 ExtensionValueResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _extensionValueExtensionMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string extensionValueExtensionMetadataApiVersion); + _extensionValueExtensionMetadataRestClient = new ExtensionMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, extensionValueExtensionMetadataApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/locations/publishers/extensionTypes/versions"; + + /// 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 ExtensionValueData 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)); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueResource.Get"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueResource.Get"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} 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 1697f35b1ad6b..2b0568e50b730 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -28,6 +28,60 @@ private static SubscriptionResourceExtensionClient GetExtensionClient(Subscripti ); } + /// Gets a collection of ExtensionValueResources in the SubscriptionResource. + /// The instance the method will execute against. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + /// An object representing collection of ExtensionValueResources and their operations over a ExtensionValueResource. + public static ExtensionValueCollection GetExtensionValues(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType) + { + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + + return GetExtensionClient(subscriptionResource).GetExtensionValues(location, publisher, extensionType); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The instance the method will execute against. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. + [ForwardsClientCalls] + public static async Task> GetExtensionValueAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + return await subscriptionResource.GetExtensionValues(location, publisher, extensionType).GetAsync(version, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// Operation Id: ExtensionMetadata_Get + /// + /// The instance the method will execute against. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. + [ForwardsClientCalls] + public static Response GetExtensionValue(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + return subscriptionResource.GetExtensionValues(location, publisher, extensionType).Get(version, cancellationToken); + } + /// /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines @@ -245,6 +299,25 @@ public static HybridComputeMachineExtensionResource GetHybridComputeMachineExten } #endregion + #region ExtensionValueResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ExtensionValueResource GetExtensionValueResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ExtensionValueResource.ValidateResourceId(id); + return new ExtensionValueResource(client, id); + } + ); + } + #endregion + #region HybridComputePrivateLinkScopeResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 8f7511fd6fb04..4ef7cc898eb5b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -48,6 +48,16 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of ExtensionValueResources in the SubscriptionResource. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// An object representing collection of ExtensionValueResources and their operations over a ExtensionValueResource. + public virtual ExtensionValueCollection GetExtensionValues(AzureLocation location, string publisher, string extensionType) + { + return new ExtensionValueCollection(Client, Id, location, publisher, extensionType); + } + /// /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs index a7644de3d6922..85c3352e67978 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs @@ -5,7 +5,9 @@ #nullable disable +using System; using System.Collections.Generic; +using Azure; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Models; @@ -20,6 +22,9 @@ public partial class HybridComputeMachineData : TrackedResourceData public HybridComputeMachineData(AzureLocation location) : base(location) { Resources = new ChangeTrackingList(); + ErrorDetails = new ChangeTrackingList(); + Extensions = new ChangeTrackingList(); + DetectedProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of HybridComputeMachineData. @@ -29,21 +34,131 @@ public HybridComputeMachineData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Hybrid Compute Machine properties. /// The list of extensions affiliated to the machine. /// Identity for the resource. Current supported identity types: SystemAssigned. - internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MachineProperties properties, IReadOnlyList resources, ManagedServiceIdentity identity) : base(id, name, resourceType, systemData, tags, 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. + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + /// Specifies the operating system settings for the hybrid 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. + /// 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. + internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IReadOnlyList resources, ManagedServiceIdentity identity, LocationData locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, CloudMetadata cloudMetadata, OSProfile osProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IReadOnlyList errorDetails, string agentVersion, string vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, string vmUuid, IList extensions, string osSku, string domainName, string adFqdn, string dnsFqdn, string privateLinkScopeResourceId, string parentClusterResourceId, string mssqlDiscovered, IReadOnlyDictionary detectedProperties) : base(id, name, resourceType, systemData, tags, location) { - Properties = properties; Resources = resources; Identity = identity; + LocationData = locationData; + AgentConfiguration = agentConfiguration; + ServiceStatuses = serviceStatuses; + CloudMetadata = cloudMetadata; + OSProfile = osProfile; + 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; + DomainName = domainName; + AdFqdn = adFqdn; + DnsFqdn = dnsFqdn; + PrivateLinkScopeResourceId = privateLinkScopeResourceId; + ParentClusterResourceId = parentClusterResourceId; + MssqlDiscovered = mssqlDiscovered; + DetectedProperties = detectedProperties; } - /// Hybrid Compute Machine properties. - public MachineProperties Properties { get; set; } /// The list of extensions affiliated to the machine. public IReadOnlyList Resources { get; } /// Identity for the resource. Current supported identity types: SystemAssigned. public ManagedServiceIdentity Identity { get; set; } + /// Metadata pertaining to the geographic location of the resource. + public LocationData LocationData { get; set; } + /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + public AgentConfiguration AgentConfiguration { get; } + /// Statuses of dependent services that are reported back to ARM. + public HybridComputeServiceStatuses ServiceStatuses { get; set; } + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + internal CloudMetadata CloudMetadata { get; set; } + /// Specifies the cloud provider (Azure/AWS/GCP...). + public string CloudMetadataProvider + { + get => CloudMetadata is null ? default : CloudMetadata.Provider; + } + + /// Specifies the operating system settings for the hybrid machine. + public OSProfile OSProfile { get; set; } + /// The provisioning state, which only appears in the response. + public string ProvisioningState { get; } + /// The status of the hybrid machine agent. + public HybridComputeStatusType? Status { get; } + /// The time of the last status change. + public DateTimeOffset? LastStatusChange { get; } + /// Details about the error state. + public IReadOnlyList ErrorDetails { get; } + /// The hybrid machine agent full version. + public string AgentVersion { get; } + /// Specifies the hybrid machine unique ID. + public string VmId { get; set; } + /// Specifies the hybrid machine display name. + public string DisplayName { get; } + /// Specifies the hybrid machine FQDN. + public string MachineFqdn { get; } + /// Public Key that the client provides to be used during initial resource onboarding. + public string ClientPublicKey { get; set; } + /// The Operating System running on the hybrid machine. + public string OSName { get; } + /// The version of Operating System running on the hybrid machine. + public string OSVersion { get; } + /// The type of Operating System (windows/linux). + public string OSType { get; set; } + /// Specifies the Arc Machine's unique SMBIOS ID. + public string VmUuid { get; } + /// Machine Extensions information (deprecated field). + public IList Extensions { get; } + /// Specifies the Operating System product SKU. + public string OSSku { get; } + /// Specifies the Windows domain name. + public string DomainName { get; } + /// Specifies the AD fully qualified display name. + public string AdFqdn { get; } + /// Specifies the DNS fully qualified display name. + public string DnsFqdn { get; } + /// The resource id of the private link scope this machine is assigned to, if any. + public string PrivateLinkScopeResourceId { get; set; } + /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + public string ParentClusterResourceId { get; set; } + /// Specifies whether any MS SQL instance is discovered on the machine. + public string MssqlDiscovered { get; set; } + /// Detected properties from the machine. + public IReadOnlyDictionary DetectedProperties { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs index 04f7836b21f16..da683de93413b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; @@ -19,6 +20,8 @@ public partial class HybridComputeMachineExtensionData : TrackedResourceData /// The location. public HybridComputeMachineExtensionData(AzureLocation location) : base(location) { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); } /// Initializes a new instance of HybridComputeMachineExtensionData. @@ -28,13 +31,107 @@ public HybridComputeMachineExtensionData(AzureLocation location) : base(location /// The systemData. /// The tags. /// The location. - /// Describes Machine Extension Properties. - internal HybridComputeMachineExtensionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MachineExtensionProperties properties) : base(id, name, resourceType, systemData, tags, location) + /// How the extension handler should be forced to update even if the extension configuration has not changed. + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + /// Json formatted public settings for the extension. + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// The provisioning state, which only appears in the response. + /// The machine extension instance view. + internal HybridComputeMachineExtensionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string forceUpdateTag, string publisher, string typePropertiesType, string typeHandlerVersion, bool? enableAutomaticUpgrade, bool? autoUpgradeMinorVersion, IDictionary settings, IDictionary protectedSettings, string provisioningState, MachineExtensionInstanceView instanceView) : base(id, name, resourceType, systemData, tags, location) { - Properties = properties; + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + TypePropertiesType = typePropertiesType; + TypeHandlerVersion = typeHandlerVersion; + EnableAutomaticUpgrade = enableAutomaticUpgrade; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisioningState = provisioningState; + InstanceView = instanceView; } - /// Describes Machine Extension Properties. - public MachineExtensionProperties Properties { get; set; } + /// How the extension handler should be forced to update even if the extension configuration has not changed. + public string ForceUpdateTag { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// Specifies the type of the extension; an example is "CustomScriptExtension". + public string TypePropertiesType { get; set; } + /// Specifies the version of the script handler. + public string TypeHandlerVersion { get; set; } + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + public bool? EnableAutomaticUpgrade { get; set; } + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + public bool? AutoUpgradeMinorVersion { get; set; } + /// + /// Json formatted public settings for the extension. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary Settings { get; } + /// + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary ProtectedSettings { get; } + /// The provisioning state, which only appears in the response. + public string ProvisioningState { get; } + /// The machine extension instance view. + public MachineExtensionInstanceView InstanceView { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueData.Serialization.cs new file mode 100644 index 0000000000000..d937ce91581c7 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueData.Serialization.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class ExtensionValueData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ExtensionValueData DeserializeExtensionValueData(JsonElement element) + { + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional version = default; + Optional extensionType = default; + Optional publisher = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("version")) + { + version = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extensionType")) + { + extensionType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publisher")) + { + publisher = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ExtensionValueData(id, name, type, systemData.Value, version.Value, extensionType.Value, publisher.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs new file mode 100644 index 0000000000000..6ed8c4d40812c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridCompute; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class ExtensionValueListResult + { + internal static ExtensionValueListResult DeserializeExtensionValueListResult(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExtensionValueData.DeserializeExtensionValueData(item)); + } + value = array; + continue; + } + } + return new ExtensionValueListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.cs new file mode 100644 index 0000000000000..4ea9b991b8850 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridCompute; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The List Extension Metadata response. + internal partial class ExtensionValueListResult + { + /// Initializes a new instance of ExtensionValueListResult. + internal ExtensionValueListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ExtensionValueListResult. + /// The list of extension metadata. + internal ExtensionValueListResult(IReadOnlyList value) + { + Value = value; + } + + /// The list of extension metadata. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs index 2a7c89c8422df..f77ebcd197a88 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs @@ -5,8 +5,10 @@ #nullable disable +using System; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Models; @@ -18,11 +20,6 @@ public partial class HybridComputeMachineData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteObjectValue(Properties); - } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"); @@ -41,12 +38,74 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("location"); writer.WriteStringValue(Location); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(LocationData)) + { + writer.WritePropertyName("locationData"); + writer.WriteObjectValue(LocationData); + } + if (Optional.IsDefined(ServiceStatuses)) + { + writer.WritePropertyName("serviceStatuses"); + writer.WriteObjectValue(ServiceStatuses); + } + if (Optional.IsDefined(CloudMetadata)) + { + writer.WritePropertyName("cloudMetadata"); + writer.WriteObjectValue(CloudMetadata); + } + if (Optional.IsDefined(OSProfile)) + { + writer.WritePropertyName("osProfile"); + writer.WriteObjectValue(OSProfile); + } + if (Optional.IsDefined(VmId)) + { + writer.WritePropertyName("vmId"); + writer.WriteStringValue(VmId); + } + if (Optional.IsDefined(ClientPublicKey)) + { + writer.WritePropertyName("clientPublicKey"); + writer.WriteStringValue(ClientPublicKey); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"); + writer.WriteStringValue(OSType); + } + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PrivateLinkScopeResourceId)) + { + writer.WritePropertyName("privateLinkScopeResourceId"); + writer.WriteStringValue(PrivateLinkScopeResourceId); + } + if (Optional.IsDefined(ParentClusterResourceId)) + { + writer.WritePropertyName("parentClusterResourceId"); + writer.WriteStringValue(ParentClusterResourceId); + } + if (Optional.IsDefined(MssqlDiscovered)) + { + writer.WritePropertyName("mssqlDiscovered"); + writer.WriteStringValue(MssqlDiscovered); + } + writer.WriteEndObject(); writer.WriteEndObject(); } internal static HybridComputeMachineData DeserializeHybridComputeMachineData(JsonElement element) { - Optional properties = default; Optional> resources = default; Optional identity = default; Optional> tags = default; @@ -55,18 +114,35 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso string name = default; ResourceType type = default; Optional systemData = default; + Optional locationData = default; + Optional agentConfiguration = default; + Optional serviceStatuses = default; + Optional cloudMetadata = default; + Optional osProfile = default; + Optional provisioningState = default; + Optional status = default; + Optional lastStatusChange = default; + Optional> errorDetails = default; + Optional agentVersion = default; + Optional vmId = default; + Optional displayName = default; + Optional machineFqdn = default; + Optional clientPublicKey = default; + Optional osName = default; + Optional osVersion = default; + Optional osType = default; + Optional vmUuid = default; + Optional> extensions = default; + Optional osSku = default; + Optional domainName = default; + Optional adFqdn = default; + Optional dnsFqdn = default; + Optional privateLinkScopeResourceId = default; + Optional parentClusterResourceId = default; + Optional mssqlDiscovered = default; + Optional> detectedProperties = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = MachineProperties.DeserializeMachineProperties(property.Value); - continue; - } if (property.NameEquals("resources")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -137,8 +213,220 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("locationData")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + locationData = LocationData.DeserializeLocationData(property0.Value); + continue; + } + if (property0.NameEquals("agentConfiguration")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + agentConfiguration = AgentConfiguration.DeserializeAgentConfiguration(property0.Value); + continue; + } + if (property0.NameEquals("serviceStatuses")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + serviceStatuses = HybridComputeServiceStatuses.DeserializeHybridComputeServiceStatuses(property0.Value); + continue; + } + if (property0.NameEquals("cloudMetadata")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + cloudMetadata = CloudMetadata.DeserializeCloudMetadata(property0.Value); + continue; + } + if (property0.NameEquals("osProfile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + osProfile = OSProfile.DeserializeOSProfile(property0.Value); + continue; + } + if (property0.NameEquals("provisioningState")) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new HybridComputeStatusType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("lastStatusChange")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + lastStatusChange = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("errorDetails")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errorDetails = array; + continue; + } + if (property0.NameEquals("agentVersion")) + { + agentVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmId")) + { + vmId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("displayName")) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("machineFqdn")) + { + machineFqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientPublicKey")) + { + clientPublicKey = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osName")) + { + osName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osVersion")) + { + osVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osType")) + { + osType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmUuid")) + { + vmUuid = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extensions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MachineExtensionInstanceView.DeserializeMachineExtensionInstanceView(item)); + } + extensions = array; + continue; + } + if (property0.NameEquals("osSku")) + { + osSku = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainName")) + { + domainName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("adFqdn")) + { + adFqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("dnsFqdn")) + { + dnsFqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privateLinkScopeResourceId")) + { + privateLinkScopeResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("parentClusterResourceId")) + { + parentClusterResourceId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("mssqlDiscovered")) + { + mssqlDiscovered = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("detectedProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + detectedProperties = dictionary; + continue; + } + } + continue; + } } - return new HybridComputeMachineData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties.Value, Optional.ToList(resources), identity); + return new HybridComputeMachineData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToList(resources), identity, locationData.Value, agentConfiguration.Value, serviceStatuses.Value, cloudMetadata.Value, osProfile.Value, provisioningState.Value, Optional.ToNullable(status), Optional.ToNullable(lastStatusChange), Optional.ToList(errorDetails), agentVersion.Value, vmId.Value, displayName.Value, machineFqdn.Value, clientPublicKey.Value, osName.Value, osVersion.Value, osType.Value, vmUuid.Value, Optional.ToList(extensions), osSku.Value, domainName.Value, adFqdn.Value, dnsFqdn.Value, privateLinkScopeResourceId.Value, parentClusterResourceId.Value, mssqlDiscovered.Value, Optional.ToDictionary(detectedProperties)); } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs index 46a51754dbc18..a60065ce75c91 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Collections.Generic; using System.Text.Json; using Azure.Core; @@ -18,11 +19,6 @@ public partial class HybridComputeMachineExtensionData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteObjectValue(Properties); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -36,30 +32,97 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("location"); writer.WriteStringValue(Location); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"); + writer.WriteStringValue(ForceUpdateTag); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(TypePropertiesType); + } + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + writer.WritePropertyName("enableAutomaticUpgrade"); + writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); + } + if (Optional.IsDefined(AutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"); + writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(InstanceView)) + { + writer.WritePropertyName("instanceView"); + writer.WriteObjectValue(InstanceView); + } + writer.WriteEndObject(); writer.WriteEndObject(); } internal static HybridComputeMachineExtensionData DeserializeHybridComputeMachineExtensionData(JsonElement element) { - Optional properties = default; Optional> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; + Optional forceUpdateTag = default; + Optional publisher = default; + Optional type0 = default; + Optional typeHandlerVersion = default; + Optional enableAutomaticUpgrade = default; + Optional autoUpgradeMinorVersion = default; + Optional> settings = default; + Optional> protectedSettings = default; + Optional provisioningState = default; + Optional instanceView = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = MachineExtensionProperties.DeserializeMachineExtensionProperties(property.Value); - continue; - } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -105,8 +168,105 @@ internal static HybridComputeMachineExtensionData DeserializeHybridComputeMachin systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("forceUpdateTag")) + { + forceUpdateTag = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publisher")) + { + publisher = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type")) + { + type0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("typeHandlerVersion")) + { + typeHandlerVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("enableAutomaticUpgrade")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + enableAutomaticUpgrade = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("autoUpgradeMinorVersion")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + autoUpgradeMinorVersion = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("settings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); + } + settings = dictionary; + continue; + } + if (property0.NameEquals("protectedSettings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); + } + protectedSettings = dictionary; + continue; + } + if (property0.NameEquals("provisioningState")) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceView")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + instanceView = MachineExtensionInstanceView.DeserializeMachineExtensionInstanceView(property0.Value); + continue; + } + } + continue; + } } - return new HybridComputeMachineExtensionData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties.Value); + return new HybridComputeMachineExtensionData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, forceUpdateTag.Value, publisher.Value, type0.Value, typeHandlerVersion.Value, Optional.ToNullable(enableAutomaticUpgrade), Optional.ToNullable(autoUpgradeMinorVersion), Optional.ToDictionary(settings), Optional.ToDictionary(protectedSettings), provisioningState.Value, instanceView.Value); } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs index 919d10d125c43..4df09bed430b8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs @@ -15,11 +15,6 @@ public partial class HybridComputeMachineExtensionPatch : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteObjectValue(Properties); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -31,6 +26,69 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndObject(); } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"); + writer.WriteStringValue(ForceUpdateTag); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(MachineExtensionUpdatePropertiesType)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(MachineExtensionUpdatePropertiesType); + } + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + writer.WritePropertyName("enableAutomaticUpgrade"); + writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); + } + if (Optional.IsDefined(AutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"); + writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); writer.WriteEndObject(); } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs index f3d23d3fd4a2c..29bd8b782a002 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs @@ -5,6 +5,10 @@ #nullable disable +using System; +using System.Collections.Generic; +using Azure.Core; + namespace Azure.ResourceManager.HybridCompute.Models { /// Describes a Machine Extension Update. @@ -13,9 +17,83 @@ public partial class HybridComputeMachineExtensionPatch : HybridComputeResourceU /// Initializes a new instance of HybridComputeMachineExtensionPatch. public HybridComputeMachineExtensionPatch() { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); } - /// Describes Machine Extension Update Properties. - public MachineExtensionUpdateProperties Properties { get; set; } + /// How the extension handler should be forced to update even if the extension configuration has not changed. + public string ForceUpdateTag { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// Specifies the type of the extension; an example is "CustomScriptExtension". + public string MachineExtensionUpdatePropertiesType { get; set; } + /// Specifies the version of the script handler. + public string TypeHandlerVersion { get; set; } + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + public bool? EnableAutomaticUpgrade { get; set; } + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + public bool? AutoUpgradeMinorVersion { get; set; } + /// + /// Json formatted public settings for the extension. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary Settings { get; } + /// + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary ProtectedSettings { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs index 559a7673d5447..a54d5d43cebe4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs @@ -20,11 +20,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("identity"); JsonSerializer.Serialize(writer, Identity); } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"); - writer.WriteObjectValue(Properties); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -36,6 +31,34 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndObject(); } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(LocationData)) + { + writer.WritePropertyName("locationData"); + writer.WriteObjectValue(LocationData); + } + if (Optional.IsDefined(OSProfile)) + { + writer.WritePropertyName("osProfile"); + writer.WriteObjectValue(OSProfile); + } + if (Optional.IsDefined(CloudMetadata)) + { + writer.WritePropertyName("cloudMetadata"); + writer.WriteObjectValue(CloudMetadata); + } + if (Optional.IsDefined(ParentClusterResourceId)) + { + writer.WritePropertyName("parentClusterResourceId"); + writer.WriteStringValue(ParentClusterResourceId); + } + if (Optional.IsDefined(PrivateLinkScopeResourceId)) + { + writer.WritePropertyName("privateLinkScopeResourceId"); + writer.WriteStringValue(PrivateLinkScopeResourceId); + } + writer.WriteEndObject(); writer.WriteEndObject(); } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs index 8b1d767c7d6d1..0da4d52fb4095 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs @@ -19,7 +19,21 @@ public HybridComputeMachinePatch() /// Identity for the resource. Current supported identity types: SystemAssigned. public ManagedServiceIdentity Identity { get; set; } - /// Hybrid Compute Machine properties. - public MachineUpdateProperties Properties { get; set; } + /// Metadata pertaining to the geographic location of the resource. + public LocationData LocationData { get; set; } + /// Specifies the operating system settings for the hybrid machine. + public OSProfile OSProfile { get; set; } + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + internal CloudMetadata CloudMetadata { get; set; } + /// Specifies the cloud provider (Azure/AWS/GCP...). + public string CloudMetadataProvider + { + get => CloudMetadata is null ? default : CloudMetadata.Provider; + } + + /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + public string ParentClusterResourceId { get; set; } + /// The resource id of the private link scope this machine is assigned to, if any. + public string PrivateLinkScopeResourceId { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs deleted file mode 100644 index 8b3057f8a779a..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineExtensionProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ForceUpdateTag)) - { - writer.WritePropertyName("forceUpdateTag"); - writer.WriteStringValue(ForceUpdateTag); - } - if (Optional.IsDefined(Publisher)) - { - writer.WritePropertyName("publisher"); - writer.WriteStringValue(Publisher); - } - if (Optional.IsDefined(MachineExtensionPropertiesType)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(MachineExtensionPropertiesType); - } - if (Optional.IsDefined(TypeHandlerVersion)) - { - writer.WritePropertyName("typeHandlerVersion"); - writer.WriteStringValue(TypeHandlerVersion); - } - if (Optional.IsDefined(EnableAutomaticUpgrade)) - { - writer.WritePropertyName("enableAutomaticUpgrade"); - writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); - } - if (Optional.IsDefined(AutoUpgradeMinorVersion)) - { - writer.WritePropertyName("autoUpgradeMinorVersion"); - writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(ProtectedSettings)) - { - writer.WritePropertyName("protectedSettings"); - writer.WriteStartObject(); - foreach (var item in ProtectedSettings) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(InstanceView)) - { - writer.WritePropertyName("instanceView"); - writer.WriteObjectValue(InstanceView); - } - writer.WriteEndObject(); - } - - internal static MachineExtensionProperties DeserializeMachineExtensionProperties(JsonElement element) - { - Optional forceUpdateTag = default; - Optional publisher = default; - Optional type = default; - Optional typeHandlerVersion = default; - Optional enableAutomaticUpgrade = default; - Optional autoUpgradeMinorVersion = default; - Optional> settings = default; - Optional> protectedSettings = default; - Optional provisioningState = default; - Optional instanceView = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("forceUpdateTag")) - { - forceUpdateTag = property.Value.GetString(); - continue; - } - if (property.NameEquals("publisher")) - { - publisher = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("typeHandlerVersion")) - { - typeHandlerVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("enableAutomaticUpgrade")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enableAutomaticUpgrade = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("autoUpgradeMinorVersion")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - autoUpgradeMinorVersion = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("settings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); - } - settings = dictionary; - continue; - } - if (property.NameEquals("protectedSettings")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); - } - protectedSettings = dictionary; - continue; - } - if (property.NameEquals("provisioningState")) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("instanceView")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - instanceView = MachineExtensionInstanceView.DeserializeMachineExtensionInstanceView(property.Value); - continue; - } - } - return new MachineExtensionProperties(forceUpdateTag.Value, publisher.Value, type.Value, typeHandlerVersion.Value, Optional.ToNullable(enableAutomaticUpgrade), Optional.ToNullable(autoUpgradeMinorVersion), Optional.ToDictionary(settings), Optional.ToDictionary(protectedSettings), provisioningState.Value, instanceView.Value); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs deleted file mode 100644 index b45bc07128515..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs +++ /dev/null @@ -1,128 +0,0 @@ -// 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 the properties of a Machine Extension. - public partial class MachineExtensionProperties - { - /// Initializes a new instance of MachineExtensionProperties. - public MachineExtensionProperties() - { - Settings = new ChangeTrackingDictionary(); - ProtectedSettings = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of MachineExtensionProperties. - /// How the extension handler should be forced to update even if the extension configuration has not changed. - /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". - /// Specifies the version of the script handler. - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - /// Json formatted public settings for the extension. - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// The provisioning state, which only appears in the response. - /// The machine extension instance view. - internal MachineExtensionProperties(string forceUpdateTag, string publisher, string machineExtensionPropertiesType, string typeHandlerVersion, bool? enableAutomaticUpgrade, bool? autoUpgradeMinorVersion, IDictionary settings, IDictionary protectedSettings, string provisioningState, MachineExtensionInstanceView instanceView) - { - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - MachineExtensionPropertiesType = machineExtensionPropertiesType; - TypeHandlerVersion = typeHandlerVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - Settings = settings; - ProtectedSettings = protectedSettings; - ProvisioningState = provisioningState; - InstanceView = instanceView; - } - - /// How the extension handler should be forced to update even if the extension configuration has not changed. - public string ForceUpdateTag { get; set; } - /// The name of the extension handler publisher. - public string Publisher { get; set; } - /// Specifies the type of the extension; an example is "CustomScriptExtension". - public string MachineExtensionPropertiesType { get; set; } - /// Specifies the version of the script handler. - public string TypeHandlerVersion { get; set; } - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - public bool? EnableAutomaticUpgrade { get; set; } - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - public bool? AutoUpgradeMinorVersion { get; set; } - /// - /// Json formatted public settings for the extension. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary Settings { get; } - /// - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary ProtectedSettings { get; } - /// The provisioning state, which only appears in the response. - public string ProvisioningState { get; } - /// The machine extension instance view. - public MachineExtensionInstanceView InstanceView { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.Serialization.cs deleted file mode 100644 index b9c3c12334ad1..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.Serialization.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineExtensionUpdateProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ForceUpdateTag)) - { - writer.WritePropertyName("forceUpdateTag"); - writer.WriteStringValue(ForceUpdateTag); - } - if (Optional.IsDefined(Publisher)) - { - writer.WritePropertyName("publisher"); - writer.WriteStringValue(Publisher); - } - if (Optional.IsDefined(MachineExtensionUpdatePropertiesType)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(MachineExtensionUpdatePropertiesType); - } - if (Optional.IsDefined(TypeHandlerVersion)) - { - writer.WritePropertyName("typeHandlerVersion"); - writer.WriteStringValue(TypeHandlerVersion); - } - if (Optional.IsDefined(EnableAutomaticUpgrade)) - { - writer.WritePropertyName("enableAutomaticUpgrade"); - writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); - } - if (Optional.IsDefined(AutoUpgradeMinorVersion)) - { - writer.WritePropertyName("autoUpgradeMinorVersion"); - writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(ProtectedSettings)) - { - writer.WritePropertyName("protectedSettings"); - writer.WriteStartObject(); - foreach (var item in ProtectedSettings) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.cs deleted file mode 100644 index df329209a5053..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.cs +++ /dev/null @@ -1,99 +0,0 @@ -// 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 the properties of a Machine Extension. - public partial class MachineExtensionUpdateProperties - { - /// Initializes a new instance of MachineExtensionUpdateProperties. - public MachineExtensionUpdateProperties() - { - Settings = new ChangeTrackingDictionary(); - ProtectedSettings = new ChangeTrackingDictionary(); - } - - /// How the extension handler should be forced to update even if the extension configuration has not changed. - public string ForceUpdateTag { get; set; } - /// The name of the extension handler publisher. - public string Publisher { get; set; } - /// Specifies the type of the extension; an example is "CustomScriptExtension". - public string MachineExtensionUpdatePropertiesType { get; set; } - /// Specifies the version of the script handler. - public string TypeHandlerVersion { get; set; } - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - public bool? EnableAutomaticUpgrade { get; set; } - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - public bool? AutoUpgradeMinorVersion { get; set; } - /// - /// Json formatted public settings for the extension. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary Settings { get; } - /// - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary ProtectedSettings { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.Serialization.cs deleted file mode 100644 index b3cbdb0df7e03..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.Serialization.cs +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LocationData)) - { - writer.WritePropertyName("locationData"); - writer.WriteObjectValue(LocationData); - } - if (Optional.IsDefined(ServiceStatuses)) - { - writer.WritePropertyName("serviceStatuses"); - writer.WriteObjectValue(ServiceStatuses); - } - if (Optional.IsDefined(CloudMetadata)) - { - writer.WritePropertyName("cloudMetadata"); - writer.WriteObjectValue(CloudMetadata); - } - if (Optional.IsDefined(OSProfile)) - { - writer.WritePropertyName("osProfile"); - writer.WriteObjectValue(OSProfile); - } - if (Optional.IsDefined(VmId)) - { - writer.WritePropertyName("vmId"); - writer.WriteStringValue(VmId); - } - if (Optional.IsDefined(ClientPublicKey)) - { - writer.WritePropertyName("clientPublicKey"); - writer.WriteStringValue(ClientPublicKey); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"); - writer.WriteStringValue(OSType); - } - if (Optional.IsDefined(PrivateLinkScopeResourceId)) - { - writer.WritePropertyName("privateLinkScopeResourceId"); - writer.WriteStringValue(PrivateLinkScopeResourceId); - } - if (Optional.IsDefined(ParentClusterResourceId)) - { - writer.WritePropertyName("parentClusterResourceId"); - writer.WriteStringValue(ParentClusterResourceId); - } - if (Optional.IsDefined(MssqlDiscovered)) - { - writer.WritePropertyName("mssqlDiscovered"); - writer.WriteStringValue(MssqlDiscovered); - } - writer.WriteEndObject(); - } - - internal static MachineProperties DeserializeMachineProperties(JsonElement element) - { - Optional locationData = default; - Optional agentConfiguration = default; - Optional serviceStatuses = default; - Optional cloudMetadata = default; - Optional osProfile = default; - Optional provisioningState = default; - Optional status = default; - Optional lastStatusChange = default; - Optional> errorDetails = default; - Optional agentVersion = default; - Optional vmId = default; - Optional displayName = default; - Optional machineFqdn = default; - Optional clientPublicKey = default; - Optional osName = default; - Optional osVersion = default; - Optional osType = default; - Optional vmUuid = default; - Optional osSku = default; - Optional domainName = default; - Optional adFqdn = default; - Optional dnsFqdn = default; - Optional privateLinkScopeResourceId = default; - Optional parentClusterResourceId = default; - Optional mssqlDiscovered = default; - Optional> detectedProperties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("locationData")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - locationData = LocationData.DeserializeLocationData(property.Value); - continue; - } - if (property.NameEquals("agentConfiguration")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - agentConfiguration = AgentConfiguration.DeserializeAgentConfiguration(property.Value); - continue; - } - if (property.NameEquals("serviceStatuses")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - serviceStatuses = HybridComputeServiceStatuses.DeserializeHybridComputeServiceStatuses(property.Value); - continue; - } - if (property.NameEquals("cloudMetadata")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - cloudMetadata = CloudMetadata.DeserializeCloudMetadata(property.Value); - continue; - } - if (property.NameEquals("osProfile")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - osProfile = OSProfile.DeserializeOSProfile(property.Value); - continue; - } - if (property.NameEquals("provisioningState")) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new HybridComputeStatusType(property.Value.GetString()); - continue; - } - if (property.NameEquals("lastStatusChange")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - lastStatusChange = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("errorDetails")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - errorDetails = array; - continue; - } - if (property.NameEquals("agentVersion")) - { - agentVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("vmId")) - { - vmId = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName")) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("machineFqdn")) - { - machineFqdn = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientPublicKey")) - { - clientPublicKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("osName")) - { - osName = property.Value.GetString(); - continue; - } - if (property.NameEquals("osVersion")) - { - osVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("osType")) - { - osType = property.Value.GetString(); - continue; - } - if (property.NameEquals("vmUuid")) - { - vmUuid = property.Value.GetString(); - continue; - } - if (property.NameEquals("osSku")) - { - osSku = property.Value.GetString(); - continue; - } - if (property.NameEquals("domainName")) - { - domainName = property.Value.GetString(); - continue; - } - if (property.NameEquals("adFqdn")) - { - adFqdn = property.Value.GetString(); - continue; - } - if (property.NameEquals("dnsFqdn")) - { - dnsFqdn = property.Value.GetString(); - continue; - } - if (property.NameEquals("privateLinkScopeResourceId")) - { - privateLinkScopeResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("parentClusterResourceId")) - { - parentClusterResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("mssqlDiscovered")) - { - mssqlDiscovered = property.Value.GetString(); - continue; - } - if (property.NameEquals("detectedProperties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - detectedProperties = dictionary; - continue; - } - } - return new MachineProperties(locationData.Value, agentConfiguration.Value, serviceStatuses.Value, cloudMetadata.Value, osProfile.Value, provisioningState.Value, Optional.ToNullable(status), Optional.ToNullable(lastStatusChange), Optional.ToList(errorDetails), agentVersion.Value, vmId.Value, displayName.Value, machineFqdn.Value, clientPublicKey.Value, osName.Value, osVersion.Value, osType.Value, vmUuid.Value, osSku.Value, domainName.Value, adFqdn.Value, dnsFqdn.Value, privateLinkScopeResourceId.Value, parentClusterResourceId.Value, mssqlDiscovered.Value, Optional.ToDictionary(detectedProperties)); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.cs deleted file mode 100644 index 1bd7c653f1fb6..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the properties of a hybrid machine. - public partial class MachineProperties - { - /// Initializes a new instance of MachineProperties. - public MachineProperties() - { - ErrorDetails = new ChangeTrackingList(); - DetectedProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of MachineProperties. - /// 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...). - /// Specifies the operating system settings for the hybrid 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. - /// Specifies the Operating System product SKU. - /// 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. - internal MachineProperties(LocationData locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, CloudMetadata cloudMetadata, OSProfile osProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IReadOnlyList errorDetails, string agentVersion, string vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, string vmUuid, string osSku, string domainName, string adFqdn, string dnsFqdn, string privateLinkScopeResourceId, string parentClusterResourceId, string mssqlDiscovered, IReadOnlyDictionary detectedProperties) - { - LocationData = locationData; - AgentConfiguration = agentConfiguration; - ServiceStatuses = serviceStatuses; - CloudMetadata = cloudMetadata; - OSProfile = osProfile; - 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; - OSSku = osSku; - DomainName = domainName; - AdFqdn = adFqdn; - DnsFqdn = dnsFqdn; - PrivateLinkScopeResourceId = privateLinkScopeResourceId; - ParentClusterResourceId = parentClusterResourceId; - MssqlDiscovered = mssqlDiscovered; - DetectedProperties = detectedProperties; - } - - /// Metadata pertaining to the geographic location of the resource. - public LocationData LocationData { get; set; } - /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. - public AgentConfiguration AgentConfiguration { get; } - /// Statuses of dependent services that are reported back to ARM. - public HybridComputeServiceStatuses ServiceStatuses { get; set; } - /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - internal CloudMetadata CloudMetadata { get; set; } - /// Specifies the cloud provider (Azure/AWS/GCP...). - public string CloudMetadataProvider - { - get => CloudMetadata is null ? default : CloudMetadata.Provider; - } - - /// Specifies the operating system settings for the hybrid machine. - public OSProfile OSProfile { get; set; } - /// The provisioning state, which only appears in the response. - public string ProvisioningState { get; } - /// The status of the hybrid machine agent. - public HybridComputeStatusType? Status { get; } - /// The time of the last status change. - public DateTimeOffset? LastStatusChange { get; } - /// Details about the error state. - public IReadOnlyList ErrorDetails { get; } - /// The hybrid machine agent full version. - public string AgentVersion { get; } - /// Specifies the hybrid machine unique ID. - public string VmId { get; set; } - /// Specifies the hybrid machine display name. - public string DisplayName { get; } - /// Specifies the hybrid machine FQDN. - public string MachineFqdn { get; } - /// Public Key that the client provides to be used during initial resource onboarding. - public string ClientPublicKey { get; set; } - /// The Operating System running on the hybrid machine. - public string OSName { get; } - /// The version of Operating System running on the hybrid machine. - public string OSVersion { get; } - /// The type of Operating System (windows/linux). - public string OSType { get; set; } - /// Specifies the Arc Machine's unique SMBIOS ID. - public string VmUuid { get; } - /// Specifies the Operating System product SKU. - public string OSSku { get; } - /// Specifies the Windows domain name. - public string DomainName { get; } - /// Specifies the AD fully qualified display name. - public string AdFqdn { get; } - /// Specifies the DNS fully qualified display name. - public string DnsFqdn { get; } - /// The resource id of the private link scope this machine is assigned to, if any. - public string PrivateLinkScopeResourceId { get; set; } - /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. - public string ParentClusterResourceId { get; set; } - /// Specifies whether any MS SQL instance is discovered on the machine. - public string MssqlDiscovered { get; set; } - /// Detected properties from the machine. - public IReadOnlyDictionary DetectedProperties { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.Serialization.cs deleted file mode 100644 index 4ec3307e0603f..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineUpdateProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LocationData)) - { - writer.WritePropertyName("locationData"); - writer.WriteObjectValue(LocationData); - } - if (Optional.IsDefined(OSProfile)) - { - writer.WritePropertyName("osProfile"); - writer.WriteObjectValue(OSProfile); - } - if (Optional.IsDefined(CloudMetadata)) - { - writer.WritePropertyName("cloudMetadata"); - writer.WriteObjectValue(CloudMetadata); - } - if (Optional.IsDefined(ParentClusterResourceId)) - { - writer.WritePropertyName("parentClusterResourceId"); - writer.WriteStringValue(ParentClusterResourceId); - } - if (Optional.IsDefined(PrivateLinkScopeResourceId)) - { - writer.WritePropertyName("privateLinkScopeResourceId"); - writer.WriteStringValue(PrivateLinkScopeResourceId); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.cs deleted file mode 100644 index 8c38cd08e689a..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the ARM updatable properties of a hybrid machine. - public partial class MachineUpdateProperties - { - /// Initializes a new instance of MachineUpdateProperties. - public MachineUpdateProperties() - { - } - - /// Metadata pertaining to the geographic location of the resource. - public LocationData LocationData { get; set; } - /// Specifies the operating system settings for the hybrid machine. - public OSProfile OSProfile { get; set; } - /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - internal CloudMetadata CloudMetadata { get; set; } - /// Specifies the cloud provider (Azure/AWS/GCP...). - public string CloudMetadataProvider - { - get => CloudMetadata is null ? default : CloudMetadata.Provider; - } - - /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. - public string ParentClusterResourceId { get; set; } - /// The resource id of the private link scope this machine is assigned to, if any. - public string PrivateLinkScopeResourceId { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs new file mode 100644 index 0000000000000..6b10163dc8d41 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal partial class ExtensionMetadataRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExtensionMetadataRestOperations. + /// 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 ExtensionMetadataRestOperations(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 ?? "2022-11-10"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string publisher, string extensionType, string version) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisher, true); + uri.AppendPath("/extensionTypes/", false); + uri.AppendPath(extensionType, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets an Extension Metadata based on location, publisher, extensionType and version. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// 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, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var message = CreateGetRequest(subscriptionId, location, publisher, extensionType, version); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ExtensionValueData.DeserializeExtensionValueData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExtensionValueData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets an Extension Metadata based on location, publisher, extensionType and version. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// 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, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var message = CreateGetRequest(subscriptionId, location, publisher, extensionType, version); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ExtensionValueData.DeserializeExtensionValueData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExtensionValueData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location, string publisher, string extensionType) + { + 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/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisher, true); + uri.AppendPath("/extensionTypes/", false); + uri.AppendPath(extensionType, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Extension versions based on location, publisher, extensionType. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// 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, AzureLocation location, string publisher, string extensionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + + using var message = CreateListRequest(subscriptionId, location, publisher, extensionType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ExtensionValueListResult.DeserializeExtensionValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Extension versions based on location, publisher, extensionType. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// 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, AzureLocation location, string publisher, string extensionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + + using var message = CreateListRequest(subscriptionId, location, publisher, extensionType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ExtensionValueListResult.DeserializeExtensionValueListResult(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 7462041fe54d4..c9f7fb5cdfb17 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs @@ -32,7 +32,7 @@ public HybridComputeManagementRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-11-10"; _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 6039ca77bbdd5..4ca6369c43f72 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs @@ -33,7 +33,7 @@ public MachineExtensionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-11-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 6b770e4671e4a..e13c57f528f33 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs @@ -33,7 +33,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 ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-11-10"; _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 620220a5e0f07..99d7dc245fafc 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-11-10"; _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 7d89ee1507074..6d35160816dc9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-11-10"; _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 df032b2766f24..15bc7047a19a8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkScopesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-11-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 046cd05c71936..6f700bdafe0ba 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -9,7 +9,7 @@ csharp: true library-name: HybridCompute namespace: Azure.ResourceManager.HybridCompute # default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/7d5d1db0c45d6fe0934c97b6a6f9bb34112d42d1/specification/hybridcompute/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true