diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md b/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md index 16b5dd8c6c0d..6ec35c2d80a0 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md +++ b/sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md @@ -1,14 +1,11 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.1.0-beta.4 (2025-12-16) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Upgraded api-version 2025-03-01-preview. +- Make `Azure.ResourceManager.Nginx` AOT compatible. ## 1.1.0-beta.3 (2025-02-14) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net10.0.cs b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net10.0.cs new file mode 100644 index 000000000000..98c6cd76378e --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net10.0.cs @@ -0,0 +1,1147 @@ +namespace Azure.ResourceManager.Nginx +{ + public partial class AzureResourceManagerNginxContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerNginxContext() { } + public static Azure.ResourceManager.Nginx.AzureResourceManagerNginxContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class NginxCertificateCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NginxCertificateCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string certificateName, 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 certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string certificateName, 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 NginxCertificateData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxCertificateData() { } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxCertificateResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxCertificateResource() { } + public virtual Azure.ResourceManager.Nginx.NginxCertificateData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NginxConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string configurationName, 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 configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string configurationName, 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 NginxConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationData() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxConfigurationResource() { } + public virtual Azure.ResourceManager.Nginx.NginxConfigurationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response Analysis(Azure.ResourceManager.Nginx.Models.NginxAnalysisContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AnalysisAsync(Azure.ResourceManager.Nginx.Models.NginxAnalysisContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentApiKeyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NginxDeploymentApiKeyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string apiKeyName, 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 apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string apiKeyName, 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 NginxDeploymentApiKeyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentApiKeyData() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentApiKeyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxDeploymentApiKeyResource() { } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NginxDeploymentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string deploymentName, 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 deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentName, 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 NginxDeploymentData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties Properties { get { throw null; } set { } } + public string SkuName { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxDeploymentResource() { } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDefaultWafPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetNginxCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxCertificateCollection GetNginxCertificates() { throw null; } + public virtual Azure.Response GetNginxConfiguration(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxConfigurationAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxConfigurationCollection GetNginxConfigurations() { throw null; } + public virtual Azure.Response GetNginxDeploymentApiKey(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxDeploymentApiKeyAsync(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyCollection GetNginxDeploymentApiKeys() { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyCollection GetNginxDeploymentWafPolicies() { throw null; } + public virtual Azure.Response GetNginxDeploymentWafPolicy(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxDeploymentWafPolicyAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetWafPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentWafPolicyCollection : Azure.ResourceManager.ArmCollection + { + protected NginxDeploymentWafPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentWafPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentWafPolicyData() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxDeploymentWafPolicyResource() { } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class NginxExtensions + { + public static Azure.ResourceManager.Nginx.NginxCertificateResource GetNginxCertificateResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Nginx.NginxConfigurationResource GetNginxConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetNginxDeployment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static System.Threading.Tasks.Task> GetNginxDeploymentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentResource GetNginxDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentCollection GetNginxDeployments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetNginxDeployments(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetNginxDeploymentsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } +} +namespace Azure.ResourceManager.Nginx.Mocking +{ + public partial class MockableNginxArmClient : Azure.ResourceManager.ArmResource + { + protected MockableNginxArmClient() { } + public virtual Azure.ResourceManager.Nginx.NginxCertificateResource GetNginxCertificateResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxConfigurationResource GetNginxConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentResource GetNginxDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableNginxResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableNginxResourceGroupResource() { } + public virtual Azure.Response GetNginxDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentCollection GetNginxDeployments() { throw null; } + } + public partial class MockableNginxSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableNginxSubscriptionResource() { } + public virtual Azure.Pageable GetNginxDeployments(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetNginxDeploymentsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.Nginx.Models +{ + public static partial class ArmNginxModelFactory + { + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig NginxAnalysisConfig(string rootFile = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisContent NginxAnalysisContent(Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig config = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic NginxAnalysisDiagnostic(string id = null, string directive = null, string description = null, string file = null, float line = 0f, string message = null, string rule = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisResult NginxAnalysisResult(string status = null, Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails data = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails NginxAnalysisResultDetails(System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxCertificateData NginxCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxCertificateProperties properties = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxCertificateProperties NginxCertificateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxCertificateProperties NginxCertificateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), string keyVirtualPath = null, string certificateVirtualPath = null, string keyVaultSecretId = null, string sha1Thumbprint = null, string keyVaultSecretVersion = null, System.DateTimeOffset? keyVaultSecretCreated = default(System.DateTimeOffset?), Azure.ResourceManager.Nginx.Models.NginxCertificateError certificateError = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(string id = null, string name = null, string resourceType = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxConfigurationData NginxConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxConfigurationData NginxConfigurationData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties properties, Azure.Core.AzureLocation? location) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage NginxConfigurationPackage(string data = null, System.Collections.Generic.IEnumerable protectedFiles = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties NginxConfigurationProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(string id = null, string name = null, string resourceType = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData NginxDeploymentApiKeyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(string hint = null, System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult NginxDeploymentDefaultWafPolicyListResult(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(System.BinaryData content = null, string filepath = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch NginxDeploymentPatch(Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, string skuName = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties NginxDeploymentProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), string nginxVersion = null, Azure.ResourceManager.Nginx.Models.NginxNetworkProfile networkProfile = null, string ipAddress = null, bool? enableDiagnosticsSupport = default(bool?), Azure.ResourceManager.Nginx.Models.NginxStorageAccount loggingStorageAccount = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties scalingProperties = null, string upgradeChannel = null, string userPreferredEmail = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect nginxAppProtect = null, string dataplaneApiEndpoint = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties NginxDeploymentProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState, string nginxVersion, string managedResourceGroup, Azure.ResourceManager.Nginx.Models.NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, Azure.ResourceManager.Nginx.Models.NginxStorageAccount loggingStorageAccount, int? scalingCapacity, string userPreferredEmail = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect NginxDeploymentPropertiesNginxAppProtect(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? webApplicationFirewallActivationState = default(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState?), Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus webApplicationFirewallStatus = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus NginxDeploymentWafPolicyApplyingStatus(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? code = default(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode?), string displayStatus = null, string time = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus NginxDeploymentWafPolicyCompilingStatus(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? code = default(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode?), string displayStatus = null, string time = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData NginxDeploymentWafPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata NginxDeploymentWafPolicyMetadata(string id = null, string name = null, string type = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties NginxDeploymentWafPolicyMetadataProperties(string filepath = null, Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus compilingState = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus applyingState = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.BinaryData content = null, string filepath = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus compilingState = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus applyingState = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem NginxDiagnosticItem(string id = null, string directive = null, string description = null, string file = null, float line = 0f, string message = null, string rule = null, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel level = default(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel), string category = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration NginxFrontendIPConfiguration(System.Collections.Generic.IEnumerable publicIPAddresses = null, System.Collections.Generic.IEnumerable privateIPAddresses = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions WebApplicationFirewallComponentVersions(string wafEngineVersion = null, string wafNginxVersion = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage WebApplicationFirewallPackage(string version = null, System.DateTimeOffset revisionDatetime = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus(string wafRelease = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage attackSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage botSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage threatCampaignsPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions componentVersions = null) { throw null; } + } + public partial class NginxAnalysisConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxAnalysisConfig() { } + public System.Collections.Generic.IList Files { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxAnalysisContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxAnalysisContent(Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig config) { } + public Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig Config { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxAnalysisContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxAnalysisContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxAnalysisDiagnostic : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxAnalysisDiagnostic() { } + public string Description { get { throw null; } } + public string Directive { get { throw null; } } + public string File { get { throw null; } } + public string Id { get { throw null; } } + public float Line { get { throw null; } } + public string Message { get { throw null; } } + public string Rule { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxAnalysisResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxAnalysisResult() { } + public Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails Data { get { throw null; } } + public string Status { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxAnalysisResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxAnalysisResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxAnalysisResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxAnalysisResultDetails() { } + public System.Collections.Generic.IList Diagnostics { get { throw null; } } + public System.Collections.Generic.IList Errors { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxCertificateError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxCertificateError() { } + public string Code { get { throw null; } set { } } + public string Message { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateError JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateError PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxCertificateError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxCertificateError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxCertificateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxCertificateProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxCertificateError CertificateError { get { throw null; } set { } } + public string CertificateVirtualPath { get { throw null; } set { } } + public System.DateTimeOffset? KeyVaultSecretCreated { get { throw null; } } + public string KeyVaultSecretId { get { throw null; } set { } } + public string KeyVaultSecretVersion { get { throw null; } } + public string KeyVirtualPath { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + public string Sha1Thumbprint { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxCertificateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxCertificateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationContentProtectedFile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationContentProtectedFile() { } + public string Content { get { throw null; } set { } } + public string ContentHash { get { throw null; } set { } } + public string VirtualPath { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationCreateOrUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationCreateOrUpdateContent() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties Properties { get { throw null; } set { } } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationCreateOrUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationCreateOrUpdateProperties() { } + public System.Collections.Generic.IList Files { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationFile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationFile() { } + public string Content { get { throw null; } set { } } + public string ContentHash { get { throw null; } set { } } + public string VirtualPath { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationFile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationFile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationPackage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationPackage() { } + public string Data { get { throw null; } set { } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationProperties() { } + public System.Collections.Generic.IList Files { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentApiKeyCreateOrUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentApiKeyCreateOrUpdateContent() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties Properties { get { throw null; } set { } } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentApiKeyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentApiKeyProperties() { } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Hint { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentApiKeyRequestProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentApiKeyRequestProperties() { } + public System.DateTimeOffset? EndOn { get { throw null; } set { } } + public string SecretText { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentDefaultWafPolicyListResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IList Value { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentDefaultWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyProperties() { } + public System.BinaryData Content { get { throw null; } } + public string Filepath { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties Properties { get { throw null; } set { } } + public string SkuName { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentProperties() { } + public string DataplaneApiEndpoint { get { throw null; } } + public bool? EnableDiagnosticsSupport { get { throw null; } set { } } + public string IPAddress { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxStorageAccount LoggingStorageAccount { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string ManagedResourceGroup { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxNetworkProfile NetworkProfile { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect NginxAppProtect { get { throw null; } set { } } + public string NginxVersion { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public int? ScalingCapacity { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties ScalingProperties { get { throw null; } set { } } + public string UpgradeChannel { get { throw null; } set { } } + public string UserPreferredEmail { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentPropertiesNginxAppProtect : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentPropertiesNginxAppProtect(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings webApplicationFirewallSettings) { } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentScalingProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentScalingProperties() { } + public int? Capacity { get { throw null; } set { } } + public System.Collections.Generic.IList Profiles { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentUpdateProperties() { } + public bool? EnableDiagnosticsSupport { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxStorageAccount LoggingStorageAccount { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxNetworkProfile NetworkProfile { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public int? ScalingCapacity { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties ScalingProperties { get { throw null; } set { } } + public string UpgradeChannel { get { throw null; } set { } } + public string UserPreferredEmail { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyApplyingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyApplyingStatus() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public string Time { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDeploymentWafPolicyApplyingStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDeploymentWafPolicyApplyingStatusCode(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Applying { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode NotApplied { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Removing { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxDeploymentWafPolicyCompilingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyCompilingStatus() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public string Time { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDeploymentWafPolicyCompilingStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDeploymentWafPolicyCompilingStatusCode(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode InProgress { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode NotStarted { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxDeploymentWafPolicyMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadata() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties Properties { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyMetadataProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadataProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } + public string Filepath { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentWafPolicyProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } + public System.BinaryData Content { get { throw null; } set { } } + public string Filepath { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDiagnosticItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDiagnosticItem() { } + public string Category { get { throw null; } } + public string Description { get { throw null; } } + public string Directive { get { throw null; } } + public string File { get { throw null; } } + public string Id { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel Level { get { throw null; } } + public float Line { get { throw null; } } + public string Message { get { throw null; } } + public string Rule { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDiagnosticLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDiagnosticLevel(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel Info { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel left, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel left, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxFrontendIPConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxFrontendIPConfiguration() { } + public System.Collections.Generic.IList PrivateIPAddresses { get { throw null; } } + public System.Collections.Generic.IList PublicIPAddresses { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxNetworkProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxNetworkProfile() { } + public Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration FrontEndIPConfiguration { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier NetworkInterfaceSubnetId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxNetworkProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxNetworkProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxNetworkProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxPrivateIPAddress : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxPrivateIPAddress() { } + public System.Net.IPAddress PrivateIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod? PrivateIPAllocationMethod { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxPrivateIPAllocationMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxPrivateIPAllocationMethod(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod Dynamic { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod Static { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod left, Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod left, Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState NotSpecified { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxProvisioningState left, Azure.ResourceManager.Nginx.Models.NginxProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxProvisioningState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxProvisioningState left, Azure.ResourceManager.Nginx.Models.NginxProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxScaleProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxScaleProfile(string name, Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity capacity) { } + public Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity Capacity { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxScaleProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxScaleProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxScaleProfileCapacity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxScaleProfileCapacity(int min, int max) { } + public int Max { get { throw null; } set { } } + public int Min { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxStorageAccount : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxStorageAccount() { } + public string AccountName { get { throw null; } set { } } + public string ContainerName { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxStorageAccount JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxStorageAccount PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxStorageAccount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxStorageAccount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebApplicationFirewallActivationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebApplicationFirewallActivationState(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState Disabled { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState left, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState left, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WebApplicationFirewallComponentVersions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebApplicationFirewallComponentVersions() { } + public string WafEngineVersion { get { throw null; } } + public string WafNginxVersion { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebApplicationFirewallPackage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebApplicationFirewallPackage() { } + public System.DateTimeOffset RevisionDatetime { get { throw null; } } + public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebApplicationFirewallSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WebApplicationFirewallSettings() { } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? ActivationState { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebApplicationFirewallStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebApplicationFirewallStatus() { } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage AttackSignaturesPackage { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage BotSignaturesPackage { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions ComponentVersions { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage ThreatCampaignsPackage { get { throw null; } } + public string WafRelease { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net8.0.cs b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net8.0.cs index bec5caf9c1a9..98c6cd76378e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net8.0.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net8.0.cs @@ -9,8 +9,8 @@ internal AzureResourceManagerNginxContext() { } public partial class NginxCertificateCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxCertificateCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -28,7 +28,10 @@ public partial class NginxCertificateData : Azure.ResourceManager.Models.Resourc public NginxCertificateData() { } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -51,14 +54,16 @@ protected NginxCertificateResource() { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NginxConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxConfigurationCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -73,9 +78,14 @@ protected NginxConfigurationCollection() { } } public partial class NginxConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal NginxConfigurationData() { } - public Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties Properties { get { throw null; } } + public NginxConfigurationData() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -100,14 +110,16 @@ protected NginxConfigurationResource() { } Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NginxDeploymentApiKeyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxDeploymentApiKeyCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -124,7 +136,10 @@ public partial class NginxDeploymentApiKeyData : Azure.ResourceManager.Models.Re { internal NginxDeploymentApiKeyData() { } public Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -147,14 +162,14 @@ protected NginxDeploymentApiKeyResource() { } Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NginxDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxDeploymentCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -173,7 +188,10 @@ public NginxDeploymentData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties Properties { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -193,6 +211,8 @@ protected NginxDeploymentResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDefaultWafPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetNginxCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNginxCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxCertificateCollection GetNginxCertificates() { throw null; } @@ -202,6 +222,11 @@ protected NginxDeploymentResource() { } public virtual Azure.Response GetNginxDeploymentApiKey(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNginxDeploymentApiKeyAsync(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyCollection GetNginxDeploymentApiKeys() { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyCollection GetNginxDeploymentWafPolicies() { throw null; } + public virtual Azure.Response GetNginxDeploymentWafPolicy(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxDeploymentWafPolicyAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetWafPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -211,8 +236,53 @@ protected NginxDeploymentResource() { } Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentWafPolicyCollection : Azure.ResourceManager.ArmCollection + { + protected NginxDeploymentWafPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentWafPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentWafPolicyData() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxDeploymentWafPolicyResource() { } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public static partial class NginxExtensions { @@ -225,6 +295,7 @@ public static partial class NginxExtensions public static Azure.ResourceManager.Nginx.NginxDeploymentCollection GetNginxDeployments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetNginxDeployments(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNginxDeploymentsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } } namespace Azure.ResourceManager.Nginx.Mocking @@ -236,6 +307,7 @@ protected MockableNginxArmClient() { } public virtual Azure.ResourceManager.Nginx.NginxConfigurationResource GetNginxConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxDeploymentResource GetNginxDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableNginxResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -255,35 +327,54 @@ namespace Azure.ResourceManager.Nginx.Models { public static partial class ArmNginxModelFactory { + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig NginxAnalysisConfig(string rootFile = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisContent NginxAnalysisContent(Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig config = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic NginxAnalysisDiagnostic(string id = null, string directive = null, string description = null, string file = null, float line = 0f, string message = null, string rule = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxAnalysisResult NginxAnalysisResult(string status = null, Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails data = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails NginxAnalysisResultDetails(System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } public static Azure.ResourceManager.Nginx.NginxCertificateData NginxCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxCertificateProperties properties = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxCertificateProperties NginxCertificateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxCertificateProperties NginxCertificateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), string keyVirtualPath = null, string certificateVirtualPath = null, string keyVaultSecretId = null, string sha1Thumbprint = null, string keyVaultSecretVersion = null, System.DateTimeOffset? keyVaultSecretCreated = default(System.DateTimeOffset?), Azure.ResourceManager.Nginx.Models.NginxCertificateError certificateError = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties properties = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(string id = null, string name = null, string resourceType = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } public static Azure.ResourceManager.Nginx.NginxConfigurationData NginxConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties properties = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties NginxConfigurationProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileResult NginxConfigurationProtectedFileResult(string virtualPath = null, string contentHash = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxConfigurationData NginxConfigurationData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties properties, Azure.Core.AzureLocation? location) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage NginxConfigurationPackage(string data = null, System.Collections.Generic.IEnumerable protectedFiles = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties NginxConfigurationProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(string id = null, string name = null, string resourceType = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } public static Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData NginxDeploymentApiKeyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties properties = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(string hint = null, System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult NginxDeploymentDefaultWafPolicyListResult(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(System.BinaryData content = null, string filepath = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch NginxDeploymentPatch(Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, string skuName = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties properties = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties NginxDeploymentProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), string nginxVersion = null, Azure.ResourceManager.Nginx.Models.NginxNetworkProfile networkProfile = null, string ipAddress = null, bool? enableDiagnosticsSupport = default(bool?), Azure.ResourceManager.Nginx.Models.NginxStorageAccount loggingStorageAccount = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties scalingProperties = null, string upgradeChannel = null, string userPreferredEmail = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect nginxAppProtect = null, string dataplaneApiEndpoint = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties NginxDeploymentProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState, string nginxVersion, string managedResourceGroup, Azure.ResourceManager.Nginx.Models.NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, Azure.ResourceManager.Nginx.Models.NginxStorageAccount loggingStorageAccount, int? scalingCapacity, string userPreferredEmail = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect NginxDeploymentPropertiesNginxAppProtect(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? webApplicationFirewallActivationState = default(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState?), Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus webApplicationFirewallStatus = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus NginxDeploymentWafPolicyApplyingStatus(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? code = default(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode?), string displayStatus = null, string time = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus NginxDeploymentWafPolicyCompilingStatus(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? code = default(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode?), string displayStatus = null, string time = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData NginxDeploymentWafPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata NginxDeploymentWafPolicyMetadata(string id = null, string name = null, string type = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties NginxDeploymentWafPolicyMetadataProperties(string filepath = null, Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus compilingState = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus applyingState = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.BinaryData content = null, string filepath = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus compilingState = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus applyingState = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem NginxDiagnosticItem(string id = null, string directive = null, string description = null, string file = null, float line = 0f, string message = null, string rule = null, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel level = default(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel), string category = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration NginxFrontendIPConfiguration(System.Collections.Generic.IEnumerable publicIPAddresses = null, System.Collections.Generic.IEnumerable privateIPAddresses = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions WebApplicationFirewallComponentVersions(string wafEngineVersion = null, string wafNginxVersion = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage WebApplicationFirewallPackage(string version = null, System.DateTimeOffset revisionDatetime = default(System.DateTimeOffset)) { throw null; } - public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage attackSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage botSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage threatCampaignsPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions componentVersions = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus(string wafRelease = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage attackSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage botSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage threatCampaignsPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions componentVersions = null) { throw null; } } public partial class NginxAnalysisConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxAnalysisConfig() { } public System.Collections.Generic.IList Files { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } - public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -294,7 +385,10 @@ public partial class NginxAnalysisContent : System.ClientModel.Primitives.IJsonM { public NginxAnalysisContent(Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig config) { } public Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig Config { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -311,7 +405,10 @@ internal NginxAnalysisDiagnostic() { } public float Line { get { throw null; } } public string Message { get { throw null; } } public string Rule { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -323,7 +420,10 @@ public partial class NginxAnalysisResult : System.ClientModel.Primitives.IJsonMo internal NginxAnalysisResult() { } public Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails Data { get { throw null; } } public string Status { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -333,9 +433,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class NginxAnalysisResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NginxAnalysisResultDetails() { } - public System.Collections.Generic.IReadOnlyList Diagnostics { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IList Diagnostics { get { throw null; } } + public System.Collections.Generic.IList Errors { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -347,7 +450,10 @@ public partial class NginxCertificateError : System.ClientModel.Primitives.IJson public NginxCertificateError() { } public string Code { get { throw null; } set { } } public string Message { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateError JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateError PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxCertificateError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxCertificateError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -365,18 +471,44 @@ public NginxCertificateProperties() { } public string KeyVirtualPath { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } public string Sha1Thumbprint { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxCertificateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxCertificateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class NginxConfigurationCreateOrUpdateContent : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class NginxConfigurationContentProtectedFile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationContentProtectedFile() { } + public string Content { get { throw null; } set { } } + public string ContentHash { get { throw null; } set { } } + public string VirtualPath { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationCreateOrUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxConfigurationCreateOrUpdateContent() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -388,10 +520,13 @@ public partial class NginxConfigurationCreateOrUpdateProperties : System.ClientM public NginxConfigurationCreateOrUpdateProperties() { } public System.Collections.Generic.IList Files { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } - public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -402,8 +537,12 @@ public partial class NginxConfigurationFile : System.ClientModel.Primitives.IJso { public NginxConfigurationFile() { } public string Content { get { throw null; } set { } } + public string ContentHash { get { throw null; } set { } } public string VirtualPath { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationFile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationFile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -415,7 +554,10 @@ public partial class NginxConfigurationPackage : System.ClientModel.Primitives.I public NginxConfigurationPackage() { } public string Data { get { throw null; } set { } } public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -424,49 +566,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class NginxConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal NginxConfigurationProperties() { } - public System.Collections.Generic.IReadOnlyList Files { get { throw null; } } - public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ProtectedFiles { get { throw null; } } + public NginxConfigurationProperties() { } + public System.Collections.Generic.IList Files { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } - public string RootFile { get { throw null; } } + public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class NginxConfigurationProtectedFileContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public NginxConfigurationProtectedFileContent() { } - public string Content { get { throw null; } set { } } - public string ContentHash { get { throw null; } set { } } - public string VirtualPath { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class NginxConfigurationProtectedFileResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal NginxConfigurationProtectedFileResult() { } - public string ContentHash { get { throw null; } } - public string VirtualPath { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class NginxDeploymentApiKeyCreateOrUpdateContent : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class NginxDeploymentApiKeyCreateOrUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxDeploymentApiKeyCreateOrUpdateContent() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -478,7 +605,10 @@ public partial class NginxDeploymentApiKeyProperties : System.ClientModel.Primit internal NginxDeploymentApiKeyProperties() { } public System.DateTimeOffset? EndOn { get { throw null; } } public string Hint { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -490,13 +620,46 @@ public partial class NginxDeploymentApiKeyRequestProperties : System.ClientModel public NginxDeploymentApiKeyRequestProperties() { } public System.DateTimeOffset? EndOn { get { throw null; } set { } } public string SecretText { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NginxDeploymentDefaultWafPolicyListResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IList Value { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentDefaultWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyProperties() { } + public System.BinaryData Content { get { throw null; } } + public string Filepath { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NginxDeploymentPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxDeploymentPatch() { } @@ -505,7 +668,10 @@ public NginxDeploymentPatch() { } public Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties Properties { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -519,14 +685,21 @@ public NginxDeploymentProperties() { } public bool? EnableDiagnosticsSupport { get { throw null; } set { } } public string IPAddress { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxStorageAccount LoggingStorageAccount { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string ManagedResourceGroup { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxNetworkProfile NetworkProfile { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect NginxAppProtect { get { throw null; } set { } } public string NginxVersion { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public int? ScalingCapacity { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties ScalingProperties { get { throw null; } set { } } public string UpgradeChannel { get { throw null; } set { } } public string UserPreferredEmail { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -538,7 +711,10 @@ public partial class NginxDeploymentPropertiesNginxAppProtect : System.ClientMod public NginxDeploymentPropertiesNginxAppProtect(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings webApplicationFirewallSettings) { } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -550,7 +726,10 @@ public partial class NginxDeploymentScalingProperties : System.ClientModel.Primi public NginxDeploymentScalingProperties() { } public int? Capacity { get { throw null; } set { } } public System.Collections.Generic.IList Profiles { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -563,17 +742,150 @@ public NginxDeploymentUpdateProperties() { } public bool? EnableDiagnosticsSupport { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxStorageAccount LoggingStorageAccount { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxNetworkProfile NetworkProfile { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public int? ScalingCapacity { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties ScalingProperties { get { throw null; } set { } } public string UpgradeChannel { get { throw null; } set { } } public string UserPreferredEmail { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NginxDeploymentWafPolicyApplyingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyApplyingStatus() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public string Time { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDeploymentWafPolicyApplyingStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDeploymentWafPolicyApplyingStatusCode(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Applying { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode NotApplied { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Removing { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxDeploymentWafPolicyCompilingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyCompilingStatus() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public string Time { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDeploymentWafPolicyCompilingStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDeploymentWafPolicyCompilingStatusCode(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode InProgress { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode NotStarted { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxDeploymentWafPolicyMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadata() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties Properties { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyMetadataProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadataProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } + public string Filepath { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentWafPolicyProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } + public System.BinaryData Content { get { throw null; } set { } } + public string Filepath { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NginxDiagnosticItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NginxDiagnosticItem() { } @@ -586,7 +898,10 @@ internal NginxDiagnosticItem() { } public float Line { get { throw null; } } public string Message { get { throw null; } } public string Rule { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -608,6 +923,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel left, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel left, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel right) { throw null; } public override string ToString() { throw null; } } @@ -616,7 +932,10 @@ public partial class NginxFrontendIPConfiguration : System.ClientModel.Primitive public NginxFrontendIPConfiguration() { } public System.Collections.Generic.IList PrivateIPAddresses { get { throw null; } } public System.Collections.Generic.IList PublicIPAddresses { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -628,7 +947,10 @@ public partial class NginxNetworkProfile : System.ClientModel.Primitives.IJsonMo public NginxNetworkProfile() { } public Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration FrontEndIPConfiguration { get { throw null; } set { } } public Azure.Core.ResourceIdentifier NetworkInterfaceSubnetId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxNetworkProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxNetworkProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxNetworkProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -641,7 +963,10 @@ public NginxPrivateIPAddress() { } public System.Net.IPAddress PrivateIPAddress { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod? PrivateIPAllocationMethod { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -663,6 +988,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod left, Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod left, Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod right) { throw null; } public override string ToString() { throw null; } } @@ -688,6 +1014,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxProvisioningState left, Azure.ResourceManager.Nginx.Models.NginxProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.NginxProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxProvisioningState left, Azure.ResourceManager.Nginx.Models.NginxProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -696,7 +1023,10 @@ public partial class NginxScaleProfile : System.ClientModel.Primitives.IJsonMode public NginxScaleProfile(string name, Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity capacity) { } public Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity Capacity { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxScaleProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxScaleProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -708,7 +1038,10 @@ public partial class NginxScaleProfileCapacity : System.ClientModel.Primitives.I public NginxScaleProfileCapacity(int min, int max) { } public int Max { get { throw null; } set { } } public int Min { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -720,7 +1053,10 @@ public partial class NginxStorageAccount : System.ClientModel.Primitives.IJsonMo public NginxStorageAccount() { } public string AccountName { get { throw null; } set { } } public string ContainerName { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxStorageAccount JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxStorageAccount PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxStorageAccount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxStorageAccount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -742,6 +1078,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState left, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState left, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState right) { throw null; } public override string ToString() { throw null; } } @@ -750,7 +1087,10 @@ public partial class WebApplicationFirewallComponentVersions : System.ClientMode internal WebApplicationFirewallComponentVersions() { } public string WafEngineVersion { get { throw null; } } public string WafNginxVersion { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -762,7 +1102,10 @@ public partial class WebApplicationFirewallPackage : System.ClientModel.Primitiv internal WebApplicationFirewallPackage() { } public System.DateTimeOffset RevisionDatetime { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -773,7 +1116,10 @@ public partial class WebApplicationFirewallSettings : System.ClientModel.Primiti { public WebApplicationFirewallSettings() { } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? ActivationState { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -787,7 +1133,11 @@ internal WebApplicationFirewallStatus() { } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage BotSignaturesPackage { get { throw null; } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions ComponentVersions { get { throw null; } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage ThreatCampaignsPackage { get { throw null; } } + public string WafRelease { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.netstandard2.0.cs b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.netstandard2.0.cs index bec5caf9c1a9..98c6cd76378e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.netstandard2.0.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.netstandard2.0.cs @@ -9,8 +9,8 @@ internal AzureResourceManagerNginxContext() { } public partial class NginxCertificateCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxCertificateCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string certificateName, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -28,7 +28,10 @@ public partial class NginxCertificateData : Azure.ResourceManager.Models.Resourc public NginxCertificateData() { } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -51,14 +54,16 @@ protected NginxCertificateResource() { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxCertificateData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NginxConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxConfigurationCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configurationName, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string configurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -73,9 +78,14 @@ protected NginxConfigurationCollection() { } } public partial class NginxConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal NginxConfigurationData() { } - public Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties Properties { get { throw null; } } + public NginxConfigurationData() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -100,14 +110,16 @@ protected NginxConfigurationResource() { } Azure.ResourceManager.Nginx.NginxConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NginxDeploymentApiKeyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxDeploymentApiKeyCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string apiKeyName, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -124,7 +136,10 @@ public partial class NginxDeploymentApiKeyData : Azure.ResourceManager.Models.Re { internal NginxDeploymentApiKeyData() { } public Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -147,14 +162,14 @@ protected NginxDeploymentApiKeyResource() { } Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NginxDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NginxDeploymentCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.Nginx.NginxDeploymentData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -173,7 +188,10 @@ public NginxDeploymentData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties Properties { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -193,6 +211,8 @@ protected NginxDeploymentResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDefaultWafPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetNginxCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNginxCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxCertificateCollection GetNginxCertificates() { throw null; } @@ -202,6 +222,11 @@ protected NginxDeploymentResource() { } public virtual Azure.Response GetNginxDeploymentApiKey(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNginxDeploymentApiKeyAsync(string apiKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyCollection GetNginxDeploymentApiKeys() { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyCollection GetNginxDeploymentWafPolicies() { throw null; } + public virtual Azure.Response GetNginxDeploymentWafPolicy(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNginxDeploymentWafPolicyAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetWafPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -211,8 +236,53 @@ protected NginxDeploymentResource() { } Azure.ResourceManager.Nginx.NginxDeploymentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch patch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentWafPolicyCollection : Azure.ResourceManager.ArmCollection + { + protected NginxDeploymentWafPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string wafPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NginxDeploymentWafPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentWafPolicyData() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NginxDeploymentWafPolicyResource() { } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public static partial class NginxExtensions { @@ -225,6 +295,7 @@ public static partial class NginxExtensions public static Azure.ResourceManager.Nginx.NginxDeploymentCollection GetNginxDeployments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetNginxDeployments(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNginxDeploymentsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } } namespace Azure.ResourceManager.Nginx.Mocking @@ -236,6 +307,7 @@ protected MockableNginxArmClient() { } public virtual Azure.ResourceManager.Nginx.NginxConfigurationResource GetNginxConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Nginx.NginxDeploymentResource GetNginxDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableNginxResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -255,35 +327,54 @@ namespace Azure.ResourceManager.Nginx.Models { public static partial class ArmNginxModelFactory { + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig NginxAnalysisConfig(string rootFile = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxAnalysisContent NginxAnalysisContent(Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig config = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic NginxAnalysisDiagnostic(string id = null, string directive = null, string description = null, string file = null, float line = 0f, string message = null, string rule = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxAnalysisResult NginxAnalysisResult(string status = null, Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails data = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails NginxAnalysisResultDetails(System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IEnumerable diagnostics = null) { throw null; } public static Azure.ResourceManager.Nginx.NginxCertificateData NginxCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxCertificateProperties properties = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxCertificateProperties NginxCertificateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxCertificateProperties NginxCertificateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), string keyVirtualPath = null, string certificateVirtualPath = null, string keyVaultSecretId = null, string sha1Thumbprint = null, string keyVaultSecretVersion = null, System.DateTimeOffset? keyVaultSecretCreated = default(System.DateTimeOffset?), Azure.ResourceManager.Nginx.Models.NginxCertificateError certificateError = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties properties = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(string id = null, string name = null, string resourceType = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } public static Azure.ResourceManager.Nginx.NginxConfigurationData NginxConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties properties = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties NginxConfigurationProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileResult NginxConfigurationProtectedFileResult(string virtualPath = null, string contentHash = null) { throw null; } - public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxConfigurationData NginxConfigurationData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties properties, Azure.Core.AzureLocation? location) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage NginxConfigurationPackage(string data = null, System.Collections.Generic.IEnumerable protectedFiles = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties NginxConfigurationProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable protectedFiles = null, Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage package = null, string rootFile = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(string id = null, string name = null, string resourceType = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } public static Azure.ResourceManager.Nginx.NginxDeploymentApiKeyData NginxDeploymentApiKeyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties properties = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(string hint = null, System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentData NginxDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string skuName = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult NginxDeploymentDefaultWafPolicyListResult(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(System.BinaryData content = null, string filepath = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch NginxDeploymentPatch(Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IDictionary tags = null, string skuName = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties properties = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties NginxDeploymentProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), string nginxVersion = null, Azure.ResourceManager.Nginx.Models.NginxNetworkProfile networkProfile = null, string ipAddress = null, bool? enableDiagnosticsSupport = default(bool?), Azure.ResourceManager.Nginx.Models.NginxStorageAccount loggingStorageAccount = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties scalingProperties = null, string upgradeChannel = null, string userPreferredEmail = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect nginxAppProtect = null, string dataplaneApiEndpoint = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties NginxDeploymentProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState, string nginxVersion, string managedResourceGroup, Azure.ResourceManager.Nginx.Models.NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, Azure.ResourceManager.Nginx.Models.NginxStorageAccount loggingStorageAccount, int? scalingCapacity, string userPreferredEmail = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect NginxDeploymentPropertiesNginxAppProtect(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? webApplicationFirewallActivationState = default(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState?), Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus webApplicationFirewallStatus = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus NginxDeploymentWafPolicyApplyingStatus(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? code = default(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode?), string displayStatus = null, string time = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus NginxDeploymentWafPolicyCompilingStatus(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? code = default(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode?), string displayStatus = null, string time = null) { throw null; } + public static Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData NginxDeploymentWafPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata NginxDeploymentWafPolicyMetadata(string id = null, string name = null, string type = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties properties = null, Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties NginxDeploymentWafPolicyMetadataProperties(string filepath = null, Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus compilingState = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus applyingState = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyProperties(Azure.ResourceManager.Nginx.Models.NginxProvisioningState? provisioningState = default(Azure.ResourceManager.Nginx.Models.NginxProvisioningState?), System.BinaryData content = null, string filepath = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus compilingState = null, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus applyingState = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem NginxDiagnosticItem(string id = null, string directive = null, string description = null, string file = null, float line = 0f, string message = null, string rule = null, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel level = default(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel), string category = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration NginxFrontendIPConfiguration(System.Collections.Generic.IEnumerable publicIPAddresses = null, System.Collections.Generic.IEnumerable privateIPAddresses = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions WebApplicationFirewallComponentVersions(string wafEngineVersion = null, string wafNginxVersion = null) { throw null; } public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage WebApplicationFirewallPackage(string version = null, System.DateTimeOffset revisionDatetime = default(System.DateTimeOffset)) { throw null; } - public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage attackSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage botSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage threatCampaignsPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions componentVersions = null) { throw null; } + public static Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus(string wafRelease = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage attackSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage botSignaturesPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage threatCampaignsPackage = null, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions componentVersions = null) { throw null; } } public partial class NginxAnalysisConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxAnalysisConfig() { } public System.Collections.Generic.IList Files { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } - public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -294,7 +385,10 @@ public partial class NginxAnalysisContent : System.ClientModel.Primitives.IJsonM { public NginxAnalysisContent(Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig config) { } public Azure.ResourceManager.Nginx.Models.NginxAnalysisConfig Config { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -311,7 +405,10 @@ internal NginxAnalysisDiagnostic() { } public float Line { get { throw null; } } public string Message { get { throw null; } } public string Rule { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisDiagnostic System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -323,7 +420,10 @@ public partial class NginxAnalysisResult : System.ClientModel.Primitives.IJsonMo internal NginxAnalysisResult() { } public Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails Data { get { throw null; } } public string Status { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -333,9 +433,12 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class NginxAnalysisResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NginxAnalysisResultDetails() { } - public System.Collections.Generic.IReadOnlyList Diagnostics { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IList Diagnostics { get { throw null; } } + public System.Collections.Generic.IList Errors { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxAnalysisResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -347,7 +450,10 @@ public partial class NginxCertificateError : System.ClientModel.Primitives.IJson public NginxCertificateError() { } public string Code { get { throw null; } set { } } public string Message { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateError JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateError PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxCertificateError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxCertificateError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -365,18 +471,44 @@ public NginxCertificateProperties() { } public string KeyVirtualPath { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } public string Sha1Thumbprint { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxCertificateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxCertificateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxCertificateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class NginxConfigurationCreateOrUpdateContent : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class NginxConfigurationContentProtectedFile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxConfigurationContentProtectedFile() { } + public string Content { get { throw null; } set { } } + public string ContentHash { get { throw null; } set { } } + public string VirtualPath { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxConfigurationContentProtectedFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxConfigurationCreateOrUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxConfigurationCreateOrUpdateContent() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -388,10 +520,13 @@ public partial class NginxConfigurationCreateOrUpdateProperties : System.ClientM public NginxConfigurationCreateOrUpdateProperties() { } public System.Collections.Generic.IList Files { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } - public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationCreateOrUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -402,8 +537,12 @@ public partial class NginxConfigurationFile : System.ClientModel.Primitives.IJso { public NginxConfigurationFile() { } public string Content { get { throw null; } set { } } + public string ContentHash { get { throw null; } set { } } public string VirtualPath { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationFile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationFile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationFile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationFile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -415,7 +554,10 @@ public partial class NginxConfigurationPackage : System.ClientModel.Primitives.I public NginxConfigurationPackage() { } public string Data { get { throw null; } set { } } public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -424,49 +566,34 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class NginxConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal NginxConfigurationProperties() { } - public System.Collections.Generic.IReadOnlyList Files { get { throw null; } } - public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ProtectedFiles { get { throw null; } } + public NginxConfigurationProperties() { } + public System.Collections.Generic.IList Files { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxConfigurationPackage Package { get { throw null; } set { } } + public System.Collections.Generic.IList ProtectedFiles { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } - public string RootFile { get { throw null; } } + public string RootFile { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class NginxConfigurationProtectedFileContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public NginxConfigurationProtectedFileContent() { } - public string Content { get { throw null; } set { } } - public string ContentHash { get { throw null; } set { } } - public string VirtualPath { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class NginxConfigurationProtectedFileResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal NginxConfigurationProtectedFileResult() { } - public string ContentHash { get { throw null; } } - public string VirtualPath { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Nginx.Models.NginxConfigurationProtectedFileResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class NginxDeploymentApiKeyCreateOrUpdateContent : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class NginxDeploymentApiKeyCreateOrUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxDeploymentApiKeyCreateOrUpdateContent() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties Properties { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -478,7 +605,10 @@ public partial class NginxDeploymentApiKeyProperties : System.ClientModel.Primit internal NginxDeploymentApiKeyProperties() { } public System.DateTimeOffset? EndOn { get { throw null; } } public string Hint { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -490,13 +620,46 @@ public partial class NginxDeploymentApiKeyRequestProperties : System.ClientModel public NginxDeploymentApiKeyRequestProperties() { } public System.DateTimeOffset? EndOn { get { throw null; } set { } } public string SecretText { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentApiKeyRequestProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NginxDeploymentDefaultWafPolicyListResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyListResult() { } + public string NextLink { get { throw null; } } + public System.Collections.Generic.IList Value { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyListResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentDefaultWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyProperties() { } + public System.BinaryData Content { get { throw null; } } + public string Filepath { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentDefaultWafPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NginxDeploymentPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxDeploymentPatch() { } @@ -505,7 +668,10 @@ public NginxDeploymentPatch() { } public Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties Properties { get { throw null; } set { } } public string SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -519,14 +685,21 @@ public NginxDeploymentProperties() { } public bool? EnableDiagnosticsSupport { get { throw null; } set { } } public string IPAddress { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxStorageAccount LoggingStorageAccount { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string ManagedResourceGroup { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxNetworkProfile NetworkProfile { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect NginxAppProtect { get { throw null; } set { } } public string NginxVersion { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public int? ScalingCapacity { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties ScalingProperties { get { throw null; } set { } } public string UpgradeChannel { get { throw null; } set { } } public string UserPreferredEmail { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -538,7 +711,10 @@ public partial class NginxDeploymentPropertiesNginxAppProtect : System.ClientMod public NginxDeploymentPropertiesNginxAppProtect(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings webApplicationFirewallSettings) { } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus WebApplicationFirewallStatus { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentPropertiesNginxAppProtect System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -550,7 +726,10 @@ public partial class NginxDeploymentScalingProperties : System.ClientModel.Primi public NginxDeploymentScalingProperties() { } public int? Capacity { get { throw null; } set { } } public System.Collections.Generic.IList Profiles { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -563,17 +742,150 @@ public NginxDeploymentUpdateProperties() { } public bool? EnableDiagnosticsSupport { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxStorageAccount LoggingStorageAccount { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxNetworkProfile NetworkProfile { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public int? ScalingCapacity { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentScalingProperties ScalingProperties { get { throw null; } set { } } public string UpgradeChannel { get { throw null; } set { } } public string UserPreferredEmail { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDeploymentUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NginxDeploymentWafPolicyApplyingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyApplyingStatus() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public string Time { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDeploymentWafPolicyApplyingStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDeploymentWafPolicyApplyingStatusCode(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Applying { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode NotApplied { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Removing { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatusCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxDeploymentWafPolicyCompilingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyCompilingStatus() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? Code { get { throw null; } } + public string DisplayStatus { get { throw null; } } + public string Time { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NginxDeploymentWafPolicyCompilingStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NginxDeploymentWafPolicyCompilingStatusCode(string value) { throw null; } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode InProgress { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode NotStarted { get { throw null; } } + public static Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode? (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode left, Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatusCode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NginxDeploymentWafPolicyMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadata() { } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties Properties { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + public string Type { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyMetadataProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadataProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } + public string Filepath { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NginxDeploymentWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NginxDeploymentWafPolicyProperties() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } + public System.BinaryData Content { get { throw null; } set { } } + public string Filepath { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NginxDiagnosticItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NginxDiagnosticItem() { } @@ -586,7 +898,10 @@ internal NginxDiagnosticItem() { } public float Line { get { throw null; } } public string Message { get { throw null; } } public string Rule { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxDiagnosticItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -608,6 +923,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel left, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel left, Azure.ResourceManager.Nginx.Models.NginxDiagnosticLevel right) { throw null; } public override string ToString() { throw null; } } @@ -616,7 +932,10 @@ public partial class NginxFrontendIPConfiguration : System.ClientModel.Primitive public NginxFrontendIPConfiguration() { } public System.Collections.Generic.IList PrivateIPAddresses { get { throw null; } } public System.Collections.Generic.IList PublicIPAddresses { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -628,7 +947,10 @@ public partial class NginxNetworkProfile : System.ClientModel.Primitives.IJsonMo public NginxNetworkProfile() { } public Azure.ResourceManager.Nginx.Models.NginxFrontendIPConfiguration FrontEndIPConfiguration { get { throw null; } set { } } public Azure.Core.ResourceIdentifier NetworkInterfaceSubnetId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxNetworkProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxNetworkProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxNetworkProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -641,7 +963,10 @@ public NginxPrivateIPAddress() { } public System.Net.IPAddress PrivateIPAddress { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod? PrivateIPAllocationMethod { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxPrivateIPAddress System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -663,6 +988,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod left, Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod left, Azure.ResourceManager.Nginx.Models.NginxPrivateIPAllocationMethod right) { throw null; } public override string ToString() { throw null; } } @@ -688,6 +1014,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.NginxProvisioningState left, Azure.ResourceManager.Nginx.Models.NginxProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.NginxProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.NginxProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.NginxProvisioningState left, Azure.ResourceManager.Nginx.Models.NginxProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -696,7 +1023,10 @@ public partial class NginxScaleProfile : System.ClientModel.Primitives.IJsonMode public NginxScaleProfile(string name, Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity capacity) { } public Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity Capacity { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxScaleProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxScaleProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -708,7 +1038,10 @@ public partial class NginxScaleProfileCapacity : System.ClientModel.Primitives.I public NginxScaleProfileCapacity(int min, int max) { } public int Max { get { throw null; } set { } } public int Min { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxScaleProfileCapacity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -720,7 +1053,10 @@ public partial class NginxStorageAccount : System.ClientModel.Primitives.IJsonMo public NginxStorageAccount() { } public string AccountName { get { throw null; } set { } } public string ContainerName { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.NginxStorageAccount JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.NginxStorageAccount PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.NginxStorageAccount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.NginxStorageAccount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -742,6 +1078,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState left, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState right) { throw null; } public static implicit operator Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState left, Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState right) { throw null; } public override string ToString() { throw null; } } @@ -750,7 +1087,10 @@ public partial class WebApplicationFirewallComponentVersions : System.ClientMode internal WebApplicationFirewallComponentVersions() { } public string WafEngineVersion { get { throw null; } } public string WafNginxVersion { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -762,7 +1102,10 @@ public partial class WebApplicationFirewallPackage : System.ClientModel.Primitiv internal WebApplicationFirewallPackage() { } public System.DateTimeOffset RevisionDatetime { get { throw null; } } public string Version { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -773,7 +1116,10 @@ public partial class WebApplicationFirewallSettings : System.ClientModel.Primiti { public WebApplicationFirewallSettings() { } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallActivationState? ActivationState { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -787,7 +1133,11 @@ internal WebApplicationFirewallStatus() { } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage BotSignaturesPackage { get { throw null; } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallComponentVersions ComponentVersions { get { throw null; } } public Azure.ResourceManager.Nginx.Models.WebApplicationFirewallPackage ThreatCampaignsPackage { get { throw null; } } + public string WafRelease { get { throw null; } } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.Models.WebApplicationFirewallStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/assets.json b/sdk/nginx/Azure.ResourceManager.Nginx/assets.json index 0dbce0ac264d..5380f2681555 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/assets.json +++ b/sdk/nginx/Azure.ResourceManager.Nginx/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/nginx/Azure.ResourceManager.Nginx", - "Tag": "net/nginx/Azure.ResourceManager.Nginx_a74a2ec3bb" + "Tag": "net/nginx/Azure.ResourceManager.Nginx_9bb317f9e4" } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Azure.ResourceManager.Nginx.csproj b/sdk/nginx/Azure.ResourceManager.Nginx/src/Azure.ResourceManager.Nginx.csproj index 8c40373508a6..f91910e19267 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Azure.ResourceManager.Nginx.csproj +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Azure.ResourceManager.Nginx.csproj @@ -2,7 +2,7 @@ 1.1.0-beta.4 - + 1.0.0 Azure.ResourceManager.Nginx Microsoft Azure Resource Manager client SDK for Azure resource provider Nginx.NginxPlus. azure;management;arm;resource manager;nginx diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs new file mode 100644 index 000000000000..3feab50fd274 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// A factory class for creating instances of the models for mocking. + public static partial class ArmNginxModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + /// A new instance for mocking. + public static NginxConfigurationData NginxConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxConfigurationProperties properties, AzureLocation? location) + => NginxConfigurationData(id, name, resourceType, systemData, properties); + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Gets or sets the identity. + /// + /// + /// A new instance for mocking. + public static NginxDeploymentData NginxDeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, NginxDeploymentProperties properties = default, string skuName = default) + => NginxDeploymentData(id, name, resourceType, systemData, tags, location, properties, identity, skuName); + + /// Initializes a new instance of . + /// + /// + /// + /// + /// A new instance for mocking. + public static NginxCertificateProperties NginxCertificateProperties(NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId) + => NginxCertificateProperties(provisioningState, keyVirtualPath, certificateVirtualPath, keyVaultSecretId, null, null, null, null); + + /// Initializes a new instance of . + /// + /// + /// The managed resource group to deploy VNet injection related network resources. + /// + /// The IP address of the deployment. + /// + /// + /// + /// + /// A new instance for mocking. + public static NginxDeploymentProperties NginxDeploymentProperties(NginxProvisioningState? provisioningState, string nginxVersion, string managedResourceGroup, NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, NginxStorageAccount loggingStorageAccount, int? scalingCapacity, string userPreferredEmail = default) + => NginxDeploymentProperties(provisioningState, nginxVersion, networkProfile, ipAddress, enableDiagnosticsSupport, loggingStorageAccount, null, null, userPreferredEmail, null, null); + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxConfigurationFile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxConfigurationFile.cs new file mode 100644 index 000000000000..7a673f91e37f --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxConfigurationFile.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Configuration File. + [Microsoft.TypeSpec.Generator.Customizations.CodeGenSerialization(nameof(ContentHash), "contentHash")] + public partial class NginxConfigurationFile + { + /// Gets or sets the Content. + public string ContentHash { get; set; } // The service returns a "contentHash" field that is missing from the spec + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs new file mode 100644 index 000000000000..6750dd2d2de6 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Properties. + public partial class NginxDeploymentProperties + { + /// The managed resource group to deploy VNet injection related network resources. + [EditorBrowsable(EditorBrowsableState.Never)] + public string ManagedResourceGroup { get; set; } // This was a spec breaking change, so we’re adding the property back to restore backward compatibility. + + /// Gets or sets the scaling capacity. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? ScalingCapacity + { + get => ScalingProperties is null ? default : ScalingProperties.Capacity; + set + { + if (ScalingProperties is null) + ScalingProperties = new NginxDeploymentScalingProperties(); + ScalingProperties.Capacity = value; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs new file mode 100644 index 000000000000..a55f59510b6c --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Frontend IP Configuration. + [Microsoft.TypeSpec.Generator.Customizations.CodeGenSerialization(nameof(PublicIPAddresses), DeserializationValueHook = nameof(DeserializePublicIPAddresses))] // CodeGen issue, should be removed when fixed + public partial class NginxFrontendIPConfiguration + { + internal static WritableSubResource DeserializeWritableSubResource(JsonElement element) + { + ResourceIdentifier id = null; + foreach (JsonProperty item in element.EnumerateObject()) + { + if (item.NameEquals("id") && item.Value.ValueKind != JsonValueKind.Null) + { + id = new ResourceIdentifier(item.Value.GetString()); + } + } + + return new WritableSubResource() { Id = id }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void DeserializePublicIPAddresses(JsonProperty property, ref IList publicIPAddresses) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + return; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeWritableSubResource(item)); + } + publicIPAddresses = array; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationCollection.cs new file mode 100644 index 000000000000..02adc2c7e8cd --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationCollection.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNginxConfigurations method from an instance of . + /// + public partial class NginxConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + /// + /// Create or update the NGINX configuration for given NGINX deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// + /// + /// Operation Id + /// Configurations_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. + /// The NGINX configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string configurationName, NginxConfigurationData data, CancellationToken cancellationToken = default) + => await CreateOrUpdateAsync(waitUntil, configurationName, + new NginxConfigurationCreateOrUpdateContent(data.Id, data.Name, data.ResourceType, + new NginxConfigurationCreateOrUpdateProperties(data.Properties.ProvisioningState, data.Properties.Files, + data.Properties.ProtectedFiles?.Select(file => new NginxConfigurationContentProtectedFile(null, file.VirtualPath, file.ContentHash, null)).ToList(), + data.Properties.Package, data.Properties.RootFile, null), + data.SystemData, null), + cancellationToken).ConfigureAwait(false); + + /// + /// Create or update the NGINX configuration for given NGINX deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// + /// + /// Operation Id + /// Configurations_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. + /// The NGINX configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string configurationName, NginxConfigurationData data, CancellationToken cancellationToken = default) + => CreateOrUpdate(waitUntil, configurationName, + new NginxConfigurationCreateOrUpdateContent(data.Id, data.Name, data.ResourceType, + new NginxConfigurationCreateOrUpdateProperties(data.Properties.ProvisioningState, data.Properties.Files, + data.Properties.ProtectedFiles?.Select(file => new NginxConfigurationContentProtectedFile(null, file.VirtualPath, file.ContentHash, null)).ToList(), + data.Properties.Package, data.Properties.RootFile, null), + data.SystemData, null), + cancellationToken); + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs new file mode 100644 index 000000000000..208c38476292 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Nginx +{ + /// A class representing the NginxConfiguration data model. + public partial class NginxConfigurationData : ResourceData + { + /// Gets or sets the location. + [EditorBrowsable(EditorBrowsableState.Never)] + public AzureLocation? Location { get; set; } // This was a spec breaking change, so we’re adding the property back to restore backward compatibility. + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationResource.cs new file mode 100644 index 000000000000..2034d908cfb3 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationResource.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + /// + /// A class representing a NginxConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetNginxConfigurations method. + /// + public partial class NginxConfigurationResource : ArmResource + { + /// + /// Create or update the NGINX configuration for given NGINX deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// + /// + /// Operation Id + /// Configurations_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The NGINX configuration. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxConfigurationData data, CancellationToken cancellationToken = default) + => await UpdateAsync(waitUntil, + new NginxConfigurationCreateOrUpdateContent(data.Id, data.Name, data.ResourceType, + new NginxConfigurationCreateOrUpdateProperties(data.Properties.ProvisioningState, data.Properties.Files, + data.Properties.ProtectedFiles?.Select(file => new NginxConfigurationContentProtectedFile(null, file.VirtualPath, file.ContentHash, null)).ToList(), + data.Properties.Package, data.Properties.RootFile, null), + data.SystemData, null), + cancellationToken).ConfigureAwait(false); + + /// + /// Create or update the NGINX configuration for given NGINX deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// + /// + /// Operation Id + /// Configurations_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The NGINX configuration. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, NginxConfigurationData data, CancellationToken cancellationToken = default) + => Update(waitUntil, + new NginxConfigurationCreateOrUpdateContent(data.Id, data.Name, data.ResourceType, + new NginxConfigurationCreateOrUpdateProperties(data.Properties.ProvisioningState, data.Properties.Files, + data.Properties.ProtectedFiles?.Select(file => new NginxConfigurationContentProtectedFile(null, file.VirtualPath, file.ContentHash, null)).ToList(), + data.Properties.Package, data.Properties.RootFile, null), + data.SystemData, null), + cancellationToken); + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs new file mode 100644 index 000000000000..6b2ecca96df4 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Update Properties. + public partial class NginxDeploymentUpdateProperties + { + /// Gets or sets the scaling capacity. + [EditorBrowsable(EditorBrowsableState.Never)] + public int? ScalingCapacity + { + get => ScalingProperties is null ? default : ScalingProperties.Capacity; + set + { + if (ScalingProperties is null) + ScalingProperties = new NginxDeploymentScalingProperties(); + ScalingProperties.Capacity = value; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs index 8b03cde8740a..80e08ee66a53 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs @@ -8,90 +8,294 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Nginx.Models { - /// Model factory for models. + /// A factory class for creating instances of the models for mocking. public static partial class ArmNginxModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// + + /// Nginx Deployment Api Key Response. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Nginx Deployment Api Key Response Properties. + /// A new instance for mocking. + public static NginxDeploymentApiKeyData NginxDeploymentApiKeyData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, NginxDeploymentApiKeyProperties properties = default) + { + return new NginxDeploymentApiKeyData( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties: null, + properties); + } + + /// Nginx Deployment Api Key Response Properties. + /// The first three characters of the secret text to help identify it in use. This property is read-only. + /// The time after which this Dataplane API Key is no longer valid. + /// A new instance for mocking. + public static NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(string hint = default, DateTimeOffset? endOn = default) + { + return new NginxDeploymentApiKeyProperties(hint, endOn, additionalBinaryDataProperties: null); + } + + /// Nginx Deployment Api Key Request. + /// + /// + /// + /// Nginx Deployment Api Key Request Properties. + /// Metadata pertaining to creation and last modification of the resource. /// A new instance for mocking. - public static NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentApiKeyRequestProperties properties = null) + public static NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(string id = default, string name = default, string resourceType = default, NginxDeploymentApiKeyRequestProperties properties = default, SystemData systemData = default) { return new NginxDeploymentApiKeyCreateOrUpdateContent( id, name, resourceType, - systemData, properties, - serializedAdditionalRawData: null); + systemData, + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// A new instance for mocking. - public static NginxDeploymentApiKeyData NginxDeploymentApiKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentApiKeyProperties properties = null) + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. + /// Nginx Deployment Properties. + /// Identity Properties. + /// Name of the SKU. + /// A new instance for mocking. + public static NginxDeploymentData NginxDeploymentData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, NginxDeploymentProperties properties = default, ManagedServiceIdentity identity = default, string skuName = default) { - return new NginxDeploymentApiKeyData( + tags ??= new ChangeTrackingDictionary(); + + return new NginxDeploymentData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, + tags, + location, properties, - serializedAdditionalRawData: null); + identity, + skuName is null ? default : new NginxResourceSku(skuName, null)); } - /// Initializes a new instance of . - /// The first three characters of the secret text to help identify it in use. This property is read-only. - /// The time after which this Dataplane API Key is no longer valid. - /// A new instance for mocking. - public static NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(string hint = null, DateTimeOffset? endOn = null) + /// Provisioning State. + /// + /// Nginx Network Profile. + /// The IP address of the deployment. + /// + /// Nginx Storage Account. + /// Information on how the deployment will be scaled. + /// Channel used for autoupgrade. + /// The preferred support contact email address of the user used for sending alerts and notification. Can be an empty string or a valid email address. + /// Settings for NGINX App Protect (NAP). + /// Dataplane API endpoint for the caller to update the NGINX state of the deployment. + /// A new instance for mocking. + public static NginxDeploymentProperties NginxDeploymentProperties(NginxProvisioningState? provisioningState = default, string nginxVersion = default, NginxNetworkProfile networkProfile = default, string ipAddress = default, bool? enableDiagnosticsSupport = default, NginxStorageAccount loggingStorageAccount = default, NginxDeploymentScalingProperties scalingProperties = default, string upgradeChannel = default, string userPreferredEmail = default, NginxDeploymentPropertiesNginxAppProtect nginxAppProtect = default, string dataplaneApiEndpoint = default) + { + return new NginxDeploymentProperties( + provisioningState, + nginxVersion, + networkProfile, + ipAddress, + enableDiagnosticsSupport, + loggingStorageAccount is null ? default : new NginxLogging(loggingStorageAccount, null), + scalingProperties, + upgradeChannel is null ? default : new AutoUpgradeProfile(upgradeChannel, null), + userPreferredEmail is null ? default : new NginxDeploymentUserProfile(userPreferredEmail, null), + nginxAppProtect, + dataplaneApiEndpoint, + additionalBinaryDataProperties: null); + } + + /// Nginx Frontend IP Configuration. + /// + /// + /// A new instance for mocking. + public static NginxFrontendIPConfiguration NginxFrontendIPConfiguration(IEnumerable publicIPAddresses = default, IEnumerable privateIPAddresses = default) + { + publicIPAddresses ??= new ChangeTrackingList(); + privateIPAddresses ??= new ChangeTrackingList(); + + return new NginxFrontendIPConfiguration(publicIPAddresses.ToList(), privateIPAddresses.ToList(), additionalBinaryDataProperties: null); + } + + /// The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. + /// The status of the NGINX App Protect Web Application Firewall. + /// A new instance for mocking. + public static NginxDeploymentPropertiesNginxAppProtect NginxDeploymentPropertiesNginxAppProtect(WebApplicationFirewallActivationState? webApplicationFirewallActivationState = default, WebApplicationFirewallStatus webApplicationFirewallStatus = default) + { + return new NginxDeploymentPropertiesNginxAppProtect(webApplicationFirewallActivationState is null ? default : new WebApplicationFirewallSettings(webApplicationFirewallActivationState, null), webApplicationFirewallStatus, additionalBinaryDataProperties: null); + } + + /// The status of the NGINX App Protect Web Application Firewall. + /// NGINX App Protect WAF release version. + /// Package containing attack signatures for the NGINX App Protect Web Application Firewall (WAF). + /// Package containing bot signatures for the NGINX App Protect Web Application Firewall (WAF). + /// Package containing threat campaigns for the NGINX App Protect Web Application Firewall (WAF). + /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. + /// A new instance for mocking. + public static WebApplicationFirewallStatus WebApplicationFirewallStatus(string wafRelease = default, WebApplicationFirewallPackage attackSignaturesPackage = default, WebApplicationFirewallPackage botSignaturesPackage = default, WebApplicationFirewallPackage threatCampaignsPackage = default, WebApplicationFirewallComponentVersions componentVersions = default) + { + return new WebApplicationFirewallStatus( + wafRelease, + attackSignaturesPackage, + botSignaturesPackage, + threatCampaignsPackage, + componentVersions, + additionalBinaryDataProperties: null); + } + + /// NGINX App Protect Web Application Firewall (WAF) Package. Contains the version and revision date of the package. + /// The version of the NGINX App Protect Web Application Firewall (WAF) package. + /// The date and time of the package revision. + /// A new instance for mocking. + public static WebApplicationFirewallPackage WebApplicationFirewallPackage(string version = default, DateTimeOffset revisionDatetime = default) + { + return new WebApplicationFirewallPackage(version, revisionDatetime, additionalBinaryDataProperties: null); + } + + /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. + /// The version of the NGINX App Protect Web Application Firewall (WAF) engine. + /// The version of the NGINX App Protect Web Application Firewall (WAF) module for NGINX. + /// A new instance for mocking. + public static WebApplicationFirewallComponentVersions WebApplicationFirewallComponentVersions(string wafEngineVersion = default, string wafNginxVersion = default) + { + return new WebApplicationFirewallComponentVersions(wafEngineVersion, wafNginxVersion, additionalBinaryDataProperties: null); + } + + /// Identity Properties. + /// Dictionary of <string>. + /// Name of the SKU. + /// The geo-location where the resource lives. + /// Nginx Deployment Update Properties. + /// A new instance for mocking. + public static NginxDeploymentPatch NginxDeploymentPatch(ManagedServiceIdentity identity = default, IDictionary tags = default, string skuName = default, AzureLocation? location = default, NginxDeploymentUpdateProperties properties = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new NginxDeploymentPatch( + identity, + tags, + skuName is null ? default : new NginxResourceSku(skuName, null), + location, + properties, + additionalBinaryDataProperties: null); + } + + /// Nginx Deployment Waf Policy Metadata. + /// + /// + /// + /// Nginx Deployment Waf Policy Metadata Properties. + /// Metadata pertaining to creation and last modification of the resource. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyMetadata NginxDeploymentWafPolicyMetadata(string id = default, string name = default, string @type = default, NginxDeploymentWafPolicyMetadataProperties properties = default, SystemData systemData = default) { - return new NginxDeploymentApiKeyProperties(hint, endOn, serializedAdditionalRawData: null); + return new NginxDeploymentWafPolicyMetadata( + id, + name, + @type, + properties, + systemData, + additionalBinaryDataProperties: null); + } + + /// Nginx Deployment Waf Policy Metadata Properties. + /// + /// Provisioning State. + /// Nginx Deployment Waf Policy Compiling Status. + /// Nginx Deployment Waf Policy Applying Status. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyMetadataProperties NginxDeploymentWafPolicyMetadataProperties(string filepath = default, NginxProvisioningState? provisioningState = default, NginxDeploymentWafPolicyCompilingStatus compilingState = default, NginxDeploymentWafPolicyApplyingStatus applyingState = default) + { + return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, additionalBinaryDataProperties: null); + } + + /// Nginx Deployment Waf Policy Compiling Status. + /// Machine readable code indicating the compilation status of a WAF Policy. + /// A readable string of the current status, and sometimes have the reason for the current state. If the CompilingStatus is Failed the Display Status will be The waf Policy failed to compile. + /// The date and time the policy was compiled in UTC. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyCompilingStatus NginxDeploymentWafPolicyCompilingStatus(NginxDeploymentWafPolicyCompilingStatusCode? code = default, string displayStatus = default, string time = default) + { + return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, additionalBinaryDataProperties: null); + } + + /// Nginx Deployment Waf Policy Applying Status. + /// Machine readable code indicating the applying status code of a WAF Policy. + /// A readable string of the current status, and sometimes have the reason for the current state. + /// The date and time in UTC the current applying status was set. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyApplyingStatus NginxDeploymentWafPolicyApplyingStatus(NginxDeploymentWafPolicyApplyingStatusCode? code = default, string displayStatus = default, string time = default) + { + return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, additionalBinaryDataProperties: null); + } + + /// Nginx Deployment Default Waf Policy List Response. + /// + /// + /// A new instance for mocking. + public static NginxDeploymentDefaultWafPolicyListResult NginxDeploymentDefaultWafPolicyListResult(IEnumerable value = default, string nextLink = default) + { + value ??= new ChangeTrackingList(); + + return new NginxDeploymentDefaultWafPolicyListResult(value.ToList(), nextLink, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// + /// Nginx Deployment Default Waf Policy Properties. + /// + /// + /// A new instance for mocking. + public static NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(BinaryData content = default, string filepath = default) + { + return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, additionalBinaryDataProperties: null); + } + + /// Nginx Certificate. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Nginx Certificate Properties. + /// The geo-location where the resource lives. /// A new instance for mocking. - public static NginxCertificateData NginxCertificateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxCertificateProperties properties = null, AzureLocation? location = null) + public static NginxCertificateData NginxCertificateData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, NginxCertificateProperties properties = default, AzureLocation? location = default) { return new NginxCertificateData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, properties, - location, - serializedAdditionalRawData: null); + location); } - /// Initializes a new instance of . - /// + /// Nginx Certificate Properties. + /// Provisioning State. /// /// /// /// /// /// - /// + /// Nginx Certificate Error Response Body. /// A new instance for mocking. - public static NginxCertificateProperties NginxCertificateProperties(NginxProvisioningState? provisioningState = null, string keyVirtualPath = null, string certificateVirtualPath = null, string keyVaultSecretId = null, string sha1Thumbprint = null, string keyVaultSecretVersion = null, DateTimeOffset? keyVaultSecretCreated = null, NginxCertificateError certificateError = null) + public static NginxCertificateProperties NginxCertificateProperties(NginxProvisioningState? provisioningState = default, string keyVirtualPath = default, string certificateVirtualPath = default, string keyVaultSecretId = default, string sha1Thumbprint = default, string keyVaultSecretVersion = default, DateTimeOffset? keyVaultSecretCreated = default, NginxCertificateError certificateError = default) { return new NginxCertificateProperties( provisioningState, @@ -102,118 +306,142 @@ public static NginxCertificateProperties NginxCertificateProperties(NginxProvisi keyVaultSecretVersion, keyVaultSecretCreated, certificateError, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// + /// Nginx Configuration Response. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Nginx Configuration Response Properties. /// A new instance for mocking. - public static NginxConfigurationData NginxConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxConfigurationProperties properties = null) + public static NginxConfigurationData NginxConfigurationData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, NginxConfigurationProperties properties = default) { return new NginxConfigurationData( id, name, resourceType, systemData, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . - /// + /// Nginx Configuration Response Properties. + /// Provisioning State. /// /// - /// + /// Nginx Configuration Package. /// /// A new instance for mocking. - public static NginxConfigurationProperties NginxConfigurationProperties(NginxProvisioningState? provisioningState = null, IEnumerable files = null, IEnumerable protectedFiles = null, NginxConfigurationPackage package = null, string rootFile = null) + public static NginxConfigurationProperties NginxConfigurationProperties(NginxProvisioningState? provisioningState = default, IEnumerable files = default, IEnumerable protectedFiles = default, NginxConfigurationPackage package = default, string rootFile = default) { - files ??= new List(); - protectedFiles ??= new List(); + files ??= new ChangeTrackingList(); + protectedFiles ??= new ChangeTrackingList(); return new NginxConfigurationProperties( provisioningState, - files?.ToList(), - protectedFiles?.ToList(), + files.ToList(), + protectedFiles.ToList(), package, rootFile, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The virtual path of the protected file. - /// The hash of the content of the file. This value is used to determine if the file has changed. - /// A new instance for mocking. - public static NginxConfigurationProtectedFileResult NginxConfigurationProtectedFileResult(string virtualPath = null, string contentHash = null) + /// Nginx Configuration Package. + /// + /// + /// A new instance for mocking. + public static NginxConfigurationPackage NginxConfigurationPackage(string data = default, IEnumerable protectedFiles = default) { - return new NginxConfigurationProtectedFileResult(virtualPath, contentHash, serializedAdditionalRawData: null); + protectedFiles ??= new ChangeTrackingList(); + + return new NginxConfigurationPackage(data, protectedFiles.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// + /// Nginx Configuration Request. + /// + /// + /// + /// Nginx Configuration Request Properties. + /// Metadata pertaining to creation and last modification of the resource. /// A new instance for mocking. - public static NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxConfigurationCreateOrUpdateProperties properties = null) + public static NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(string id = default, string name = default, string resourceType = default, NginxConfigurationCreateOrUpdateProperties properties = default, SystemData systemData = default) { return new NginxConfigurationCreateOrUpdateContent( id, name, resourceType, - systemData, properties, - serializedAdditionalRawData: null); + systemData, + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// + /// Nginx Configuration Request Properties. + /// Provisioning State. /// /// - /// + /// Nginx Configuration Package. /// /// A new instance for mocking. - public static NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(NginxProvisioningState? provisioningState = null, IEnumerable files = null, IEnumerable protectedFiles = null, NginxConfigurationPackage package = null, string rootFile = null) + public static NginxConfigurationCreateOrUpdateProperties NginxConfigurationCreateOrUpdateProperties(NginxProvisioningState? provisioningState = default, IEnumerable files = default, IEnumerable protectedFiles = default, NginxConfigurationPackage package = default, string rootFile = default) { - files ??= new List(); - protectedFiles ??= new List(); + files ??= new ChangeTrackingList(); + protectedFiles ??= new ChangeTrackingList(); return new NginxConfigurationCreateOrUpdateProperties( provisioningState, - files?.ToList(), - protectedFiles?.ToList(), + files.ToList(), + protectedFiles.ToList(), package, rootFile, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The request body for creating an analysis for an NGINX configuration. + /// + /// A new instance for mocking. + public static NginxAnalysisContent NginxAnalysisContent(NginxAnalysisConfig config = default) + { + return new NginxAnalysisContent(config, additionalBinaryDataProperties: null); + } + + /// The NginxAnalysisConfig. + /// The root file of the NGINX config file(s). It must match one of the files' filepath. + /// + /// + /// Nginx Configuration Package. + /// A new instance for mocking. + public static NginxAnalysisConfig NginxAnalysisConfig(string rootFile = default, IEnumerable files = default, IEnumerable protectedFiles = default, NginxConfigurationPackage package = default) + { + files ??= new ChangeTrackingList(); + protectedFiles ??= new ChangeTrackingList(); + + return new NginxAnalysisConfig(rootFile, files.ToList(), protectedFiles.ToList(), package, additionalBinaryDataProperties: null); + } + + /// The response body for an analysis request. Contains the status of the analysis and any errors. /// The status of the analysis. /// /// A new instance for mocking. - public static NginxAnalysisResult NginxAnalysisResult(string status = null, NginxAnalysisResultDetails data = null) + public static NginxAnalysisResult NginxAnalysisResult(string status = default, NginxAnalysisResultDetails data = default) { - return new NginxAnalysisResult(status, data, serializedAdditionalRawData: null); + return new NginxAnalysisResult(status, data, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The NginxAnalysisResultDetails. /// /// /// A new instance for mocking. - public static NginxAnalysisResultDetails NginxAnalysisResultDetails(IEnumerable errors = null, IEnumerable diagnostics = null) + public static NginxAnalysisResultDetails NginxAnalysisResultDetails(IEnumerable errors = default, IEnumerable diagnostics = default) { - errors ??= new List(); - diagnostics ??= new List(); + errors ??= new ChangeTrackingList(); + diagnostics ??= new ChangeTrackingList(); - return new NginxAnalysisResultDetails(errors?.ToList(), diagnostics?.ToList(), serializedAdditionalRawData: null); + return new NginxAnalysisResultDetails(errors.ToList(), diagnostics.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// An error object found during the analysis of an NGINX configuration. /// Unique identifier for the error. /// /// @@ -222,20 +450,20 @@ public static NginxAnalysisResultDetails NginxAnalysisResultDetails(IEnumerable< /// /// /// A new instance for mocking. - public static NginxAnalysisDiagnostic NginxAnalysisDiagnostic(string id = null, string directive = null, string description = null, string file = null, float line = default, string message = null, string rule = null) + public static NginxAnalysisDiagnostic NginxAnalysisDiagnostic(string id = default, string directive = default, string description = default, string @file = default, float line = default, string message = default, string rule = default) { return new NginxAnalysisDiagnostic( id, directive, description, - file, + @file, line, message, rule, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A diagnostic is a message associated with an NGINX config. The Analyzer returns diagnostics with a level indicating the importance of the diagnostic with optional category. /// Unique identifier for the diagnostic. /// /// @@ -246,115 +474,55 @@ public static NginxAnalysisDiagnostic NginxAnalysisDiagnostic(string id = null, /// Warning or Info. /// Category of warning like Best-practices, Recommendation, Security etc. /// A new instance for mocking. - public static NginxDiagnosticItem NginxDiagnosticItem(string id = null, string directive = null, string description = null, string file = null, float line = default, string message = null, string rule = null, NginxDiagnosticLevel level = default, string category = null) + public static NginxDiagnosticItem NginxDiagnosticItem(string id = default, string directive = default, string description = default, string @file = default, float line = default, string message = default, string rule = default, NginxDiagnosticLevel level = default, string category = default) { return new NginxDiagnosticItem( id, directive, description, - file, + @file, line, message, rule, level, category, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the identity. - /// - /// - /// A new instance for mocking. - public static NginxDeploymentData NginxDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, NginxDeploymentProperties properties = null, string skuName = null) - { - tags ??= new Dictionary(); + additionalBinaryDataProperties: null); + } - return new NginxDeploymentData( + /// Nginx Deployment Waf Policy. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Nginx Deployment Waf Policy Properties. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyData NginxDeploymentWafPolicyData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, NginxDeploymentWafPolicyProperties properties = default) + { + return new NginxDeploymentWafPolicyData( id, name, resourceType, systemData, - tags, - location, - identity, - properties, - skuName != null ? new NginxResourceSku(skuName, serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . - /// - /// - /// - /// The IP address of the deployment. - /// - /// - /// Information on how the deployment will be scaled. - /// Autoupgrade settings of a deployment. - /// - /// Settings for NGINX App Protect (NAP). - /// Dataplane API endpoint for the caller to update the NGINX state of the deployment. - /// A new instance for mocking. - public static NginxDeploymentProperties NginxDeploymentProperties(NginxProvisioningState? provisioningState = null, string nginxVersion = null, NginxNetworkProfile networkProfile = null, string ipAddress = null, bool? enableDiagnosticsSupport = null, NginxStorageAccount loggingStorageAccount = null, NginxDeploymentScalingProperties scalingProperties = null, string upgradeChannel = null, string userPreferredEmail = null, NginxDeploymentPropertiesNginxAppProtect nginxAppProtect = null, string dataplaneApiEndpoint = null) + /// Nginx Deployment Waf Policy Properties. + /// Provisioning State. + /// The byte content of the Policy. + /// The file path where the Policy is to be saved. + /// Nginx Deployment Waf Policy Compiling Status. + /// Nginx Deployment Waf Policy Applying Status. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyProperties(NginxProvisioningState? provisioningState = default, BinaryData content = default, string filepath = default, NginxDeploymentWafPolicyCompilingStatus compilingState = default, NginxDeploymentWafPolicyApplyingStatus applyingState = default) { - return new NginxDeploymentProperties( + return new NginxDeploymentWafPolicyProperties( provisioningState, - nginxVersion, - networkProfile, - ipAddress, - enableDiagnosticsSupport, - loggingStorageAccount != null ? new NginxLogging(loggingStorageAccount, serializedAdditionalRawData: null) : null, - scalingProperties, - upgradeChannel != null ? new AutoUpgradeProfile(upgradeChannel, serializedAdditionalRawData: null) : null, - userPreferredEmail != null ? new NginxDeploymentUserProfile(userPreferredEmail, serializedAdditionalRawData: null) : null, - nginxAppProtect, - dataplaneApiEndpoint, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Settings for the NGINX App Protect Web Application Firewall (WAF). - /// The status of the NGINX App Protect Web Application Firewall. - /// A new instance for mocking. - public static NginxDeploymentPropertiesNginxAppProtect NginxDeploymentPropertiesNginxAppProtect(WebApplicationFirewallActivationState? webApplicationFirewallActivationState = null, WebApplicationFirewallStatus webApplicationFirewallStatus = null) - { - return new NginxDeploymentPropertiesNginxAppProtect(webApplicationFirewallActivationState != null ? new WebApplicationFirewallSettings(webApplicationFirewallActivationState, serializedAdditionalRawData: null) : null, webApplicationFirewallStatus, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Package containing attack signatures for the NGINX App Protect Web Application Firewall (WAF). - /// Package containing bot signatures for the NGINX App Protect Web Application Firewall (WAF). - /// Package containing threat campaigns for the NGINX App Protect Web Application Firewall (WAF). - /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. - /// A new instance for mocking. - public static WebApplicationFirewallStatus WebApplicationFirewallStatus(WebApplicationFirewallPackage attackSignaturesPackage = null, WebApplicationFirewallPackage botSignaturesPackage = null, WebApplicationFirewallPackage threatCampaignsPackage = null, WebApplicationFirewallComponentVersions componentVersions = null) - { - return new WebApplicationFirewallStatus(attackSignaturesPackage, botSignaturesPackage, threatCampaignsPackage, componentVersions, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The version of the NGINX App Protect Web Application Firewall (WAF) package. - /// The date and time of the package revision. - /// A new instance for mocking. - public static WebApplicationFirewallPackage WebApplicationFirewallPackage(string version = null, DateTimeOffset revisionDatetime = default) - { - return new WebApplicationFirewallPackage(version, revisionDatetime, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The version of the NGINX App Protect Web Application Firewall (WAF) engine. - /// The version of the NGINX App Protect Web Application Firewall (WAF) module for NGINX. - /// A new instance for mocking. - public static WebApplicationFirewallComponentVersions WebApplicationFirewallComponentVersions(string wafEngineVersion = null, string wafNginxVersion = null) - { - return new WebApplicationFirewallComponentVersions(wafEngineVersion, wafNginxVersion, serializedAdditionalRawData: null); + content, + filepath, + compilingState, + applyingState, + additionalBinaryDataProperties: null); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllAsyncCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..27fae307402d --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxCertificatesGetAllAsyncCollectionResultOfT : AsyncPageable + { + private readonly NginxCertificates _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxCertificatesGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxCertificates client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxCertificatesGetAllAsyncCollectionResultOfT(NginxCertificates client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxCertificatesGetAllAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxCertificatesGetAllAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + NginxCertificateListResponse result = NginxCertificateListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxCertificateCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllCollectionResultOfT.cs new file mode 100644 index 000000000000..1b79449aa4f8 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// 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; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxCertificatesGetAllCollectionResultOfT : Pageable + { + private readonly NginxCertificates _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxCertificatesGetAllCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxCertificates client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxCertificatesGetAllCollectionResultOfT(NginxCertificates client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxCertificatesGetAllCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxCertificatesGetAllCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + NginxCertificateListResponse result = NginxCertificateListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxCertificateCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllAsyncCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..6dcf3736f445 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxConfigurationResponsesGetAllAsyncCollectionResultOfT : AsyncPageable + { + private readonly NginxConfigurationResponses _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxConfigurationResponsesGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxConfigurationResponses client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxConfigurationResponsesGetAllAsyncCollectionResultOfT(NginxConfigurationResponses client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxConfigurationResponsesGetAllAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxConfigurationResponsesGetAllAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + NginxConfigurationListResponse result = NginxConfigurationListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxConfigurationCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllCollectionResultOfT.cs new file mode 100644 index 000000000000..81db4df7befa --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// 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; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxConfigurationResponsesGetAllCollectionResultOfT : Pageable + { + private readonly NginxConfigurationResponses _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxConfigurationResponsesGetAllCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxConfigurationResponses client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxConfigurationResponsesGetAllCollectionResultOfT(NginxConfigurationResponses client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxConfigurationResponsesGetAllCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxConfigurationResponsesGetAllCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + NginxConfigurationListResponse result = NginxConfigurationListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxConfigurationCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..9eebf57ad5ae --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT : AsyncPageable + { + private readonly NginxDeploymentApiKeyResponses _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeploymentApiKeyResponses client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT(NginxDeploymentApiKeyResponses client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + NginxDeploymentApiKeyListResponse result = NginxDeploymentApiKeyListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT.cs new file mode 100644 index 000000000000..0b8265b97710 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// 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; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT : Pageable + { + private readonly NginxDeploymentApiKeyResponses _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeploymentApiKeyResponses client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT(NginxDeploymentApiKeyResponses client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + NginxDeploymentApiKeyListResponse result = NginxDeploymentApiKeyListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllAsyncCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..4c9667f809e4 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllAsyncCollectionResultOfT.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentsGetAllAsyncCollectionResultOfT : AsyncPageable + { + private readonly NginxDeployments _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentsGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeployments client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentsGetAllAsyncCollectionResultOfT(NginxDeployments client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of NginxDeploymentsGetAllAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentsGetAllAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + NginxDeploymentListResponse result = NginxDeploymentListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _context) : _client.CreateGetAllRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableNginxSubscriptionResource.GetNginxDeployments"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllCollectionResultOfT.cs new file mode 100644 index 000000000000..f1465750505b --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllCollectionResultOfT.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentsGetAllCollectionResultOfT : Pageable + { + private readonly NginxDeployments _client; + private readonly Guid _subscriptionId; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentsGetAllCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeployments client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentsGetAllCollectionResultOfT(NginxDeployments client, Guid subscriptionId, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _context = context; + } + + /// Gets the pages of NginxDeploymentsGetAllCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentsGetAllCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + NginxDeploymentListResponse result = NginxDeploymentListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _context) : _client.CreateGetAllRequest(_subscriptionId, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableNginxSubscriptionResource.GetNginxDeployments"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..90de23e74239 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable + { + private readonly NginxDeployments _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeployments client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT(NginxDeployments client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + NginxDeploymentListResponse result = NginxDeploymentListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxDeploymentCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupCollectionResultOfT.cs new file mode 100644 index 000000000000..8cd2233da6d6 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupCollectionResultOfT.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentsGetByResourceGroupCollectionResultOfT : Pageable + { + private readonly NginxDeployments _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentsGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeployments client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentsGetByResourceGroupCollectionResultOfT(NginxDeployments client, Guid subscriptionId, string resourceGroupName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _context = context; + } + + /// Gets the pages of NginxDeploymentsGetByResourceGroupCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentsGetByResourceGroupCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + NginxDeploymentListResponse result = NginxDeploymentListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxDeploymentCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..cea9946e3e14 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT : AsyncPageable + { + private readonly NginxDeployments _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeployments client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT(NginxDeployments client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + NginxDeploymentWafPolicyListResponse result = NginxDeploymentWafPolicyListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetWafPoliciesRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetWafPoliciesRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxDeploymentResource.GetWafPolicies"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesCollectionResultOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesCollectionResultOfT.cs new file mode 100644 index 000000000000..39b8bfbd604d --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// 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; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentsGetWafPoliciesCollectionResultOfT : Pageable + { + private readonly NginxDeployments _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _deploymentName; + private readonly RequestContext _context; + + /// Initializes a new instance of NginxDeploymentsGetWafPoliciesCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The NginxDeployments client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of targeted NGINX deployment. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public NginxDeploymentsGetWafPoliciesCollectionResultOfT(NginxDeployments client, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _deploymentName = deploymentName; + _context = context; + } + + /// Gets the pages of NginxDeploymentsGetWafPoliciesCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of NginxDeploymentsGetWafPoliciesCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + NginxDeploymentWafPolicyListResponse result = NginxDeploymentWafPolicyListResponse.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetWafPoliciesRequest(nextLink, _subscriptionId, _resourceGroupName, _deploymentName, _context) : _client.CreateGetWafPoliciesRequest(_subscriptionId, _resourceGroupName, _deploymentName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("NginxDeploymentResource.GetWafPolicies"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxArmClient.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxArmClient.cs index ab02ff1c8233..4f830cf16d4b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxArmClient.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxArmClient.cs @@ -6,38 +6,27 @@ #nullable disable using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Mocking { - /// A class to add extension methods to ArmClient. + /// A class to add extension methods to . public partial class MockableNginxArmClient : ArmResource { - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableNginxArmClient for mocking. protected MockableNginxArmClient() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableNginxArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) { } - internal MockableNginxArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(ResourceIdentifier id) @@ -46,10 +35,16 @@ public virtual NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(Re return new NginxDeploymentApiKeyResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NginxDeploymentResource GetNginxDeploymentResource(ResourceIdentifier id) + { + NginxDeploymentResource.ValidateResourceId(id); + return new NginxDeploymentResource(Client, id); + } + + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual NginxCertificateResource GetNginxCertificateResource(ResourceIdentifier id) @@ -58,10 +53,7 @@ public virtual NginxCertificateResource GetNginxCertificateResource(ResourceIden return new NginxCertificateResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual NginxConfigurationResource GetNginxConfigurationResource(ResourceIdentifier id) @@ -70,16 +62,13 @@ public virtual NginxConfigurationResource GetNginxConfigurationResource(Resource return new NginxConfigurationResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. - /// Returns a object. - public virtual NginxDeploymentResource GetNginxDeploymentResource(ResourceIdentifier id) + /// Returns a object. + public virtual NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(ResourceIdentifier id) { - NginxDeploymentResource.ValidateResourceId(id); - return new NginxDeploymentResource(Client, id); + NginxDeploymentWafPolicyResource.ValidateResourceId(id); + return new NginxDeploymentWafPolicyResource(Client, id); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxResourceGroupResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxResourceGroupResource.cs index 6b390ed027da..3789ebc4c20b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxResourceGroupResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxResourceGroupResource.cs @@ -8,33 +8,31 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Nginx; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Nginx.Mocking { - /// A class to add extension methods to ResourceGroupResource. + /// A class to add extension methods to . public partial class MockableNginxResourceGroupResource : ArmResource { - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableNginxResourceGroupResource for mocking. protected MockableNginxResourceGroupResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableNginxResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of NginxDeploymentResources in the ResourceGroupResource. - /// An object representing collection of NginxDeploymentResources and their operations over a NginxDeploymentResource. + /// Gets a collection of NginxDeployments in the . + /// An object representing collection of NginxDeployments and their operations over a NginxDeploymentResource. public virtual NginxDeploymentCollection GetNginxDeployments() { return GetCachedClient(client => new NginxDeploymentCollection(client, Id)); @@ -44,20 +42,16 @@ public virtual NginxDeploymentCollection GetNginxDeployments() /// Get the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -68,6 +62,8 @@ public virtual NginxDeploymentCollection GetNginxDeployments() [ForwardsClientCalls] public virtual async Task> GetNginxDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + return await GetNginxDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); } @@ -75,20 +71,16 @@ public virtual async Task> GetNginxDeploymentA /// Get the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -99,6 +91,8 @@ public virtual async Task> GetNginxDeploymentA [ForwardsClientCalls] public virtual Response GetNginxDeployment(string deploymentName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + return GetNginxDeployments().Get(deploymentName, cancellationToken); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxSubscriptionResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxSubscriptionResource.cs index 73fd8ca54df4..4b75bcb6aabb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxSubscriptionResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxSubscriptionResource.cs @@ -5,88 +5,81 @@ #nullable disable +using System; using System.Threading; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Nginx; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Nginx.Mocking { - /// A class to add extension methods to SubscriptionResource. + /// A class to add extension methods to . public partial class MockableNginxSubscriptionResource : ArmResource { - private ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; - private DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; + private ClientDiagnostics _nginxDeploymentsClientDiagnostics; + private NginxDeployments _nginxDeploymentsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableNginxSubscriptionResource for mocking. protected MockableNginxSubscriptionResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableNginxSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private ClientDiagnostics NginxDeploymentDeploymentsClientDiagnostics => _nginxDeploymentDeploymentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); - private DeploymentsRestOperations NginxDeploymentDeploymentsRestClient => _nginxDeploymentDeploymentsRestClient ??= new DeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NginxDeploymentResource.ResourceType)); + private ClientDiagnostics NginxDeploymentsClientDiagnostics => _nginxDeploymentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Nginx.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } + private NginxDeployments NginxDeploymentsRestClient => _nginxDeploymentsRestClient ??= new NginxDeployments(NginxDeploymentsClientDiagnostics, Pipeline, Endpoint, "2025-03-01-preview"); /// /// List the NGINX deployments resources /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// Deployments_List + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_List. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetNginxDeploymentsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => NginxDeploymentDeploymentsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentDeploymentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentDeploymentsClientDiagnostics, Pipeline, "MockableNginxSubscriptionResource.GetNginxDeployments", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new NginxDeploymentsGetAllAsyncCollectionResultOfT(NginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), context), data => new NginxDeploymentResource(Client, data)); } /// /// List the NGINX deployments resources /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// Deployments_List + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_List. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -94,9 +87,11 @@ public virtual AsyncPageable GetNginxDeploymentsAsync(C /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetNginxDeployments(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => NginxDeploymentDeploymentsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentDeploymentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentDeploymentsClientDiagnostics, Pipeline, "MockableNginxSubscriptionResource.GetNginxDeployments", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new NginxDeploymentsGetAllCollectionResultOfT(NginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), context), data => new NginxDeploymentResource(Client, data)); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs index 3eb46d8eeaeb..7fb8946b4b41 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs @@ -8,7 +8,9 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; using Azure.ResourceManager.Nginx.Mocking; using Azure.ResourceManager.Resources; @@ -17,30 +19,32 @@ namespace Azure.ResourceManager.Nginx /// A class to add extension methods to Azure.ResourceManager.Nginx. public static partial class NginxExtensions { + /// private static MockableNginxArmClient GetMockableNginxArmClient(ArmClient client) { - return client.GetCachedClient(client0 => new MockableNginxArmClient(client0)); + return client.GetCachedClient(client0 => new MockableNginxArmClient(client0, ResourceIdentifier.Root)); } - private static MockableNginxResourceGroupResource GetMockableNginxResourceGroupResource(ArmResource resource) + /// + private static MockableNginxResourceGroupResource GetMockableNginxResourceGroupResource(ResourceGroupResource resourceGroupResource) { - return resource.GetCachedClient(client => new MockableNginxResourceGroupResource(client, resource.Id)); + return resourceGroupResource.GetCachedClient(client => new MockableNginxResourceGroupResource(client, resourceGroupResource.Id)); } - private static MockableNginxSubscriptionResource GetMockableNginxSubscriptionResource(ArmResource resource) + /// + private static MockableNginxSubscriptionResource GetMockableNginxSubscriptionResource(SubscriptionResource subscriptionResource) { - return resource.GetCachedClient(client => new MockableNginxSubscriptionResource(client, resource.Id)); + return subscriptionResource.GetCachedClient(client => new MockableNginxSubscriptionResource(client, subscriptionResource.Id)); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -52,14 +56,31 @@ public static NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(thi } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static NginxDeploymentResource GetNginxDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNginxArmClient(client).GetNginxDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// + /// Mocking. + /// To mock this method, please mock instead. + /// + /// + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -71,14 +92,13 @@ public static NginxCertificateResource GetNginxCertificateResource(this ArmClien } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -90,34 +110,33 @@ public static NginxConfigurationResource GetNginxConfigurationResource(this ArmC } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static NginxDeploymentResource GetNginxDeploymentResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableNginxArmClient(client).GetNginxDeploymentResource(id); + return GetMockableNginxArmClient(client).GetNginxDeploymentWafPolicyResource(id); } /// - /// Gets a collection of NginxDeploymentResources in the ResourceGroupResource. + /// Gets a collection of NginxDeployments in the /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// is null. - /// An object representing collection of NginxDeploymentResources and their operations over a NginxDeploymentResource. + /// An object representing collection of NginxDeployments and their operations over a NginxDeploymentResource. public static NginxDeploymentCollection GetNginxDeployments(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); @@ -127,34 +146,15 @@ public static NginxDeploymentCollection GetNginxDeployments(this ResourceGroupRe /// /// Get the NGINX deployment - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static async Task> GetNginxDeploymentAsync(this ResourceGroupResource resourceGroupResource, string deploymentName, CancellationToken cancellationToken = default) { @@ -165,34 +165,15 @@ public static async Task> GetNginxDeploymentAs /// /// Get the NGINX deployment - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static Response GetNginxDeployment(this ResourceGroupResource resourceGroupResource, string deploymentName, CancellationToken cancellationToken = default) { @@ -203,33 +184,15 @@ public static Response GetNginxDeployment(this Resource /// /// List the NGINX deployments resources - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// Deployments_List - /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public static AsyncPageable GetNginxDeploymentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -239,30 +202,12 @@ public static AsyncPageable GetNginxDeploymentsAsync(th /// /// List the NGINX deployments resources - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// Deployments_List - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The cancellation token to use. /// is null. /// A collection of that may take multiple service requests to iterate over. diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Argument.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Argument.cs index 2e01c9970095..a2ed909b5386 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Argument.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Argument.cs @@ -11,8 +11,10 @@ namespace Azure.ResourceManager.Nginx { - internal static class Argument + internal static partial class Argument { + /// The value. + /// The name. public static void AssertNotNull(T value, string name) { if (value is null) @@ -21,8 +23,10 @@ public static void AssertNotNull(T value, string name) } } + /// The value. + /// The name. public static void AssertNotNull(T? value, string name) - where T : struct + where T : struct { if (!value.HasValue) { @@ -30,6 +34,8 @@ public static void AssertNotNull(T? value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(IEnumerable value, string name) { if (value is null) @@ -51,6 +57,8 @@ public static void AssertNotNullOrEmpty(IEnumerable value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(string value, string name) { if (value is null) @@ -62,68 +70,5 @@ public static void AssertNotNullOrEmpty(string value, string name) throw new ArgumentException("Value cannot be an empty string.", name); } } - - public static void AssertNotNullOrWhiteSpace(string value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); - } - } - - public static void AssertNotDefault(ref T value, string name) - where T : struct, IEquatable - { - if (value.Equals(default)) - { - throw new ArgumentException("Value cannot be empty.", name); - } - } - - public static void AssertInRange(T value, T minimum, T maximum, string name) - where T : notnull, IComparable - { - if (minimum.CompareTo(value) > 0) - { - throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); - } - if (maximum.CompareTo(value) < 0) - { - throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); - } - } - - public static void AssertEnumDefined(Type enumType, object value, string name) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); - } - } - - public static T CheckNotNull(T value, string name) - where T : class - { - AssertNotNull(value, name); - return value; - } - - public static string CheckNotNullOrEmpty(string value, string name) - { - AssertNotNullOrEmpty(value, name); - return value; - } - - public static void AssertNull(T value, string name, string message = null) - { - if (value != null) - { - throw new ArgumentException(message ?? "Value must be null.", name); - } - } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/AsyncPageableWrapper.cs new file mode 100644 index 000000000000..624788c45c2a --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/AsyncPageableWrapper.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class AsyncPageableWrapper : AsyncPageable + { + /// The source async pageable value of type AsyncPageable<T>. + private AsyncPageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the AsyncPageableWrapper class. + /// The source async pageable value of type AsyncPageable<T>. + /// The converter function from T to U. + public AsyncPageableWrapper(AsyncPageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from AsyncPageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + await foreach (Page page in _source.AsPages(continuationToken, pageSizeHint).ConfigureAwait(false)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingDictionary.cs index d3b22470b26c..738e06127546 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -11,7 +11,8 @@ namespace Azure.ResourceManager.Nginx { - internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary + where TKey : notnull { private IDictionary _innerDictionary; @@ -19,6 +20,7 @@ public ChangeTrackingDictionary() { } + /// The inner dictionary. public ChangeTrackingDictionary(IDictionary dictionary) { if (dictionary == null) @@ -28,6 +30,7 @@ public ChangeTrackingDictionary(IDictionary dictionary) _innerDictionary = new Dictionary(dictionary); } + /// The inner dictionary. public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) { if (dictionary == null) @@ -41,16 +44,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerDictionary == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + /// Gets the Keys. public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + /// Gets the Values. public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + /// Gets or sets the value associated with the specified key. public TValue this[TKey key] { get @@ -67,8 +76,10 @@ public TValue this[TKey key] } } + /// Gets the Keys. IEnumerable IReadOnlyDictionary.Keys => Keys; + /// Gets the Values. IEnumerable IReadOnlyDictionary.Values => Values; public IEnumerator> GetEnumerator() @@ -89,6 +100,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(KeyValuePair item) { EnsureDictionary().Add(item); @@ -99,6 +111,7 @@ public void Clear() EnsureDictionary().Clear(); } + /// The item to search for. public bool Contains(KeyValuePair item) { if (IsUndefined) @@ -108,6 +121,8 @@ public bool Contains(KeyValuePair item) return EnsureDictionary().Contains(item); } + /// The array to copy. + /// The index. public void CopyTo(KeyValuePair[] array, int index) { if (IsUndefined) @@ -117,6 +132,7 @@ public void CopyTo(KeyValuePair[] array, int index) EnsureDictionary().CopyTo(array, index); } + /// The item to remove. public bool Remove(KeyValuePair item) { if (IsUndefined) @@ -126,11 +142,14 @@ public bool Remove(KeyValuePair item) return EnsureDictionary().Remove(item); } + /// The key. + /// The value to add. public void Add(TKey key, TValue value) { EnsureDictionary().Add(key, value); } + /// The key to search for. public bool ContainsKey(TKey key) { if (IsUndefined) @@ -140,6 +159,7 @@ public bool ContainsKey(TKey key) return EnsureDictionary().ContainsKey(key); } + /// The key. public bool Remove(TKey key) { if (IsUndefined) @@ -149,6 +169,8 @@ public bool Remove(TKey key) return EnsureDictionary().Remove(key); } + /// The key to search for. + /// The value. public bool TryGetValue(TKey key, out TValue value) { if (IsUndefined) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingList.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingList.cs index 89c7aeccc237..3d248123c56f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingList.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ChangeTrackingList.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Nginx { - internal class ChangeTrackingList : IList, IReadOnlyList + internal partial class ChangeTrackingList : IList, IReadOnlyList { private IList _innerList; @@ -20,6 +20,7 @@ public ChangeTrackingList() { } + /// The inner list. public ChangeTrackingList(IList innerList) { if (innerList != null) @@ -28,6 +29,7 @@ public ChangeTrackingList(IList innerList) } } + /// The inner list. public ChangeTrackingList(IReadOnlyList innerList) { if (innerList != null) @@ -36,12 +38,16 @@ public ChangeTrackingList(IReadOnlyList innerList) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerList == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureList().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + /// Gets or sets the value associated with the specified key. public T this[int index] { get @@ -85,6 +91,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(T item) { EnsureList().Add(item); @@ -95,6 +102,7 @@ public void Clear() EnsureList().Clear(); } + /// The item. public bool Contains(T item) { if (IsUndefined) @@ -104,6 +112,8 @@ public bool Contains(T item) return EnsureList().Contains(item); } + /// The array to copy to. + /// The array index. public void CopyTo(T[] array, int arrayIndex) { if (IsUndefined) @@ -113,6 +123,7 @@ public void CopyTo(T[] array, int arrayIndex) EnsureList().CopyTo(array, arrayIndex); } + /// The item. public bool Remove(T item) { if (IsUndefined) @@ -122,6 +133,7 @@ public bool Remove(T item) return EnsureList().Remove(item); } + /// The item. public int IndexOf(T item) { if (IsUndefined) @@ -131,11 +143,14 @@ public int IndexOf(T item) return EnsureList().IndexOf(item); } + /// The inner list. + /// The item. public void Insert(int index, T item) { EnsureList().Insert(index, item); } + /// The inner list. public void RemoveAt(int index) { if (IsUndefined) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ClientPipelineExtensions.cs new file mode 100644 index 000000000000..7b9a9d7fed56 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ClientPipelineExtensions.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Nginx +{ + internal static partial class ClientPipelineExtensions + { + public static async ValueTask ProcessMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse(); + await pipeline.SendAsync(message, userCancellationToken).ConfigureAwait(false); + + if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static Response ProcessMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse(); + pipeline.Send(message, userCancellationToken); + + if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static async ValueTask> ProcessHeadAsBoolMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = await pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + + public static Response ProcessHeadAsBoolMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = pipeline.ProcessMessage(message, context); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..72778edeb7e4 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + /// The original name of the member. + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..dfcabf517497 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + /// The property name which these hooks apply to. + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + /// The property name which these hooks apply to. + /// The serialization name of the property. + public CodeGenSerializationAttribute(string propertyName, string serializationName) + { + PropertyName = propertyName; + SerializationName = serializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string SerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..38d536e69173 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + /// The member to suppress. + /// The types of the parameters of the member. + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..f36b5f513173 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Microsoft.TypeSpec.Generator.Customizations +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + /// The original name of the type. + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ErrorResult.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ErrorResult.cs new file mode 100644 index 000000000000..d8eb3cac0259 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ErrorResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class ErrorResult : Response + { + private readonly Response _response; + private readonly RequestFailedException _exception; + + public ErrorResult(Response response, RequestFailedException exception) + { + _response = response; + _exception = exception; + } + + /// Gets the Value. + public override T Value => throw _exception; + + /// + public override Response GetRawResponse() + { + return _response; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ModelSerializationExtensions.cs index a228b1a2588e..505d142093da 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ModelSerializationExtensions.cs @@ -10,19 +10,18 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using System.Runtime.InteropServices; using System.Text.Json; -using System.Xml; -using Azure.Core; namespace Azure.ResourceManager.Nginx { - internal static class ModelSerializationExtensions + internal static partial class ModelSerializationExtensions { - internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); - internal static readonly ModelReaderWriterOptions WireV3Options = new ModelReaderWriterOptions("W|v3"); - internal static readonly ModelReaderWriterOptions JsonV3Options = new ModelReaderWriterOptions("J|v3"); - internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions + { + MaxDepth = 256 + }; public static object GetObject(this JsonElement element) { @@ -48,14 +47,14 @@ public static object GetObject(this JsonElement element) case JsonValueKind.Null: return null; case JsonValueKind.Object: - var dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var jsonProperty in element.EnumerateObject()) { dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); } return dictionary; case JsonValueKind.Array: - var list = new List(); + List list = new List(); foreach (var item in element.EnumerateArray()) { list.Add(item.GetObject()); @@ -93,7 +92,7 @@ public static char GetChar(this JsonElement element) { if (element.ValueKind == JsonValueKind.String) { - var text = element.GetString(); + string text = element.GetString(); if (text == null || text.Length != 1) { throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); @@ -107,14 +106,14 @@ public static char GetChar(this JsonElement element) } [Conditional("DEBUG")] - public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + public static void ThrowNonNullablePropertyIsNull(this JsonProperty @property) { - throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + throw new JsonException($"A property '{@property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); } public static string GetRequiredString(this JsonElement element) { - var value = element.GetString(); + string value = element.GetString(); if (value == null) { throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); @@ -181,9 +180,6 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, T value, Mode case IJsonModel jsonModel: jsonModel.Write(writer, options ?? WireOptions); break; - case IUtf8JsonSerializable serializable: - serializable.Write(writer); - break; case byte[] bytes: writer.WriteBase64StringValue(bytes); break; @@ -260,150 +256,13 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo writer.WriteObjectValue(value, options); } - internal static bool IsSentinelValue(BinaryData value) - { - ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; - ReadOnlySpan valueSpan = value.ToMemory().Span; - return sentinelSpan.SequenceEqual(valueSpan); - } - - internal static class TypeFormatters + public static BinaryData GetUtf8Bytes(this JsonElement element) { - private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; - public const string DefaultNumberFormat = "G"; - - public static string ToString(bool value) => value ? "true" : "false"; - - public static string ToString(DateTime value, string format) => value.Kind switch - { - DateTimeKind.Utc => ToString((DateTimeOffset)value, format), - _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") - }; - - public static string ToString(DateTimeOffset value, string format) => format switch - { - "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), - "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), - "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "R" => value.ToString("r", CultureInfo.InvariantCulture), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(TimeSpan value, string format) => format switch - { - "P" => XmlConvert.ToString(value), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(byte[] value, string format) => format switch - { - "U" => ToBase64UrlString(value), - "D" => Convert.ToBase64String(value), - _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) - }; - - public static string ToBase64UrlString(byte[] value) - { - int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; - int size = checked(numWholeOrPartialInputBlocks * 4); - char[] output = new char[size]; - - int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); - - int i = 0; - for (; i < numBase64Chars; i++) - { - char ch = output[i]; - if (ch == '+') - { - output[i] = '-'; - } - else - { - if (ch == '/') - { - output[i] = '_'; - } - else - { - if (ch == '=') - { - break; - } - } - } - } - - return new string(output, 0, i); - } - - public static byte[] FromBase64UrlString(string value) - { - int paddingCharsToAdd = (value.Length % 4) switch - { - 0 => 0, - 2 => 2, - 3 => 1, - _ => throw new InvalidOperationException("Malformed input") - }; - char[] output = new char[(value.Length + paddingCharsToAdd)]; - int i = 0; - for (; i < value.Length; i++) - { - char ch = value[i]; - if (ch == '-') - { - output[i] = '+'; - } - else - { - if (ch == '_') - { - output[i] = '/'; - } - else - { - output[i] = ch; - } - } - } - - for (; i < output.Length; i++) - { - output[i] = '='; - } - - return Convert.FromBase64CharArray(output, 0, output.Length); - } - - public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch - { - "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), - _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) - }; - - public static TimeSpan ParseTimeSpan(string value, string format) => format switch - { - "P" => XmlConvert.ToTimeSpan(value), - _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) - }; - - public static string ConvertToString(object value, string format = null) => value switch - { - null => "null", - string s => s, - bool b => ToString(b), - int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), - byte[] b0 when format != null => ToString(b0, format), - IEnumerable s0 => string.Join(",", s0), - DateTimeOffset dateTime when format != null => ToString(dateTime, format), - TimeSpan timeSpan when format != null => ToString(timeSpan, format), - TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), - Guid guid => guid.ToString(), - BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), - _ => value.ToString() - }; +#if NET9_0_OR_GREATER + return new global::System.BinaryData(global::System.Runtime.InteropServices.JsonMarshal.GetRawUtf8Value(element).ToArray()); +#else + return BinaryData.FromString(element.GetRawText()); +#endif } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Optional.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Optional.cs index 83fe9e28c756..4d978dec2212 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Optional.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Optional.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx { - internal static class Optional + internal static partial class Optional { public static bool IsCollectionDefined(IEnumerable collection) { @@ -28,7 +28,7 @@ public static bool IsCollectionDefined(IReadOnlyDictionary(T? value) - where T : struct + where T : struct { return value.HasValue; } @@ -38,14 +38,14 @@ public static bool IsDefined(object value) return value != null; } - public static bool IsDefined(JsonElement value) + public static bool IsDefined(string value) { - return value.ValueKind != JsonValueKind.Undefined; + return value != null; } - public static bool IsDefined(string value) + public static bool IsDefined(JsonElement value) { - return value != null; + return value.ValueKind != JsonValueKind.Undefined; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/PageableWrapper.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/PageableWrapper.cs new file mode 100644 index 000000000000..6a6c3932c4ca --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/PageableWrapper.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class PageableWrapper : Pageable + { + /// The source pageable value of type Pageable<T>. + private Pageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the PageableWrapper class. + /// The source pageable value of type Pageable<T>. + /// The converter function from T to U. + public PageableWrapper(Pageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from Pageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + foreach (Page page in _source.AsPages(continuationToken, pageSizeHint)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RawRequestUriBuilderExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RawRequestUriBuilderExtensions.cs new file mode 100644 index 000000000000..660c652780fa --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RawRequestUriBuilderExtensions.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Nginx +{ + internal static partial class RawRequestUriBuilderExtensions + { + public static void AppendQueryDelimited(this RawRequestUriBuilder builder, string name, IEnumerable value, string delimiter, SerializationFormat format = SerializationFormat.Default, bool escape = true) + { + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + builder.AppendQuery(name, string.Join(delimiter, stringValues), escape); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RequestContextExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RequestContextExtensions.cs new file mode 100644 index 000000000000..9cefb0b660c8 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RequestContextExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Azure; + +namespace Azure.ResourceManager.Nginx +{ + internal static partial class RequestContextExtensions + { + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + public static ValueTuple Parse(this RequestContext context) + { + if (context == null) + { + return (CancellationToken.None, ErrorOptions.Default); + } + return (context.CancellationToken, context.ErrorOptions); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/SerializationFormat.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/SerializationFormat.cs new file mode 100644 index 000000000000..4cd9925192c9 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/SerializationFormat.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Nginx +{ + internal enum SerializationFormat + { + /// The default serialization format. + Default = 0, + /// The RFC1123 date time format. + DateTime_RFC1123 = 1, + /// The RFC3339 date time format. + DateTime_RFC3339 = 2, + /// The RFC7231 date time format. + DateTime_RFC7231 = 3, + /// The ISO8601 date time format. + DateTime_ISO8601 = 4, + /// The Unix date time format. + DateTime_Unix = 5, + /// The ISO8601 date format. + Date_ISO8601 = 6, + /// The ISO8601 duration format. + Duration_ISO8601 = 7, + /// The constant duration format. + Duration_Constant = 8, + /// The seconds duration format. + Duration_Seconds = 9, + /// The seconds duration format with float precision. + Duration_Seconds_Float = 10, + /// The seconds duration format with double precision. + Duration_Seconds_Double = 11, + /// The milliseconds duration format. + Duration_Milliseconds = 12, + /// The milliseconds duration format with float precision. + Duration_Milliseconds_Float = 13, + /// The milliseconds duration format with double precision. + Duration_Milliseconds_Double = 14, + /// The ISO8601 time format. + Time_ISO8601 = 15, + /// The Base64Url bytes format. + Bytes_Base64Url = 16, + /// The Base64 bytes format. + Bytes_Base64 = 17 + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/TypeFormatters.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000000..fd08adceb765 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/TypeFormatters.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Xml; + +namespace Azure.ResourceManager.Nginx +{ + internal static partial class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Generated clients require it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked (value.Length + 2) / 3; + int size = checked (numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ToFormatSpecifier(SerializationFormat format) => format switch + { + SerializationFormat.DateTime_RFC1123 => "R", + SerializationFormat.DateTime_RFC3339 => "O", + SerializationFormat.DateTime_RFC7231 => "R", + SerializationFormat.DateTime_ISO8601 => "O", + SerializationFormat.Date_ISO8601 => "D", + SerializationFormat.DateTime_Unix => "U", + SerializationFormat.Bytes_Base64Url => "U", + SerializationFormat.Bytes_Base64 => "D", + SerializationFormat.Duration_ISO8601 => "P", + SerializationFormat.Duration_Constant => "c", + SerializationFormat.Duration_Seconds => "%s", + SerializationFormat.Duration_Seconds_Float => "s\\.FFF", + SerializationFormat.Duration_Seconds_Double => "s\\.FFFFFF", + SerializationFormat.Time_ISO8601 => "T", + _ => null + }; + + public static string ConvertToString(object value, SerializationFormat format = SerializationFormat.Default) + { + string formatSpecifier = ToFormatSpecifier(format); + + return value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when formatSpecifier != null => ToString(b0, formatSpecifier), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when formatSpecifier != null => ToString(dateTime, formatSpecifier), + TimeSpan timeSpan when format == SerializationFormat.Duration_Seconds => Convert.ToInt32(timeSpan.TotalSeconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan0 when format == SerializationFormat.Duration_Seconds_Float || format == SerializationFormat.Duration_Seconds_Double => timeSpan0.TotalSeconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan1 when format == SerializationFormat.Duration_Milliseconds => Convert.ToInt32(timeSpan1.TotalMilliseconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan2 when format == SerializationFormat.Duration_Milliseconds_Float || format == SerializationFormat.Duration_Milliseconds_Double => timeSpan2.TotalMilliseconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan3 when formatSpecifier != null => ToString(timeSpan3, formatSpecifier), + TimeSpan timeSpan4 => XmlConvert.ToString(timeSpan4), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Utf8JsonRequestContent.cs index 4010b19f613a..51033975691f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Utf8JsonRequestContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.Nginx { - internal class Utf8JsonRequestContent : RequestContent + internal partial class Utf8JsonRequestContent : RequestContent { private readonly MemoryStream _stream; private readonly RequestContent _content; @@ -25,20 +25,26 @@ public Utf8JsonRequestContent() JsonWriter = new Utf8JsonWriter(_stream); } + /// Gets the JsonWriter. public Utf8JsonWriter JsonWriter { get; } + /// The stream containing the data to be written. + /// The cancellation token to use. public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) { await JsonWriter.FlushAsync().ConfigureAwait(false); await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); } + /// The stream containing the data to be written. + /// The cancellation token to use. public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) { JsonWriter.Flush(); _content.WriteTo(stream, cancellationToken); } + /// public override bool TryComputeLength(out long length) { length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperation.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperation.cs index f5040799c5f4..7d21f3a1f229 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperation.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperation.cs @@ -6,18 +6,16 @@ #nullable disable using System; -using System.ClientModel.Primitives; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { -#pragma warning disable SA1649 // File name should match first type name - internal class NginxArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class NginxArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected NginxArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal NginxArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response); @@ -36,12 +37,20 @@ internal NginxArmOperation(Response response, RehydrationToken? rehydrationToken _operationId = GetOperationId(rehydrationToken); } + /// + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. internal NginxArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) { - _nextLinkOperation = nextLinkOperationValue; + _nextLinkOperation = nextLinkOperationImplementation; _operationId = _nextLinkOperation.OperationId; } else @@ -49,48 +58,49 @@ internal NginxArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pip _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "NginxArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "NginxArmOperation", + null, + new SequentialDelayStrategy()); } + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + /// The token to rehydrate a long-running operation. private string GetOperationId(RehydrationToken? rehydrationToken) { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); - using var document = JsonDocument.Parse(data); - var lroDetails = document.RootElement; - return lroDetails.GetProperty("id").GetString(); + return rehydrationToken?.Id; } - /// - public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - /// + /// public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// + /// public override Response GetRawResponse() => _operation.RawResponse; - /// + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - /// + /// public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - /// + /// public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); - /// + /// public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); - /// + /// public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); - /// + /// public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperationOfT.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperationOfT.cs index 84fc1313fea5..7728d753af23 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperationOfT.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxArmOperationOfT.cs @@ -6,18 +6,16 @@ #nullable disable using System; -using System.ClientModel.Primitives; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { -#pragma warning disable SA1649 // File name should match first type name - internal class NginxArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class NginxArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected NginxArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal NginxArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); @@ -36,12 +37,21 @@ internal NginxArmOperation(Response response, RehydrationToken? rehydrationTo _operationId = GetOperationId(rehydrationToken); } + /// + /// The instance of . + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. internal NginxArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) { - _nextLinkOperation = nextLinkOperationValue; + _nextLinkOperation = nextLinkOperationImplementation; _operationId = _nextLinkOperation.OperationId; } else @@ -49,54 +59,55 @@ internal NginxArmOperation(IOperationSource source, ClientDiagnostics clientD _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "NginxArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + NextLinkOperationImplementation.Create(source, nextLinkOperation), + clientDiagnostics, + response, + "NginxArmOperation", + null, + new SequentialDelayStrategy()); } - private string GetOperationId(RehydrationToken? rehydrationToken) - { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); - using var document = JsonDocument.Parse(data); - var lroDetails = document.RootElement; - return lroDetails.GetProperty("id").GetString(); - } - /// + /// Gets the Id. public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - /// - public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - - /// + /// Gets the Value. public override T Value => _operation.Value; - /// + /// Gets the HasValue. public override bool HasValue => _operation.HasValue; - /// + /// Gets the HasCompleted. public override bool HasCompleted => _operation.HasCompleted; - /// + /// The token to rehydrate a long-running operation. + private string GetOperationId(RehydrationToken? rehydrationToken) + { + return rehydrationToken?.Id; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// public override Response GetRawResponse() => _operation.RawResponse; - /// + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - /// + /// public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - /// + /// public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); - /// + /// public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); - /// + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - /// + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxCertificateOperationSource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxCertificateOperationSource.cs index 87300aacf2a0..3659c57a5819 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxCertificateOperationSource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxCertificateOperationSource.cs @@ -5,32 +5,45 @@ #nullable disable -using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { - internal class NginxCertificateOperationSource : IOperationSource + /// + internal partial class NginxCertificateOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal NginxCertificateOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// NginxCertificateResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + NginxCertificateData data = NginxCertificateData.DeserializeNginxCertificateData(document.RootElement, ModelSerializationExtensions.WireOptions); return new NginxCertificateResource(_client, data); } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); - return await Task.FromResult(new NginxCertificateResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + NginxCertificateData data = NginxCertificateData.DeserializeNginxCertificateData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new NginxCertificateResource(_client, data); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxConfigurationOperationSource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxConfigurationOperationSource.cs index b05806e0ef1b..9c664f2123b6 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxConfigurationOperationSource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxConfigurationOperationSource.cs @@ -5,32 +5,45 @@ #nullable disable -using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { - internal class NginxConfigurationOperationSource : IOperationSource + /// + internal partial class NginxConfigurationOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal NginxConfigurationOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// NginxConfigurationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + NginxConfigurationData data = NginxConfigurationData.DeserializeNginxConfigurationData(document.RootElement, ModelSerializationExtensions.WireOptions); return new NginxConfigurationResource(_client, data); } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); - return await Task.FromResult(new NginxConfigurationResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + NginxConfigurationData data = NginxConfigurationData.DeserializeNginxConfigurationData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new NginxConfigurationResource(_client, data); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentOperationSource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentOperationSource.cs index 2f37dc21923c..e9c8ca04d8ab 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentOperationSource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentOperationSource.cs @@ -5,32 +5,45 @@ #nullable disable -using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { - internal class NginxDeploymentOperationSource : IOperationSource + /// + internal partial class NginxDeploymentOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal NginxDeploymentOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// NginxDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + NginxDeploymentData data = NginxDeploymentData.DeserializeNginxDeploymentData(document.RootElement, ModelSerializationExtensions.WireOptions); return new NginxDeploymentResource(_client, data); } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); - return await Task.FromResult(new NginxDeploymentResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + NginxDeploymentData data = NginxDeploymentData.DeserializeNginxDeploymentData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new NginxDeploymentResource(_client, data); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.cs new file mode 100644 index 000000000000..730842b5a80e --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Nginx +{ + /// + internal partial class NginxDeploymentWafPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + /// + /// + internal NginxDeploymentWafPolicyOperationSource(ArmClient client) + { + _client = client; + } + + /// The response from the service. + /// The cancellation token to use. + /// + NginxDeploymentWafPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + NginxDeploymentWafPolicyData data = NginxDeploymentWafPolicyData.DeserializeNginxDeploymentWafPolicyData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new NginxDeploymentWafPolicyResource(_client, data); + } + + /// The response from the service. + /// The cancellation token to use. + /// + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + NginxDeploymentWafPolicyData data = NginxDeploymentWafPolicyData.DeserializeNginxDeploymentWafPolicyData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new NginxDeploymentWafPolicyResource(_client, data); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.Serialization.cs index a61facccc028..344051b4a33c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class AutoUpgradeProfile : IUtf8JsonSerializable, IJsonModel + /// Autoupgrade settings of a deployment. + internal partial class AutoUpgradeProfile : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal AutoUpgradeProfile() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +34,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AutoUpgradeProfile)} does not support writing '{format}' format."); } - writer.WritePropertyName("upgradeChannel"u8); writer.WriteStringValue(UpgradeChannel); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +58,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AutoUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + AutoUpgradeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual AutoUpgradeProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(AutoUpgradeProfile)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeAutoUpgradeProfile(document.RootElement, options); } - internal static AutoUpgradeProfile DeserializeAutoUpgradeProfile(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static AutoUpgradeProfile DeserializeAutoUpgradeProfile(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string upgradeChannel = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("upgradeChannel"u8)) + if (prop.NameEquals("upgradeChannel"u8)) { - upgradeChannel = property.Value.GetString(); + upgradeChannel = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new AutoUpgradeProfile(upgradeChannel, serializedAdditionalRawData); + return new AutoUpgradeProfile(upgradeChannel, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +116,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - AutoUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + AutoUpgradeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual AutoUpgradeProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeAutoUpgradeProfile(document.RootElement, options); } default: @@ -121,6 +137,7 @@ AutoUpgradeProfile IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.cs index 2c8146f76ac2..bc308f62668c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AutoUpgradeProfile.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// Autoupgrade settings of a deployment. internal partial class AutoUpgradeProfile { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Channel used for autoupgrade. @@ -57,16 +29,11 @@ public AutoUpgradeProfile(string upgradeChannel) /// Initializes a new instance of . /// Channel used for autoupgrade. - /// Keeps track of any properties unknown to the library. - internal AutoUpgradeProfile(string upgradeChannel, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeProfile(string upgradeChannel, IDictionary additionalBinaryDataProperties) { UpgradeChannel = upgradeChannel; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal AutoUpgradeProfile() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Channel used for autoupgrade. diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs index b48014607a99..8c3a0bdee4d5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs @@ -6,15 +6,15 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.Models; using Azure.ResourceManager.Nginx.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Nginx { /// /// Context class which will be filled in by the System.ClientModel.SourceGeneration. - /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// For more information /// [ModelReaderWriterBuildable(typeof(AutoUpgradeProfile))] [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] @@ -28,6 +28,7 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxCertificateListResponse))] [ModelReaderWriterBuildable(typeof(NginxCertificateProperties))] [ModelReaderWriterBuildable(typeof(NginxCertificateResource))] + [ModelReaderWriterBuildable(typeof(NginxConfigurationContentProtectedFile))] [ModelReaderWriterBuildable(typeof(NginxConfigurationCreateOrUpdateContent))] [ModelReaderWriterBuildable(typeof(NginxConfigurationCreateOrUpdateProperties))] [ModelReaderWriterBuildable(typeof(NginxConfigurationData))] @@ -35,8 +36,6 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxConfigurationListResponse))] [ModelReaderWriterBuildable(typeof(NginxConfigurationPackage))] [ModelReaderWriterBuildable(typeof(NginxConfigurationProperties))] - [ModelReaderWriterBuildable(typeof(NginxConfigurationProtectedFileContent))] - [ModelReaderWriterBuildable(typeof(NginxConfigurationProtectedFileResult))] [ModelReaderWriterBuildable(typeof(NginxConfigurationResource))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyCreateOrUpdateContent))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyData))] @@ -44,7 +43,10 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyRequestProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyResource))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentAutoScaleSettings))] [ModelReaderWriterBuildable(typeof(NginxDeploymentData))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentDefaultWafPolicyListResult))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentDefaultWafPolicyProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentListResponse))] [ModelReaderWriterBuildable(typeof(NginxDeploymentPatch))] [ModelReaderWriterBuildable(typeof(NginxDeploymentProperties))] @@ -54,6 +56,14 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxDeploymentUpdateProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentUpdatePropertiesNginxAppProtect))] [ModelReaderWriterBuildable(typeof(NginxDeploymentUserProfile))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyApplyingStatus))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyCompilingStatus))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyData))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyListResponse))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyMetadata))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyMetadataProperties))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyProperties))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyResource))] [ModelReaderWriterBuildable(typeof(NginxDiagnosticItem))] [ModelReaderWriterBuildable(typeof(NginxFrontendIPConfiguration))] [ModelReaderWriterBuildable(typeof(NginxLogging))] @@ -71,7 +81,6 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(WebApplicationFirewallPackage))] [ModelReaderWriterBuildable(typeof(WebApplicationFirewallSettings))] [ModelReaderWriterBuildable(typeof(WebApplicationFirewallStatus))] - [ModelReaderWriterBuildable(typeof(WritableSubResource))] public partial class AzureResourceManagerNginxContext : ModelReaderWriterContext { } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.Serialization.cs index 447def524ed5..7db34f1334da 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxAnalysisConfig : IUtf8JsonSerializable, IJsonModel + /// The NginxAnalysisConfig. + public partial class NginxAnalysisConfig : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisConfig)} does not support writing '{format}' format."); } - if (Optional.IsDefined(RootFile)) { writer.WritePropertyName("rootFile"u8); @@ -43,7 +43,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("files"u8); writer.WriteStartArray(); - foreach (var item in Files) + foreach (NginxConfigurationFile item in Files) { writer.WriteObjectValue(item, options); } @@ -53,7 +53,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("protectedFiles"u8); writer.WriteStartArray(); - foreach (var item in ProtectedFiles) + foreach (NginxConfigurationContentProtectedFile item in ProtectedFiles) { writer.WriteObjectValue(item, options); } @@ -64,15 +64,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("package"u8); writer.WriteObjectValue(Package, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -81,89 +81,95 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxAnalysisConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxAnalysisConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxAnalysisConfig JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisConfig)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxAnalysisConfig(document.RootElement, options); } - internal static NginxAnalysisConfig DeserializeNginxAnalysisConfig(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxAnalysisConfig DeserializeNginxAnalysisConfig(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string rootFile = default; IList files = default; - IList protectedFiles = default; + IList protectedFiles = default; NginxConfigurationPackage package = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("rootFile"u8)) + if (prop.NameEquals("rootFile"u8)) { - rootFile = property.Value.GetString(); + rootFile = prop.Value.GetString(); continue; } - if (property.NameEquals("files"u8)) + if (prop.NameEquals("files"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxConfigurationFile.DeserializeNginxConfigurationFile(item, options)); } files = array; continue; } - if (property.NameEquals("protectedFiles"u8)) + if (prop.NameEquals("protectedFiles"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(NginxConfigurationProtectedFileContent.DeserializeNginxConfigurationProtectedFileContent(item, options)); + array.Add(NginxConfigurationContentProtectedFile.DeserializeNginxConfigurationContentProtectedFile(item, options)); } protectedFiles = array; continue; } - if (property.NameEquals("package"u8)) + if (prop.NameEquals("package"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - package = NginxConfigurationPackage.DeserializeNginxConfigurationPackage(property.Value, options); + package = NginxConfigurationPackage.DeserializeNginxConfigurationPackage(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxAnalysisConfig(rootFile, files ?? new ChangeTrackingList(), protectedFiles ?? new ChangeTrackingList(), package, serializedAdditionalRawData); + return new NginxAnalysisConfig(rootFile, files ?? new ChangeTrackingList(), protectedFiles ?? new ChangeTrackingList(), package, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -173,15 +179,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - NginxAnalysisConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxAnalysisConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxAnalysisConfig PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxAnalysisConfig(document.RootElement, options); } default: @@ -189,6 +200,7 @@ NginxAnalysisConfig IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.cs index c9d1d680d4df..d66b89057610 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.cs @@ -7,73 +7,48 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// The NginxAnalysisConfig. public partial class NginxAnalysisConfig { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxAnalysisConfig() { Files = new ChangeTrackingList(); - ProtectedFiles = new ChangeTrackingList(); + ProtectedFiles = new ChangeTrackingList(); } /// Initializes a new instance of . /// The root file of the NGINX config file(s). It must match one of the files' filepath. /// /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxAnalysisConfig(string rootFile, IList files, IList protectedFiles, NginxConfigurationPackage package, IDictionary serializedAdditionalRawData) + /// Nginx Configuration Package. + /// Keeps track of any properties unknown to the library. + internal NginxAnalysisConfig(string rootFile, IList files, IList protectedFiles, NginxConfigurationPackage package, IDictionary additionalBinaryDataProperties) { RootFile = rootFile; Files = files; ProtectedFiles = protectedFiles; Package = package; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The root file of the NGINX config file(s). It must match one of the files' filepath. public string RootFile { get; set; } - /// Gets the files. + + /// Gets the Files. public IList Files { get; } - /// Gets the protected files. - public IList ProtectedFiles { get; } - /// Gets or sets the package. + + /// Gets the ProtectedFiles. + public IList ProtectedFiles { get; } + + /// Nginx Configuration Package. public NginxConfigurationPackage Package { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.Serialization.cs index 7c64cf698102..2622075f33f3 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxAnalysisContent : IUtf8JsonSerializable, IJsonModel + /// The request body for creating an analysis for an NGINX configuration. + public partial class NginxAnalysisContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxAnalysisContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +35,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisContent)} does not support writing '{format}' format."); } - writer.WritePropertyName("config"u8); writer.WriteObjectValue(Config, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +59,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxAnalysisContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxAnalysisContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxAnalysisContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxAnalysisContent(document.RootElement, options); } - internal static NginxAnalysisContent DeserializeNginxAnalysisContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxAnalysisContent DeserializeNginxAnalysisContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } NginxAnalysisConfig config = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("config"u8)) + if (prop.NameEquals("config"u8)) { - config = NginxAnalysisConfig.DeserializeNginxAnalysisConfig(property.Value, options); + config = NginxAnalysisConfig.DeserializeNginxAnalysisConfig(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxAnalysisContent(config, serializedAdditionalRawData); + return new NginxAnalysisContent(config, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +117,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - NginxAnalysisContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxAnalysisContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxAnalysisContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxAnalysisContent(document.RootElement, options); } default: @@ -121,6 +138,19 @@ NginxAnalysisContent IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxAnalysisContent nginxAnalysisContent) + { + if (nginxAnalysisContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxAnalysisContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.cs index 08bcd04c1d72..44da7e3f6937 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisContent.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// The request body for creating an analysis for an NGINX configuration. public partial class NginxAnalysisContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// @@ -57,19 +29,14 @@ public NginxAnalysisContent(NginxAnalysisConfig config) /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. - internal NginxAnalysisContent(NginxAnalysisConfig config, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxAnalysisContent(NginxAnalysisConfig config, IDictionary additionalBinaryDataProperties) { Config = config; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Initializes a new instance of for deserialization. - internal NginxAnalysisContent() - { - } - - /// Gets the config. + /// Gets the Config. public NginxAnalysisConfig Config { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.Serialization.cs index 4383ee27e26c..52c32c3451e6 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxAnalysisDiagnostic : IUtf8JsonSerializable, IJsonModel + /// An error object found during the analysis of an NGINX configuration. + public partial class NginxAnalysisDiagnostic : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxAnalysisDiagnostic() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisDiagnostic)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -51,15 +56,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(Message); writer.WritePropertyName("rule"u8); writer.WriteStringValue(Rule); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -68,22 +73,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxAnalysisDiagnostic IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxAnalysisDiagnostic IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxAnalysisDiagnostic JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisDiagnostic)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxAnalysisDiagnostic(document.RootElement, options); } - internal static NginxAnalysisDiagnostic DeserializeNginxAnalysisDiagnostic(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxAnalysisDiagnostic DeserializeNginxAnalysisDiagnostic(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -91,70 +101,71 @@ internal static NginxAnalysisDiagnostic DeserializeNginxAnalysisDiagnostic(JsonE string id = default; string directive = default; string description = default; - string file = default; + string @file = default; float line = default; string message = default; string rule = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("directive"u8)) + if (prop.NameEquals("directive"u8)) { - directive = property.Value.GetString(); + directive = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("file"u8)) + if (prop.NameEquals("file"u8)) { - file = property.Value.GetString(); + @file = prop.Value.GetString(); continue; } - if (property.NameEquals("line"u8)) + if (prop.NameEquals("line"u8)) { - line = property.Value.GetSingle(); + line = prop.Value.GetSingle(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } - if (property.NameEquals("rule"u8)) + if (prop.NameEquals("rule"u8)) { - rule = property.Value.GetString(); + rule = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxAnalysisDiagnostic( id, directive, description, - file, + @file, line, message, rule, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -164,15 +175,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt } } - NginxAnalysisDiagnostic IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxAnalysisDiagnostic IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxAnalysisDiagnostic PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxAnalysisDiagnostic(document.RootElement, options); } default: @@ -180,6 +196,7 @@ NginxAnalysisDiagnostic IPersistableModel.Create(Binary } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.cs index 8dc8808ebe85..e84d4b19aaf5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisDiagnostic.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// An error object found during the analysis of an NGINX configuration. public partial class NginxAnalysisDiagnostic { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// @@ -52,18 +23,11 @@ public partial class NginxAnalysisDiagnostic /// /// /// - /// , , , or is null. - internal NginxAnalysisDiagnostic(string directive, string description, string file, float line, string message, string rule) + internal NginxAnalysisDiagnostic(string directive, string description, string @file, float line, string message, string rule) { - Argument.AssertNotNull(directive, nameof(directive)); - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(file, nameof(file)); - Argument.AssertNotNull(message, nameof(message)); - Argument.AssertNotNull(rule, nameof(rule)); - Directive = directive; Description = description; - File = file; + File = @file; Line = line; Message = message; Rule = rule; @@ -77,37 +41,38 @@ internal NginxAnalysisDiagnostic(string directive, string description, string fi /// /// /// - /// Keeps track of any properties unknown to the library. - internal NginxAnalysisDiagnostic(string id, string directive, string description, string file, float line, string message, string rule, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxAnalysisDiagnostic(string id, string directive, string description, string @file, float line, string message, string rule, IDictionary additionalBinaryDataProperties) { Id = id; Directive = directive; Description = description; - File = file; + File = @file; Line = line; Message = message; Rule = rule; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxAnalysisDiagnostic() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique identifier for the error. public string Id { get; } - /// Gets the directive. + + /// Gets the Directive. public string Directive { get; } - /// Gets the description. + + /// Gets the Description. public string Description { get; } + /// the filepath of the most relevant config file. public string File { get; } - /// Gets the line. + + /// Gets the Line. public float Line { get; } - /// Gets the message. + + /// Gets the Message. public string Message { get; } - /// Gets the rule. + + /// Gets the Rule. public string Rule { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.Serialization.cs index 6640960e2747..4af39d85224a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxAnalysisResult : IUtf8JsonSerializable, IJsonModel + /// The response body for an analysis request. Contains the status of the analysis and any errors. + public partial class NginxAnalysisResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxAnalysisResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("status"u8); writer.WriteStringValue(Status); if (Optional.IsDefined(Data)) @@ -41,15 +47,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("data"u8); writer.WriteObjectValue(Data, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,59 +64,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxAnalysisResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxAnalysisResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxAnalysisResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxAnalysisResult(document.RootElement, options); } - internal static NginxAnalysisResult DeserializeNginxAnalysisResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxAnalysisResult DeserializeNginxAnalysisResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string status = default; NginxAnalysisResultDetails data = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - status = property.Value.GetString(); + status = prop.Value.GetString(); continue; } - if (property.NameEquals("data"u8)) + if (prop.NameEquals("data"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - data = NginxAnalysisResultDetails.DeserializeNginxAnalysisResultDetails(property.Value, options); + data = NginxAnalysisResultDetails.DeserializeNginxAnalysisResultDetails(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxAnalysisResult(status, data, serializedAdditionalRawData); + return new NginxAnalysisResult(status, data, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -120,15 +132,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - NginxAnalysisResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxAnalysisResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxAnalysisResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxAnalysisResult(document.RootElement, options); } default: @@ -136,6 +153,14 @@ NginxAnalysisResult IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxAnalysisResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxAnalysisResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.cs index f815b9f124b9..ee5da0a555e5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResult.cs @@ -13,67 +13,31 @@ namespace Azure.ResourceManager.Nginx.Models /// The response body for an analysis request. Contains the status of the analysis and any errors. public partial class NginxAnalysisResult { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The status of the analysis. - /// is null. internal NginxAnalysisResult(string status) { - Argument.AssertNotNull(status, nameof(status)); - Status = status; } /// Initializes a new instance of . /// The status of the analysis. /// - /// Keeps track of any properties unknown to the library. - internal NginxAnalysisResult(string status, NginxAnalysisResultDetails data, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxAnalysisResult(string status, NginxAnalysisResultDetails data, IDictionary additionalBinaryDataProperties) { Status = status; Data = data; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxAnalysisResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The status of the analysis. public string Status { get; } - /// Gets the data. + + /// Gets the Data. public NginxAnalysisResultDetails Data { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.Serialization.cs index 72aefb131f84..a8a916e3355c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxAnalysisResultDetails : IUtf8JsonSerializable, IJsonModel + /// The NginxAnalysisResultDetails. + public partial class NginxAnalysisResultDetails : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,17 +29,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisResultDetails)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Errors)) { writer.WritePropertyName("errors"u8); writer.WriteStartArray(); - foreach (var item in Errors) + foreach (NginxAnalysisDiagnostic item in Errors) { writer.WriteObjectValue(item, options); } @@ -48,21 +48,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("diagnostics"u8); writer.WriteStartArray(); - foreach (var item in Diagnostics) + foreach (NginxDiagnosticItem item in Diagnostics) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -71,54 +71,58 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxAnalysisResultDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxAnalysisResultDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxAnalysisResultDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxAnalysisResultDetails)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxAnalysisResultDetails(document.RootElement, options); } - internal static NginxAnalysisResultDetails DeserializeNginxAnalysisResultDetails(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxAnalysisResultDetails DeserializeNginxAnalysisResultDetails(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList errors = default; - IReadOnlyList diagnostics = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList errors = default; + IList diagnostics = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("errors"u8)) + if (prop.NameEquals("errors"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxAnalysisDiagnostic.DeserializeNginxAnalysisDiagnostic(item, options)); } errors = array; continue; } - if (property.NameEquals("diagnostics"u8)) + if (prop.NameEquals("diagnostics"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxDiagnosticItem.DeserializeNginxDiagnosticItem(item, options)); } @@ -127,17 +131,19 @@ internal static NginxAnalysisResultDetails DeserializeNginxAnalysisResultDetails } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxAnalysisResultDetails(errors ?? new ChangeTrackingList(), diagnostics ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NginxAnalysisResultDetails(errors ?? new ChangeTrackingList(), diagnostics ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -147,15 +153,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - NginxAnalysisResultDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxAnalysisResultDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxAnalysisResultDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxAnalysisResultDetails(document.RootElement, options); } default: @@ -163,6 +174,7 @@ NginxAnalysisResultDetails IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.cs index ed91f301d19e..3f89d95c9be2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisResultDetails.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// The NginxAnalysisResultDetails. public partial class NginxAnalysisResultDetails { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal NginxAnalysisResultDetails() @@ -55,17 +27,18 @@ internal NginxAnalysisResultDetails() /// Initializes a new instance of . /// /// - /// Keeps track of any properties unknown to the library. - internal NginxAnalysisResultDetails(IReadOnlyList errors, IReadOnlyList diagnostics, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxAnalysisResultDetails(IList errors, IList diagnostics, IDictionary additionalBinaryDataProperties) { Errors = errors; Diagnostics = diagnostics; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the errors. - public IReadOnlyList Errors { get; } - /// Gets the diagnostics. - public IReadOnlyList Diagnostics { get; } + /// Gets the Errors. + public IList Errors { get; } + + /// Gets the Diagnostics. + public IList Diagnostics { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.Serialization.cs index 14be67f8d887..b4c2c762f97d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxCertificateError : IUtf8JsonSerializable, IJsonModel + /// Nginx Certificate Error Response Body. + public partial class NginxCertificateError : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateError)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxCertificateError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxCertificateError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxCertificateError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateError)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxCertificateError(document.RootElement, options); } - internal static NginxCertificateError DeserializeNginxCertificateError(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxCertificateError DeserializeNginxCertificateError(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string code = default; string message = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("code"u8)) + if (prop.NameEquals("code"u8)) { - code = property.Value.GetString(); + code = prop.Value.GetString(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxCertificateError(code, message, serializedAdditionalRawData); + return new NginxCertificateError(code, message, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +125,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - NginxCertificateError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxCertificateError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxCertificateError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxCertificateError(document.RootElement, options); } default: @@ -135,6 +146,7 @@ NginxCertificateError IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs index 35135bce9d78..c1662cb5e73f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxCertificateError. + /// Nginx Certificate Error Response Body. public partial class NginxCertificateError { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxCertificateError() @@ -53,17 +24,18 @@ public NginxCertificateError() /// Initializes a new instance of . /// /// - /// Keeps track of any properties unknown to the library. - internal NginxCertificateError(string code, string message, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxCertificateError(string code, string message, IDictionary additionalBinaryDataProperties) { Code = code; Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the code. + /// Gets or sets the Code. public string Code { get; set; } - /// Gets or sets the message. + + /// Gets or sets the Message. public string Message { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.Serialization.cs index 94097c776d54..7f754ea533ba 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxCertificateListResponse : IUtf8JsonSerializable, IJsonModel + /// Nginx Certificate List Response. + internal partial class NginxCertificateListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxCertificateListResponse() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,36 +35,32 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateListResponse)} does not support writing '{format}' format."); } - - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (NginxCertificateData item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxCertificateListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxCertificateListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxCertificateListResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxCertificateListResponse(document.RootElement, options); } - internal static NginxCertificateListResponse DeserializeNginxCertificateListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxCertificateListResponse DeserializeNginxCertificateListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxCertificateData.DeserializeNginxCertificateData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxCertificateListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxCertificateListResponse(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - NginxCertificateListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxCertificateListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxCertificateListResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxCertificateListResponse(document.RootElement, options); } default: @@ -149,6 +163,14 @@ NginxCertificateListResponse IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxCertificateListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxCertificateListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs index 7be73588ce90..3bf783736aca 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs @@ -7,64 +7,39 @@ using System; using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxCertificateListResponse. + /// Nginx Certificate List Response. internal partial class NginxCertificateListResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal NginxCertificateListResponse() + /// The NginxCertificate items on this page. + internal NginxCertificateListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxCertificateListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + /// The NginxCertificate items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NginxCertificateListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the value. - public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { get; } + /// The NginxCertificate items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.Serialization.cs index d77c51c047dd..7c44950dfa72 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxCertificateProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Certificate Properties. + public partial class NginxCertificateProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -74,15 +74,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("certificateError"u8); writer.WriteObjectValue(CertificateError, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -91,22 +91,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxCertificateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxCertificateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxCertificateProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxCertificateProperties(document.RootElement, options); } - internal static NginxCertificateProperties DeserializeNginxCertificateProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxCertificateProperties DeserializeNginxCertificateProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -119,68 +124,66 @@ internal static NginxCertificateProperties DeserializeNginxCertificateProperties string keyVaultSecretVersion = default; DateTimeOffset? keyVaultSecretCreated = default; NginxCertificateError certificateError = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new NginxProvisioningState(property.Value.GetString()); + provisioningState = new NginxProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("keyVirtualPath"u8)) + if (prop.NameEquals("keyVirtualPath"u8)) { - keyVirtualPath = property.Value.GetString(); + keyVirtualPath = prop.Value.GetString(); continue; } - if (property.NameEquals("certificateVirtualPath"u8)) + if (prop.NameEquals("certificateVirtualPath"u8)) { - certificateVirtualPath = property.Value.GetString(); + certificateVirtualPath = prop.Value.GetString(); continue; } - if (property.NameEquals("keyVaultSecretId"u8)) + if (prop.NameEquals("keyVaultSecretId"u8)) { - keyVaultSecretId = property.Value.GetString(); + keyVaultSecretId = prop.Value.GetString(); continue; } - if (property.NameEquals("sha1Thumbprint"u8)) + if (prop.NameEquals("sha1Thumbprint"u8)) { - sha1Thumbprint = property.Value.GetString(); + sha1Thumbprint = prop.Value.GetString(); continue; } - if (property.NameEquals("keyVaultSecretVersion"u8)) + if (prop.NameEquals("keyVaultSecretVersion"u8)) { - keyVaultSecretVersion = property.Value.GetString(); + keyVaultSecretVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("keyVaultSecretCreated"u8)) + if (prop.NameEquals("keyVaultSecretCreated"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - keyVaultSecretCreated = property.Value.GetDateTimeOffset("O"); + keyVaultSecretCreated = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("certificateError"u8)) + if (prop.NameEquals("certificateError"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - certificateError = NginxCertificateError.DeserializeNginxCertificateError(property.Value, options); + certificateError = NginxCertificateError.DeserializeNginxCertificateError(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxCertificateProperties( provisioningState, keyVirtualPath, @@ -190,13 +193,16 @@ internal static NginxCertificateProperties DeserializeNginxCertificateProperties keyVaultSecretVersion, keyVaultSecretCreated, certificateError, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -206,15 +212,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - NginxCertificateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxCertificateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxCertificateProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxCertificateProperties(document.RootElement, options); } default: @@ -222,6 +233,7 @@ NginxCertificateProperties IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs index f0c35cbf52d2..694fa4e98f3b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxCertificateProperties. + /// Nginx Certificate Properties. public partial class NginxCertificateProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxCertificateProperties() @@ -51,16 +22,16 @@ public NginxCertificateProperties() } /// Initializes a new instance of . - /// + /// Provisioning State. /// /// /// /// /// /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxCertificateProperties(NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId, string sha1Thumbprint, string keyVaultSecretVersion, DateTimeOffset? keyVaultSecretCreated, NginxCertificateError certificateError, IDictionary serializedAdditionalRawData) + /// Nginx Certificate Error Response Body. + /// Keeps track of any properties unknown to the library. + internal NginxCertificateProperties(NginxProvisioningState? provisioningState, string keyVirtualPath, string certificateVirtualPath, string keyVaultSecretId, string sha1Thumbprint, string keyVaultSecretVersion, DateTimeOffset? keyVaultSecretCreated, NginxCertificateError certificateError, IDictionary additionalBinaryDataProperties) { ProvisioningState = provisioningState; KeyVirtualPath = keyVirtualPath; @@ -70,24 +41,31 @@ internal NginxCertificateProperties(NginxProvisioningState? provisioningState, s KeyVaultSecretVersion = keyVaultSecretVersion; KeyVaultSecretCreated = keyVaultSecretCreated; CertificateError = certificateError; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// Gets or sets the key virtual path. + + /// Gets or sets the KeyVirtualPath. public string KeyVirtualPath { get; set; } - /// Gets or sets the certificate virtual path. + + /// Gets or sets the CertificateVirtualPath. public string CertificateVirtualPath { get; set; } - /// Gets or sets the key vault secret id. + + /// Gets or sets the KeyVaultSecretId. public string KeyVaultSecretId { get; set; } - /// Gets the sha 1 thumbprint. + + /// Gets the Sha1Thumbprint. public string Sha1Thumbprint { get; } - /// Gets the key vault secret version. + + /// Gets the KeyVaultSecretVersion. public string KeyVaultSecretVersion { get; } - /// Gets the key vault secret created. + + /// Gets the KeyVaultSecretCreated. public DateTimeOffset? KeyVaultSecretCreated { get; } - /// Gets or sets the certificate error. + + /// Nginx Certificate Error Response Body. public NginxCertificateError CertificateError { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.Serialization.cs new file mode 100644 index 000000000000..f27b90769a11 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Configuration Protected File Request. + public partial class NginxConfigurationContentProtectedFile : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxConfigurationContentProtectedFile)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (Optional.IsDefined(VirtualPath)) + { + writer.WritePropertyName("virtualPath"u8); + writer.WriteStringValue(VirtualPath); + } + if (Optional.IsDefined(ContentHash)) + { + writer.WritePropertyName("contentHash"u8); + writer.WriteStringValue(ContentHash); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationContentProtectedFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationContentProtectedFile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxConfigurationContentProtectedFile)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxConfigurationContentProtectedFile(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationContentProtectedFile DeserializeNginxConfigurationContentProtectedFile(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string content = default; + string virtualPath = default; + string contentHash = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("content"u8)) + { + content = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("virtualPath"u8)) + { + virtualPath = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("contentHash"u8)) + { + contentHash = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxConfigurationContentProtectedFile(content, virtualPath, contentHash, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxConfigurationContentProtectedFile)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationContentProtectedFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationContentProtectedFile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxConfigurationContentProtectedFile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxConfigurationContentProtectedFile)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.cs new file mode 100644 index 000000000000..f800129c8d0a --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Configuration Protected File Request. + public partial class NginxConfigurationContentProtectedFile + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public NginxConfigurationContentProtectedFile() + { + } + + /// Initializes a new instance of . + /// The content of the protected file. This value is a PUT only value. If you perform a GET request on this value, it will be empty because it is a protected file. + /// The virtual path of the protected file. + /// The hash of the content of the file. This value is used to determine if the file has changed. + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationContentProtectedFile(string content, string virtualPath, string contentHash, IDictionary additionalBinaryDataProperties) + { + Content = content; + VirtualPath = virtualPath; + ContentHash = contentHash; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The content of the protected file. This value is a PUT only value. If you perform a GET request on this value, it will be empty because it is a protected file. + public string Content { get; set; } + + /// The virtual path of the protected file. + public string VirtualPath { get; set; } + + /// The hash of the content of the file. This value is used to determine if the file has changed. + public string ContentHash { get; set; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.Serialization.cs index bba44cb793f2..292d42d267eb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.Serialization.cs @@ -12,13 +12,15 @@ using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxConfigurationCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel + /// Nginx Configuration Request. + public partial class NginxConfigurationCreateOrUpdateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,103 +30,142 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationCreateOrUpdateContent)} does not support writing '{format}' format."); } - - base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + ((IJsonModel)SystemData).Write(writer, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - NginxConfigurationCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationCreateOrUpdateContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationCreateOrUpdateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationCreateOrUpdateContent(document.RootElement, options); } - internal static NginxConfigurationCreateOrUpdateContent DeserializeNginxConfigurationCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationCreateOrUpdateContent DeserializeNginxConfigurationCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxConfigurationCreateOrUpdateProperties properties = default; - ResourceIdentifier id = default; + string id = default; string name = default; - ResourceType type = default; + string resourceType = default; + NginxConfigurationCreateOrUpdateProperties properties = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = NginxConfigurationCreateOrUpdateProperties.DeserializeNginxConfigurationCreateOrUpdateProperties(property.Value, options); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + resourceType = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("properties"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxConfigurationCreateOrUpdateProperties.DeserializeNginxConfigurationCreateOrUpdateProperties(prop.Value, options); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("systemData"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxConfigurationCreateOrUpdateContent( id, name, - type, - systemData, + resourceType, properties, - serializedAdditionalRawData); + systemData, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +175,20 @@ BinaryData IPersistableModel.Write(Mode } } - NginxConfigurationCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationCreateOrUpdateContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationCreateOrUpdateContent(document.RootElement, options); } default: @@ -150,6 +196,19 @@ NginxConfigurationCreateOrUpdateContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxConfigurationCreateOrUpdateContent nginxConfigurationCreateOrUpdateContent) + { + if (nginxConfigurationCreateOrUpdateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxConfigurationCreateOrUpdateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs index 69a36e66da30..f2446f7040b0 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs @@ -7,45 +7,15 @@ using System; using System.Collections.Generic; -using Azure.Core; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationCreateOrUpdateContent. - public partial class NginxConfigurationCreateOrUpdateContent : ResourceData + /// Nginx Configuration Request. + public partial class NginxConfigurationCreateOrUpdateContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxConfigurationCreateOrUpdateContent() @@ -53,19 +23,35 @@ public NginxConfigurationCreateOrUpdateContent() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxConfigurationCreateOrUpdateProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// + /// + /// + /// Nginx Configuration Request Properties. + /// Metadata pertaining to creation and last modification of the resource. + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationCreateOrUpdateContent(string id, string name, string resourceType, NginxConfigurationCreateOrUpdateProperties properties, SystemData systemData, IDictionary additionalBinaryDataProperties) { + Id = id; + Name = name; + ResourceType = resourceType; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; + SystemData = systemData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the properties. + /// Gets the Id. + public string Id { get; } + + /// Gets the Name. + public string Name { get; } + + /// Gets the ResourceType. + public string ResourceType { get; } + + /// Nginx Configuration Request Properties. public NginxConfigurationCreateOrUpdateProperties Properties { get; set; } + + /// Metadata pertaining to creation and last modification of the resource. + public SystemData SystemData { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.Serialization.cs index 01b1ea58a428..d822993e65b5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxConfigurationCreateOrUpdateProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Configuration Request Properties. + public partial class NginxConfigurationCreateOrUpdateProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationCreateOrUpdateProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -43,7 +43,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("files"u8); writer.WriteStartArray(); - foreach (var item in Files) + foreach (NginxConfigurationFile item in Files) { writer.WriteObjectValue(item, options); } @@ -53,7 +53,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("protectedFiles"u8); writer.WriteStartArray(); - foreach (var item in ProtectedFiles) + foreach (NginxConfigurationContentProtectedFile item in ProtectedFiles) { writer.WriteObjectValue(item, options); } @@ -69,15 +69,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("rootFile"u8); writer.WriteStringValue(RootFile); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,105 +86,111 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxConfigurationCreateOrUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationCreateOrUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationCreateOrUpdateProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationCreateOrUpdateProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationCreateOrUpdateProperties(document.RootElement, options); } - internal static NginxConfigurationCreateOrUpdateProperties DeserializeNginxConfigurationCreateOrUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationCreateOrUpdateProperties DeserializeNginxConfigurationCreateOrUpdateProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } NginxProvisioningState? provisioningState = default; IList files = default; - IList protectedFiles = default; + IList protectedFiles = default; NginxConfigurationPackage package = default; string rootFile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new NginxProvisioningState(property.Value.GetString()); + provisioningState = new NginxProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("files"u8)) + if (prop.NameEquals("files"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxConfigurationFile.DeserializeNginxConfigurationFile(item, options)); } files = array; continue; } - if (property.NameEquals("protectedFiles"u8)) + if (prop.NameEquals("protectedFiles"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(NginxConfigurationProtectedFileContent.DeserializeNginxConfigurationProtectedFileContent(item, options)); + array.Add(NginxConfigurationContentProtectedFile.DeserializeNginxConfigurationContentProtectedFile(item, options)); } protectedFiles = array; continue; } - if (property.NameEquals("package"u8)) + if (prop.NameEquals("package"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - package = NginxConfigurationPackage.DeserializeNginxConfigurationPackage(property.Value, options); + package = NginxConfigurationPackage.DeserializeNginxConfigurationPackage(prop.Value, options); continue; } - if (property.NameEquals("rootFile"u8)) + if (prop.NameEquals("rootFile"u8)) { - rootFile = property.Value.GetString(); + rootFile = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxConfigurationCreateOrUpdateProperties( provisioningState, files ?? new ChangeTrackingList(), - protectedFiles ?? new ChangeTrackingList(), + protectedFiles ?? new ChangeTrackingList(), package, rootFile, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -194,15 +200,20 @@ BinaryData IPersistableModel.Write(M } } - NginxConfigurationCreateOrUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationCreateOrUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationCreateOrUpdateProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationCreateOrUpdateProperties(document.RootElement, options); } default: @@ -210,6 +221,7 @@ NginxConfigurationCreateOrUpdateProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.cs index a16c8a7ede6d..8fd3545894d9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.cs @@ -7,77 +7,53 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationCreateOrUpdateProperties. + /// Nginx Configuration Request Properties. public partial class NginxConfigurationCreateOrUpdateProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxConfigurationCreateOrUpdateProperties() { Files = new ChangeTrackingList(); - ProtectedFiles = new ChangeTrackingList(); + ProtectedFiles = new ChangeTrackingList(); } /// Initializes a new instance of . - /// + /// Provisioning State. /// /// - /// + /// Nginx Configuration Package. /// - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationCreateOrUpdateProperties(NginxProvisioningState? provisioningState, IList files, IList protectedFiles, NginxConfigurationPackage package, string rootFile, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationCreateOrUpdateProperties(NginxProvisioningState? provisioningState, IList files, IList protectedFiles, NginxConfigurationPackage package, string rootFile, IDictionary additionalBinaryDataProperties) { ProvisioningState = provisioningState; Files = files; ProtectedFiles = protectedFiles; Package = package; RootFile = rootFile; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// Gets the files. + + /// Gets the Files. public IList Files { get; } - /// Gets the protected files. - public IList ProtectedFiles { get; } - /// Gets or sets the package. + + /// Gets the ProtectedFiles. + public IList ProtectedFiles { get; } + + /// Nginx Configuration Package. public NginxConfigurationPackage Package { get; set; } - /// Gets or sets the root file. + + /// Gets or sets the RootFile. public string RootFile { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.Serialization.cs index 5eb0003d4113..b59a9748f942 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxConfigurationFile : IUtf8JsonSerializable, IJsonModel + /// Nginx Configuration File. + public partial class NginxConfigurationFile : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationFile)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Content)) { writer.WritePropertyName("content"u8); @@ -44,15 +44,20 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("virtualPath"u8); writer.WriteStringValue(VirtualPath); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (Optional.IsDefined(ContentHash)) + { + writer.WritePropertyName("contentHash"u8); + writer.WriteStringValue(ContentHash); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +66,67 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxConfigurationFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationFile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationFile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationFile)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationFile(document.RootElement, options); } - internal static NginxConfigurationFile DeserializeNginxConfigurationFile(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationFile DeserializeNginxConfigurationFile(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string content = default; string virtualPath = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + string contentHash = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("content"u8)) + if (prop.NameEquals("content"u8)) { - content = property.Value.GetString(); + content = prop.Value.GetString(); continue; } - if (property.NameEquals("virtualPath"u8)) + if (prop.NameEquals("virtualPath"u8)) { - virtualPath = property.Value.GetString(); + virtualPath = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("contentHash"u8)) + { + contentHash = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxConfigurationFile(content, virtualPath, serializedAdditionalRawData); + return new NginxConfigurationFile(content, virtualPath, contentHash, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +136,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - NginxConfigurationFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationFile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationFile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationFile(document.RootElement, options); } default: @@ -135,6 +157,7 @@ NginxConfigurationFile IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs index 4f9963fc390b..42659b0273a5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationFile. + /// Nginx Configuration File. public partial class NginxConfigurationFile { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxConfigurationFile() @@ -53,17 +24,20 @@ public NginxConfigurationFile() /// Initializes a new instance of . /// /// - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationFile(string content, string virtualPath, IDictionary serializedAdditionalRawData) + /// + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationFile(string content, string virtualPath, string contentHash, IDictionary additionalBinaryDataProperties) { Content = content; VirtualPath = virtualPath; - _serializedAdditionalRawData = serializedAdditionalRawData; + ContentHash = contentHash; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the content. + /// Gets or sets the Content. public string Content { get; set; } - /// Gets or sets the virtual path. + + /// Gets or sets the VirtualPath. public string VirtualPath { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.Serialization.cs index d5c8b8f7bff2..675d9ad15751 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxConfigurationListResponse : IUtf8JsonSerializable, IJsonModel + /// Response of a list operation. + internal partial class NginxConfigurationListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxConfigurationListResponse() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,36 +35,32 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationListResponse)} does not support writing '{format}' format."); } - - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (NginxConfigurationData item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxConfigurationListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationListResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationListResponse(document.RootElement, options); } - internal static NginxConfigurationListResponse DeserializeNginxConfigurationListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationListResponse DeserializeNginxConfigurationListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxConfigurationData.DeserializeNginxConfigurationData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxConfigurationListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxConfigurationListResponse(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - NginxConfigurationListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationListResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationListResponse(document.RootElement, options); } default: @@ -149,6 +163,14 @@ NginxConfigurationListResponse IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxConfigurationListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxConfigurationListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs index ff3b7b6caa9d..572b419cf4da 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs @@ -7,64 +7,39 @@ using System; using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// Response of a list operation. internal partial class NginxConfigurationListResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal NginxConfigurationListResponse() + /// The NginxConfigurationResponse items on this page. + internal NginxConfigurationListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + /// The NginxConfigurationResponse items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Results of a list operation. - public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { get; } + /// The NginxConfigurationResponse items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.Serialization.cs index 1fabcf7cba51..81c00b411bf4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxConfigurationPackage : IUtf8JsonSerializable, IJsonModel + /// Nginx Configuration Package. + public partial class NginxConfigurationPackage : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationPackage)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Data)) { writer.WritePropertyName("data"u8); @@ -43,21 +43,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("protectedFiles"u8); writer.WriteStartArray(); - foreach (var item in ProtectedFiles) + foreach (string item in ProtectedFiles) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,64 +71,77 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxConfigurationPackage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationPackage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationPackage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationPackage)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationPackage(document.RootElement, options); } - internal static NginxConfigurationPackage DeserializeNginxConfigurationPackage(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationPackage DeserializeNginxConfigurationPackage(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string data = default; IList protectedFiles = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("data"u8)) + if (prop.NameEquals("data"u8)) { - data = property.Value.GetString(); + data = prop.Value.GetString(); continue; } - if (property.NameEquals("protectedFiles"u8)) + if (prop.NameEquals("protectedFiles"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } protectedFiles = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxConfigurationPackage(data, protectedFiles ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NginxConfigurationPackage(data, protectedFiles ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +151,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - NginxConfigurationPackage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationPackage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationPackage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationPackage(document.RootElement, options); } default: @@ -149,6 +172,7 @@ NginxConfigurationPackage IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs index 12e54712683b..05b9df204c62 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationPackage. + /// Nginx Configuration Package. public partial class NginxConfigurationPackage { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxConfigurationPackage() @@ -54,17 +26,18 @@ public NginxConfigurationPackage() /// Initializes a new instance of . /// /// - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationPackage(string data, IList protectedFiles, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationPackage(string data, IList protectedFiles, IDictionary additionalBinaryDataProperties) { Data = data; ProtectedFiles = protectedFiles; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the data. + /// Gets or sets the Data. public string Data { get; set; } - /// Gets the protected files. + + /// Gets the ProtectedFiles. public IList ProtectedFiles { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.Serialization.cs index c428201af9e4..02e29ec9b58b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxConfigurationProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Configuration Response Properties. + public partial class NginxConfigurationProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -43,7 +43,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("files"u8); writer.WriteStartArray(); - foreach (var item in Files) + foreach (NginxConfigurationFile item in Files) { writer.WriteObjectValue(item, options); } @@ -53,7 +53,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("protectedFiles"u8); writer.WriteStartArray(); - foreach (var item in ProtectedFiles) + foreach (NginxConfigurationFile item in ProtectedFiles) { writer.WriteObjectValue(item, options); } @@ -69,15 +69,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("rootFile"u8); writer.WriteStringValue(RootFile); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,105 +86,111 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxConfigurationProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationProperties(document.RootElement, options); } - internal static NginxConfigurationProperties DeserializeNginxConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationProperties DeserializeNginxConfigurationProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } NginxProvisioningState? provisioningState = default; - IReadOnlyList files = default; - IReadOnlyList protectedFiles = default; + IList files = default; + IList protectedFiles = default; NginxConfigurationPackage package = default; string rootFile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new NginxProvisioningState(property.Value.GetString()); + provisioningState = new NginxProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("files"u8)) + if (prop.NameEquals("files"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxConfigurationFile.DeserializeNginxConfigurationFile(item, options)); } files = array; continue; } - if (property.NameEquals("protectedFiles"u8)) + if (prop.NameEquals("protectedFiles"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(NginxConfigurationProtectedFileResult.DeserializeNginxConfigurationProtectedFileResult(item, options)); + array.Add(NginxConfigurationFile.DeserializeNginxConfigurationFile(item, options)); } protectedFiles = array; continue; } - if (property.NameEquals("package"u8)) + if (prop.NameEquals("package"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - package = NginxConfigurationPackage.DeserializeNginxConfigurationPackage(property.Value, options); + package = NginxConfigurationPackage.DeserializeNginxConfigurationPackage(prop.Value, options); continue; } - if (property.NameEquals("rootFile"u8)) + if (prop.NameEquals("rootFile"u8)) { - rootFile = property.Value.GetString(); + rootFile = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxConfigurationProperties( provisioningState, files ?? new ChangeTrackingList(), - protectedFiles ?? new ChangeTrackingList(), + protectedFiles ?? new ChangeTrackingList(), package, rootFile, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -194,15 +200,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - NginxConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxConfigurationProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationProperties(document.RootElement, options); } default: @@ -210,6 +221,7 @@ NginxConfigurationProperties IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.cs index 1780cedc08d2..953da6cab542 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.cs @@ -7,77 +7,53 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationProperties. + /// Nginx Configuration Response Properties. public partial class NginxConfigurationProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal NginxConfigurationProperties() + public NginxConfigurationProperties() { Files = new ChangeTrackingList(); - ProtectedFiles = new ChangeTrackingList(); + ProtectedFiles = new ChangeTrackingList(); } /// Initializes a new instance of . - /// + /// Provisioning State. /// /// - /// + /// Nginx Configuration Package. /// - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationProperties(NginxProvisioningState? provisioningState, IReadOnlyList files, IReadOnlyList protectedFiles, NginxConfigurationPackage package, string rootFile, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationProperties(NginxProvisioningState? provisioningState, IList files, IList protectedFiles, NginxConfigurationPackage package, string rootFile, IDictionary additionalBinaryDataProperties) { ProvisioningState = provisioningState; Files = files; ProtectedFiles = protectedFiles; Package = package; RootFile = rootFile; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// Gets the files. - public IReadOnlyList Files { get; } - /// Gets the protected files. - public IReadOnlyList ProtectedFiles { get; } - /// Gets the package. - public NginxConfigurationPackage Package { get; } - /// Gets the root file. - public string RootFile { get; } + + /// Gets the Files. + public IList Files { get; } + + /// Gets the ProtectedFiles. + public IList ProtectedFiles { get; } + + /// Nginx Configuration Package. + public NginxConfigurationPackage Package { get; set; } + + /// Gets or sets the RootFile. + public string RootFile { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.Serialization.cs deleted file mode 100644 index 5f3c8c80f12d..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Nginx.Models -{ - public partial class NginxConfigurationProtectedFileContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileContent)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Content)) - { - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - } - if (Optional.IsDefined(VirtualPath)) - { - writer.WritePropertyName("virtualPath"u8); - writer.WriteStringValue(VirtualPath); - } - if (Optional.IsDefined(ContentHash)) - { - writer.WritePropertyName("contentHash"u8); - writer.WriteStringValue(ContentHash); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NginxConfigurationProtectedFileContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNginxConfigurationProtectedFileContent(document.RootElement, options); - } - - internal static NginxConfigurationProtectedFileContent DeserializeNginxConfigurationProtectedFileContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string content = default; - string virtualPath = default; - string contentHash = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("content"u8)) - { - content = property.Value.GetString(); - continue; - } - if (property.NameEquals("virtualPath"u8)) - { - virtualPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("contentHash"u8)) - { - contentHash = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NginxConfigurationProtectedFileContent(content, virtualPath, contentHash, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); - default: - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileContent)} does not support writing '{options.Format}' format."); - } - } - - NginxConfigurationProtectedFileContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNginxConfigurationProtectedFileContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs deleted file mode 100644 index 698160d1a8fb..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.Nginx.Models -{ - /// The NginxConfigurationProtectedFileContent. - public partial class NginxConfigurationProtectedFileContent - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public NginxConfigurationProtectedFileContent() - { - } - - /// Initializes a new instance of . - /// The content of the protected file. This value is a PUT only value. If you perform a GET request on this value, it will be empty because it is a protected file. - /// The virtual path of the protected file. - /// The hash of the content of the file. This value is used to determine if the file has changed. - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationProtectedFileContent(string content, string virtualPath, string contentHash, IDictionary serializedAdditionalRawData) - { - Content = content; - VirtualPath = virtualPath; - ContentHash = contentHash; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The content of the protected file. This value is a PUT only value. If you perform a GET request on this value, it will be empty because it is a protected file. - public string Content { get; set; } - /// The virtual path of the protected file. - public string VirtualPath { get; set; } - /// The hash of the content of the file. This value is used to determine if the file has changed. - public string ContentHash { get; set; } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.Serialization.cs deleted file mode 100644 index 7263472002ac..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.Serialization.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Nginx.Models -{ - public partial class NginxConfigurationProtectedFileResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileResult)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(VirtualPath)) - { - writer.WritePropertyName("virtualPath"u8); - writer.WriteStringValue(VirtualPath); - } - if (Optional.IsDefined(ContentHash)) - { - writer.WritePropertyName("contentHash"u8); - writer.WriteStringValue(ContentHash); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NginxConfigurationProtectedFileResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNginxConfigurationProtectedFileResult(document.RootElement, options); - } - - internal static NginxConfigurationProtectedFileResult DeserializeNginxConfigurationProtectedFileResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string virtualPath = default; - string contentHash = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("virtualPath"u8)) - { - virtualPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("contentHash"u8)) - { - contentHash = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NginxConfigurationProtectedFileResult(virtualPath, contentHash, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); - default: - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileResult)} does not support writing '{options.Format}' format."); - } - } - - NginxConfigurationProtectedFileResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNginxConfigurationProtectedFileResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NginxConfigurationProtectedFileResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs deleted file mode 100644 index 612f155b2242..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.Nginx.Models -{ - /// The NginxConfigurationProtectedFileResult. - public partial class NginxConfigurationProtectedFileResult - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal NginxConfigurationProtectedFileResult() - { - } - - /// Initializes a new instance of . - /// The virtual path of the protected file. - /// The hash of the content of the file. This value is used to determine if the file has changed. - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationProtectedFileResult(string virtualPath, string contentHash, IDictionary serializedAdditionalRawData) - { - VirtualPath = virtualPath; - ContentHash = contentHash; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The virtual path of the protected file. - public string VirtualPath { get; } - /// The hash of the content of the file. This value is used to determine if the file has changed. - public string ContentHash { get; } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.Serialization.cs index 1aa29bfc5a90..17bbb47fa87d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.Serialization.cs @@ -12,13 +12,15 @@ using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentApiKeyCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Api Key Request. + public partial class NginxDeploymentApiKeyCreateOrUpdateContent : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,103 +30,142 @@ void IJsonModel.Write(Utf8JsonWriter /// The JSON writer. /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyCreateOrUpdateContent)} does not support writing '{format}' format."); } - - base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + ((IJsonModel)SystemData).Write(writer, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } } - NginxDeploymentApiKeyCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentApiKeyCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyCreateOrUpdateContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyCreateOrUpdateContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentApiKeyCreateOrUpdateContent(document.RootElement, options); } - internal static NginxDeploymentApiKeyCreateOrUpdateContent DeserializeNginxDeploymentApiKeyCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentApiKeyCreateOrUpdateContent DeserializeNginxDeploymentApiKeyCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxDeploymentApiKeyRequestProperties properties = default; - ResourceIdentifier id = default; + string id = default; string name = default; - ResourceType type = default; + string resourceType = default; + NginxDeploymentApiKeyRequestProperties properties = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = NginxDeploymentApiKeyRequestProperties.DeserializeNginxDeploymentApiKeyRequestProperties(property.Value, options); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + resourceType = prop.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("properties"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxDeploymentApiKeyRequestProperties.DeserializeNginxDeploymentApiKeyRequestProperties(prop.Value, options); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("systemData"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDeploymentApiKeyCreateOrUpdateContent( id, name, - type, - systemData, + resourceType, properties, - serializedAdditionalRawData); + systemData, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +175,20 @@ BinaryData IPersistableModel.Write(M } } - NginxDeploymentApiKeyCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentApiKeyCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyCreateOrUpdateContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentApiKeyCreateOrUpdateContent(document.RootElement, options); } default: @@ -150,6 +196,19 @@ NginxDeploymentApiKeyCreateOrUpdateContent IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxDeploymentApiKeyCreateOrUpdateContent nginxDeploymentApiKeyCreateOrUpdateContent) + { + if (nginxDeploymentApiKeyCreateOrUpdateContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxDeploymentApiKeyCreateOrUpdateContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.cs index ebeb32b6260e..b1c0c6357293 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.cs @@ -7,45 +7,15 @@ using System; using System.Collections.Generic; -using Azure.Core; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyCreateOrUpdateContent. - public partial class NginxDeploymentApiKeyCreateOrUpdateContent : ResourceData + /// Nginx Deployment Api Key Request. + public partial class NginxDeploymentApiKeyCreateOrUpdateContent { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentApiKeyCreateOrUpdateContent() @@ -53,19 +23,35 @@ public NginxDeploymentApiKeyCreateOrUpdateContent() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentApiKeyCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxDeploymentApiKeyRequestProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// + /// + /// + /// Nginx Deployment Api Key Request Properties. + /// Metadata pertaining to creation and last modification of the resource. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentApiKeyCreateOrUpdateContent(string id, string name, string resourceType, NginxDeploymentApiKeyRequestProperties properties, SystemData systemData, IDictionary additionalBinaryDataProperties) { + Id = id; + Name = name; + ResourceType = resourceType; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; + SystemData = systemData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the properties. + /// Gets the Id. + public string Id { get; } + + /// Gets the Name. + public string Name { get; } + + /// Gets the ResourceType. + public string ResourceType { get; } + + /// Nginx Deployment Api Key Request Properties. public NginxDeploymentApiKeyRequestProperties Properties { get; set; } + + /// Metadata pertaining to creation and last modification of the resource. + public SystemData SystemData { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.Serialization.cs index 12cf7a543206..69db7e3d17ea 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxDeploymentApiKeyListResponse : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Api Key List Response. + internal partial class NginxDeploymentApiKeyListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxDeploymentApiKeyListResponse() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,36 +35,32 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyListResponse)} does not support writing '{format}' format."); } - - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (NginxDeploymentApiKeyData item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentApiKeyListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentApiKeyListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyListResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentApiKeyListResponse(document.RootElement, options); } - internal static NginxDeploymentApiKeyListResponse DeserializeNginxDeploymentApiKeyListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentApiKeyListResponse DeserializeNginxDeploymentApiKeyListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentApiKeyListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxDeploymentApiKeyListResponse(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - NginxDeploymentApiKeyListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentApiKeyListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyListResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentApiKeyListResponse(document.RootElement, options); } default: @@ -149,6 +163,14 @@ NginxDeploymentApiKeyListResponse IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxDeploymentApiKeyListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentApiKeyListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs index 090ddc3a210d..1bd23189fc47 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs @@ -7,64 +7,39 @@ using System; using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyListResponse. + /// Nginx Deployment Api Key List Response. internal partial class NginxDeploymentApiKeyListResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal NginxDeploymentApiKeyListResponse() + /// The NginxDeploymentApiKeyResponse items on this page. + internal NginxDeploymentApiKeyListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentApiKeyListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + /// The NginxDeploymentApiKeyResponse items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentApiKeyListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the value. - public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { get; } + /// The NginxDeploymentApiKeyResponse items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.Serialization.cs index 59688c2a2640..0c078195f4d4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentApiKeyProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Api Key Response Properties. + public partial class NginxDeploymentApiKeyProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Hint)) { writer.WritePropertyName("hint"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("endDateTime"u8); writer.WriteStringValue(EndOn.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,59 +61,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentApiKeyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentApiKeyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentApiKeyProperties(document.RootElement, options); } - internal static NginxDeploymentApiKeyProperties DeserializeNginxDeploymentApiKeyProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentApiKeyProperties DeserializeNginxDeploymentApiKeyProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string hint = default; - DateTimeOffset? endDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? endOn = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("hint"u8)) + if (prop.NameEquals("hint"u8)) { - hint = property.Value.GetString(); + hint = prop.Value.GetString(); continue; } - if (property.NameEquals("endDateTime"u8)) + if (prop.NameEquals("endDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - endDateTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentApiKeyProperties(hint, endDateTime, serializedAdditionalRawData); + return new NginxDeploymentApiKeyProperties(hint, endOn, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +129,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - NginxDeploymentApiKeyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentApiKeyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentApiKeyProperties(document.RootElement, options); } default: @@ -139,6 +150,7 @@ NginxDeploymentApiKeyProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs index a63e5cce2de7..55b00f9f0a78 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyProperties. + /// Nginx Deployment Api Key Response Properties. public partial class NginxDeploymentApiKeyProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal NginxDeploymentApiKeyProperties() @@ -53,16 +24,17 @@ internal NginxDeploymentApiKeyProperties() /// Initializes a new instance of . /// The first three characters of the secret text to help identify it in use. This property is read-only. /// The time after which this Dataplane API Key is no longer valid. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentApiKeyProperties(string hint, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentApiKeyProperties(string hint, DateTimeOffset? endOn, IDictionary additionalBinaryDataProperties) { Hint = hint; EndOn = endOn; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The first three characters of the secret text to help identify it in use. This property is read-only. public string Hint { get; } + /// The time after which this Dataplane API Key is no longer valid. public DateTimeOffset? EndOn { get; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.Serialization.cs index c87cc2fc91fa..979861e5e504 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentApiKeyRequestProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Api Key Request Properties. + public partial class NginxDeploymentApiKeyRequestProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyRequestProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(SecretText)) { writer.WritePropertyName("secretText"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("endDateTime"u8); writer.WriteStringValue(EndOn.Value, "O"); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,59 +61,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentApiKeyRequestProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentApiKeyRequestProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyRequestProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyRequestProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentApiKeyRequestProperties(document.RootElement, options); } - internal static NginxDeploymentApiKeyRequestProperties DeserializeNginxDeploymentApiKeyRequestProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentApiKeyRequestProperties DeserializeNginxDeploymentApiKeyRequestProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string secretText = default; - DateTimeOffset? endDateTime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + DateTimeOffset? endOn = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("secretText"u8)) + if (prop.NameEquals("secretText"u8)) { - secretText = property.Value.GetString(); + secretText = prop.Value.GetString(); continue; } - if (property.NameEquals("endDateTime"u8)) + if (prop.NameEquals("endDateTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - endDateTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentApiKeyRequestProperties(secretText, endDateTime, serializedAdditionalRawData); + return new NginxDeploymentApiKeyRequestProperties(secretText, endOn, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +129,20 @@ BinaryData IPersistableModel.Write(Model } } - NginxDeploymentApiKeyRequestProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentApiKeyRequestProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentApiKeyRequestProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentApiKeyRequestProperties(document.RootElement, options); } default: @@ -139,6 +150,7 @@ NginxDeploymentApiKeyRequestProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs index 87daab670548..6c49a3c97164 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyRequestProperties. + /// Nginx Deployment Api Key Request Properties. public partial class NginxDeploymentApiKeyRequestProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentApiKeyRequestProperties() @@ -53,16 +24,17 @@ public NginxDeploymentApiKeyRequestProperties() /// Initializes a new instance of . /// Secret text to be used as a Dataplane API Key. This is a write only property that can never be read back, but the first three characters will be returned in the 'hint' property. /// The time after which this Dataplane API Key is no longer valid. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentApiKeyRequestProperties(string secretText, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentApiKeyRequestProperties(string secretText, DateTimeOffset? endOn, IDictionary additionalBinaryDataProperties) { SecretText = secretText; EndOn = endOn; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Secret text to be used as a Dataplane API Key. This is a write only property that can never be read back, but the first three characters will be returned in the 'hint' property. public string SecretText { get; set; } + /// The time after which this Dataplane API Key is no longer valid. public DateTimeOffset? EndOn { get; set; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.Serialization.cs new file mode 100644 index 000000000000..10defe1da8cc --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// The settings for enabling automatic scaling of the deployment. If this field is specified, 'scale.capacity' must be empty. + internal partial class NginxDeploymentAutoScaleSettings : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal NginxDeploymentAutoScaleSettings() + { + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentAutoScaleSettings)} does not support writing '{format}' format."); + } + writer.WritePropertyName("profiles"u8); + writer.WriteStartArray(); + foreach (NginxScaleProfile item in Profiles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentAutoScaleSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentAutoScaleSettings JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentAutoScaleSettings)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentAutoScaleSettings(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentAutoScaleSettings DeserializeNginxDeploymentAutoScaleSettings(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList profiles = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("profiles"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(NginxScaleProfile.DeserializeNginxScaleProfile(item, options)); + } + profiles = array; + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentAutoScaleSettings(profiles, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentAutoScaleSettings)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentAutoScaleSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentAutoScaleSettings PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentAutoScaleSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentAutoScaleSettings)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.cs new file mode 100644 index 000000000000..7822985f581f --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// The settings for enabling automatic scaling of the deployment. If this field is specified, 'scale.capacity' must be empty. + internal partial class NginxDeploymentAutoScaleSettings + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// + /// is null. + public NginxDeploymentAutoScaleSettings(IEnumerable profiles) + { + Argument.AssertNotNull(profiles, nameof(profiles)); + + Profiles = profiles.ToList(); + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentAutoScaleSettings(IList profiles, IDictionary additionalBinaryDataProperties) + { + Profiles = profiles; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Gets the Profiles. + public IList Profiles { get; } = new ChangeTrackingList(); + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.Serialization.cs new file mode 100644 index 000000000000..d06447ec44dc --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Default Waf Policy List Response. + public partial class NginxDeploymentDefaultWafPolicyListResult : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyListResult)} does not support writing '{format}' format."); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (NginxDeploymentDefaultWafPolicyProperties item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentDefaultWafPolicyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentDefaultWafPolicyListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyListResult)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentDefaultWafPolicyListResult(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentDefaultWafPolicyListResult DeserializeNginxDeploymentDefaultWafPolicyListResult(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + string nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + nextLink = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentDefaultWafPolicyListResult(value ?? new ChangeTrackingList(), nextLink, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyListResult)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentDefaultWafPolicyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentDefaultWafPolicyListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentDefaultWafPolicyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyListResult)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxDeploymentDefaultWafPolicyListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentDefaultWafPolicyListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.cs new file mode 100644 index 000000000000..294c8c8fa8ba --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Default Waf Policy List Response. + public partial class NginxDeploymentDefaultWafPolicyListResult + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal NginxDeploymentDefaultWafPolicyListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentDefaultWafPolicyListResult(IList value, string nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Gets the Value. + public IList Value { get; } + + /// Gets the NextLink. + public string NextLink { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.Serialization.cs new file mode 100644 index 000000000000..8b2142e26196 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Default Waf Policy Properties. + public partial class NginxDeploymentDefaultWafPolicyProperties : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyProperties)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteBase64StringValue(Content.ToArray(), "D"); + } + if (options.Format != "W" && Optional.IsDefined(Filepath)) + { + writer.WritePropertyName("filepath"u8); + writer.WriteStringValue(Filepath); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentDefaultWafPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentDefaultWafPolicyProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentDefaultWafPolicyProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentDefaultWafPolicyProperties DeserializeNginxDeploymentDefaultWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData content = default; + string filepath = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("content"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = BinaryData.FromBytes(prop.Value.GetBytesFromBase64("D")); + continue; + } + if (prop.NameEquals("filepath"u8)) + { + filepath = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentDefaultWafPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentDefaultWafPolicyProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentDefaultWafPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs new file mode 100644 index 000000000000..ce7981512bd8 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Default Waf Policy Properties. + public partial class NginxDeploymentDefaultWafPolicyProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal NginxDeploymentDefaultWafPolicyProperties() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentDefaultWafPolicyProperties(BinaryData content, string filepath, IDictionary additionalBinaryDataProperties) + { + Content = content; + Filepath = filepath; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// + /// Gets the Content. + /// + /// To assign a byte[] to this property use . + /// The byte[] will be serialized to a Base64 encoded string. + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromBytes(new byte[] { 1, 2, 3 }). + /// Creates a payload of "AQID". + /// + /// + /// + /// + public BinaryData Content { get; } + + /// Gets the Filepath. + public string Filepath { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.Serialization.cs index c8cab4fb0dd7..0b9b63361204 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxDeploymentListResponse : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment List Response. + internal partial class NginxDeploymentListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxDeploymentListResponse() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,36 +35,32 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentListResponse)} does not support writing '{format}' format."); } - - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (NginxDeploymentData item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentListResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentListResponse(document.RootElement, options); } - internal static NginxDeploymentListResponse DeserializeNginxDeploymentListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentListResponse DeserializeNginxDeploymentListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxDeploymentData.DeserializeNginxDeploymentData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxDeploymentListResponse(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - NginxDeploymentListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentListResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentListResponse(document.RootElement, options); } default: @@ -149,6 +163,14 @@ NginxDeploymentListResponse IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxDeploymentListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs index c49fa63c85fa..0dd59fe84501 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs @@ -7,64 +7,39 @@ using System; using System.Collections.Generic; +using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentListResponse. + /// Nginx Deployment List Response. internal partial class NginxDeploymentListResponse { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal NginxDeploymentListResponse() + /// The NginxDeployment items on this page. + internal NginxDeploymentListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + /// The NginxDeployment items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the value. - public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { get; } + /// The NginxDeployment items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.Serialization.cs index 6c1537f85f05..79f2ebdb9729 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.Serialization.cs @@ -12,13 +12,15 @@ using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentPatch : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Update Parameters. + public partial class NginxDeploymentPatch : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +32,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentPatch)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -48,6 +49,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -67,15 +73,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -84,22 +90,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentPatch JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentPatch)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentPatch(document.RootElement, options); } - internal static NginxDeploymentPatch DeserializeNginxDeploymentPatch(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentPatch DeserializeNginxDeploymentPatch(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -109,79 +120,87 @@ internal static NginxDeploymentPatch DeserializeNginxDeploymentPatch(JsonElement NginxResourceSku sku = default; AzureLocation? location = default; NginxDeploymentUpdateProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerNginxContext.Default); + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("sku"u8)) + if (prop.NameEquals("sku"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sku = NginxResourceSku.DeserializeNginxResourceSku(property.Value, options); + sku = NginxResourceSku.DeserializeNginxResourceSku(prop.Value, options); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxDeploymentUpdateProperties.DeserializeNginxDeploymentUpdateProperties(property.Value, options); + properties = NginxDeploymentUpdateProperties.DeserializeNginxDeploymentUpdateProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDeploymentPatch( identity, tags ?? new ChangeTrackingDictionary(), sku, location, properties, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -191,15 +210,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - NginxDeploymentPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentPatch PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentPatch(document.RootElement, options); } default: @@ -207,6 +231,19 @@ NginxDeploymentPatch IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxDeploymentPatch nginxDeploymentPatch) + { + if (nginxDeploymentPatch == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxDeploymentPatch, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs index b2838c5550fc..45c34a192b92 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs @@ -9,43 +9,15 @@ using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentPatch. + /// Nginx Deployment Update Parameters. public partial class NginxDeploymentPatch { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentPatch() @@ -54,38 +26,48 @@ public NginxDeploymentPatch() } /// Initializes a new instance of . - /// Gets or sets the identity. + /// Identity Properties. /// Dictionary of <string>. - /// - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentPatch(ManagedServiceIdentity identity, IDictionary tags, NginxResourceSku sku, AzureLocation? location, NginxDeploymentUpdateProperties properties, IDictionary serializedAdditionalRawData) + /// Resource Sku. + /// The geo-location where the resource lives. + /// Nginx Deployment Update Properties. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentPatch(ManagedServiceIdentity identity, IDictionary tags, NginxResourceSku sku, AzureLocation? location, NginxDeploymentUpdateProperties properties, IDictionary additionalBinaryDataProperties) { Identity = identity; Tags = tags; Sku = sku; Location = location; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the identity. + /// Identity Properties. public ManagedServiceIdentity Identity { get; set; } + /// Dictionary of <string>. public IDictionary Tags { get; } - /// Gets or sets the sku. + + /// Resource Sku. internal NginxResourceSku Sku { get; set; } + + /// The geo-location where the resource lives. + public AzureLocation? Location { get; set; } + + /// Nginx Deployment Update Properties. + public NginxDeploymentUpdateProperties Properties { get; set; } + /// Name of the SKU. public string SkuName { - get => Sku is null ? default : Sku.Name; - set => Sku = new NginxResourceSku(value); + get + { + return Sku is null ? default : Sku.Name; + } + set + { + Sku = new NginxResourceSku(value); + } } - - /// Gets or sets the location. - public AzureLocation? Location { get; set; } - /// Gets or sets the properties. - public NginxDeploymentUpdateProperties Properties { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.Serialization.cs index 829c06c5ede5..13c0d452aacb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Properties. + public partial class NginxDeploymentProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -89,15 +89,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("dataplaneApiEndpoint"u8); writer.WriteStringValue(DataplaneApiEndpoint); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -106,22 +106,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentProperties(document.RootElement, options); } - internal static NginxDeploymentProperties DeserializeNginxDeploymentProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentProperties DeserializeNginxDeploymentProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -137,103 +142,101 @@ internal static NginxDeploymentProperties DeserializeNginxDeploymentProperties(J NginxDeploymentUserProfile userProfile = default; NginxDeploymentPropertiesNginxAppProtect nginxAppProtect = default; string dataplaneApiEndpoint = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new NginxProvisioningState(property.Value.GetString()); + provisioningState = new NginxProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("nginxVersion"u8)) + if (prop.NameEquals("nginxVersion"u8)) { - nginxVersion = property.Value.GetString(); + nginxVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("networkProfile"u8)) + if (prop.NameEquals("networkProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - networkProfile = NginxNetworkProfile.DeserializeNginxNetworkProfile(property.Value, options); + networkProfile = NginxNetworkProfile.DeserializeNginxNetworkProfile(prop.Value, options); continue; } - if (property.NameEquals("ipAddress"u8)) + if (prop.NameEquals("ipAddress"u8)) { - ipAddress = property.Value.GetString(); + ipAddress = prop.Value.GetString(); continue; } - if (property.NameEquals("enableDiagnosticsSupport"u8)) + if (prop.NameEquals("enableDiagnosticsSupport"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - enableDiagnosticsSupport = property.Value.GetBoolean(); + enableDiagnosticsSupport = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("logging"u8)) + if (prop.NameEquals("logging"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - logging = NginxLogging.DeserializeNginxLogging(property.Value, options); + logging = NginxLogging.DeserializeNginxLogging(prop.Value, options); continue; } - if (property.NameEquals("scalingProperties"u8)) + if (prop.NameEquals("scalingProperties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - scalingProperties = NginxDeploymentScalingProperties.DeserializeNginxDeploymentScalingProperties(property.Value, options); + scalingProperties = NginxDeploymentScalingProperties.DeserializeNginxDeploymentScalingProperties(prop.Value, options); continue; } - if (property.NameEquals("autoUpgradeProfile"u8)) + if (prop.NameEquals("autoUpgradeProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - autoUpgradeProfile = AutoUpgradeProfile.DeserializeAutoUpgradeProfile(property.Value, options); + autoUpgradeProfile = AutoUpgradeProfile.DeserializeAutoUpgradeProfile(prop.Value, options); continue; } - if (property.NameEquals("userProfile"u8)) + if (prop.NameEquals("userProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - userProfile = NginxDeploymentUserProfile.DeserializeNginxDeploymentUserProfile(property.Value, options); + userProfile = NginxDeploymentUserProfile.DeserializeNginxDeploymentUserProfile(prop.Value, options); continue; } - if (property.NameEquals("nginxAppProtect"u8)) + if (prop.NameEquals("nginxAppProtect"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nginxAppProtect = NginxDeploymentPropertiesNginxAppProtect.DeserializeNginxDeploymentPropertiesNginxAppProtect(property.Value, options); + nginxAppProtect = NginxDeploymentPropertiesNginxAppProtect.DeserializeNginxDeploymentPropertiesNginxAppProtect(prop.Value, options); continue; } - if (property.NameEquals("dataplaneApiEndpoint"u8)) + if (prop.NameEquals("dataplaneApiEndpoint"u8)) { - dataplaneApiEndpoint = property.Value.GetString(); + dataplaneApiEndpoint = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDeploymentProperties( provisioningState, nginxVersion, @@ -246,13 +249,16 @@ internal static NginxDeploymentProperties DeserializeNginxDeploymentProperties(J userProfile, nginxAppProtect, dataplaneApiEndpoint, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -262,15 +268,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - NginxDeploymentProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentProperties(document.RootElement, options); } default: @@ -278,6 +289,7 @@ NginxDeploymentProperties IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs index 42a740e140e1..66f42c003c9f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentProperties. + /// Nginx Deployment Properties. public partial class NginxDeploymentProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentProperties() @@ -51,19 +22,19 @@ public NginxDeploymentProperties() } /// Initializes a new instance of . - /// + /// Provisioning State. /// - /// + /// Nginx Network Profile. /// The IP address of the deployment. /// - /// + /// Nginx Logging. /// Information on how the deployment will be scaled. /// Autoupgrade settings of a deployment. - /// + /// Nginx Deployment User Profile. /// Settings for NGINX App Protect (NAP). /// Dataplane API endpoint for the caller to update the NGINX state of the deployment. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentProperties(NginxProvisioningState? provisioningState, string nginxVersion, NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, NginxLogging logging, NginxDeploymentScalingProperties scalingProperties, AutoUpgradeProfile autoUpgradeProfile, NginxDeploymentUserProfile userProfile, NginxDeploymentPropertiesNginxAppProtect nginxAppProtect, string dataplaneApiEndpoint, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentProperties(NginxProvisioningState? provisioningState, string nginxVersion, NginxNetworkProfile networkProfile, string ipAddress, bool? enableDiagnosticsSupport, NginxLogging logging, NginxDeploymentScalingProperties scalingProperties, AutoUpgradeProfile autoUpgradeProfile, NginxDeploymentUserProfile userProfile, NginxDeploymentPropertiesNginxAppProtect nginxAppProtect, string dataplaneApiEndpoint, IDictionary additionalBinaryDataProperties) { ProvisioningState = provisioningState; NginxVersion = nginxVersion; @@ -76,61 +47,87 @@ internal NginxDeploymentProperties(NginxProvisioningState? provisioningState, st UserProfile = userProfile; NginxAppProtect = nginxAppProtect; DataplaneApiEndpoint = dataplaneApiEndpoint; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// Gets the nginx version. + + /// Gets the NginxVersion. public string NginxVersion { get; } - /// Gets or sets the network profile. + + /// Nginx Network Profile. public NginxNetworkProfile NetworkProfile { get; set; } + /// The IP address of the deployment. public string IPAddress { get; } - /// Gets or sets the enable diagnostics support. + + /// Gets or sets the EnableDiagnosticsSupport. public bool? EnableDiagnosticsSupport { get; set; } - /// Gets or sets the logging. + + /// Nginx Logging. internal NginxLogging Logging { get; set; } - /// Gets or sets the logging storage account. + + /// Information on how the deployment will be scaled. + public NginxDeploymentScalingProperties ScalingProperties { get; set; } + + /// Autoupgrade settings of a deployment. + internal AutoUpgradeProfile AutoUpgradeProfile { get; set; } + + /// Nginx Deployment User Profile. + internal NginxDeploymentUserProfile UserProfile { get; set; } + + /// Settings for NGINX App Protect (NAP). + public NginxDeploymentPropertiesNginxAppProtect NginxAppProtect { get; set; } + + /// Dataplane API endpoint for the caller to update the NGINX state of the deployment. + public string DataplaneApiEndpoint { get; } + + /// Nginx Storage Account. public NginxStorageAccount LoggingStorageAccount { - get => Logging is null ? default : Logging.StorageAccount; + get + { + return Logging is null ? default : Logging.StorageAccount; + } set { if (Logging is null) + { Logging = new NginxLogging(); + } Logging.StorageAccount = value; } } - /// Information on how the deployment will be scaled. - public NginxDeploymentScalingProperties ScalingProperties { get; set; } - /// Autoupgrade settings of a deployment. - internal AutoUpgradeProfile AutoUpgradeProfile { get; set; } /// Channel used for autoupgrade. public string UpgradeChannel { - get => AutoUpgradeProfile is null ? default : AutoUpgradeProfile.UpgradeChannel; - set => AutoUpgradeProfile = new AutoUpgradeProfile(value); + get + { + return AutoUpgradeProfile is null ? default : AutoUpgradeProfile.UpgradeChannel; + } + set + { + AutoUpgradeProfile = new AutoUpgradeProfile(value); + } } - /// Gets or sets the user profile. - internal NginxDeploymentUserProfile UserProfile { get; set; } /// The preferred support contact email address of the user used for sending alerts and notification. Can be an empty string or a valid email address. public string UserPreferredEmail { - get => UserProfile is null ? default : UserProfile.PreferredEmail; + get + { + return UserProfile is null ? default : UserProfile.PreferredEmail; + } set { if (UserProfile is null) + { UserProfile = new NginxDeploymentUserProfile(); + } UserProfile.PreferredEmail = value; } } - - /// Settings for NGINX App Protect (NAP). - public NginxDeploymentPropertiesNginxAppProtect NginxAppProtect { get; set; } - /// Dataplane API endpoint for the caller to update the NGINX state of the deployment. - public string DataplaneApiEndpoint { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.Serialization.cs index 63491c8ba93f..003e13485da0 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentPropertiesNginxAppProtect : IUtf8JsonSerializable, IJsonModel + /// Settings for NGINX App Protect (NAP). + public partial class NginxDeploymentPropertiesNginxAppProtect : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxDeploymentPropertiesNginxAppProtect() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter w /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentPropertiesNginxAppProtect)} does not support writing '{format}' format."); } - writer.WritePropertyName("webApplicationFirewallSettings"u8); writer.WriteObjectValue(WebApplicationFirewallSettings, options); if (options.Format != "W" && Optional.IsDefined(WebApplicationFirewallStatus)) @@ -41,15 +46,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("webApplicationFirewallStatus"u8); writer.WriteObjectValue(WebApplicationFirewallStatus, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,59 +63,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentPropertiesNginxAppProtect IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentPropertiesNginxAppProtect IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentPropertiesNginxAppProtect JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentPropertiesNginxAppProtect)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentPropertiesNginxAppProtect(document.RootElement, options); } - internal static NginxDeploymentPropertiesNginxAppProtect DeserializeNginxDeploymentPropertiesNginxAppProtect(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentPropertiesNginxAppProtect DeserializeNginxDeploymentPropertiesNginxAppProtect(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } WebApplicationFirewallSettings webApplicationFirewallSettings = default; WebApplicationFirewallStatus webApplicationFirewallStatus = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("webApplicationFirewallSettings"u8)) + if (prop.NameEquals("webApplicationFirewallSettings"u8)) { - webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(property.Value, options); + webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(prop.Value, options); continue; } - if (property.NameEquals("webApplicationFirewallStatus"u8)) + if (prop.NameEquals("webApplicationFirewallStatus"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - webApplicationFirewallStatus = WebApplicationFirewallStatus.DeserializeWebApplicationFirewallStatus(property.Value, options); + webApplicationFirewallStatus = WebApplicationFirewallStatus.DeserializeWebApplicationFirewallStatus(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentPropertiesNginxAppProtect(webApplicationFirewallSettings, webApplicationFirewallStatus, serializedAdditionalRawData); + return new NginxDeploymentPropertiesNginxAppProtect(webApplicationFirewallSettings, webApplicationFirewallStatus, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -120,15 +131,20 @@ BinaryData IPersistableModel.Write(Mod } } - NginxDeploymentPropertiesNginxAppProtect IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentPropertiesNginxAppProtect IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentPropertiesNginxAppProtect PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentPropertiesNginxAppProtect(document.RootElement, options); } default: @@ -136,6 +152,7 @@ NginxDeploymentPropertiesNginxAppProtect IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.cs index aa5ad4b25ed8..699e4d698217 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPropertiesNginxAppProtect.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// Settings for NGINX App Protect (NAP). public partial class NginxDeploymentPropertiesNginxAppProtect { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Settings for the NGINX App Protect Web Application Firewall (WAF). @@ -58,34 +30,35 @@ public NginxDeploymentPropertiesNginxAppProtect(WebApplicationFirewallSettings w /// Initializes a new instance of . /// Settings for the NGINX App Protect Web Application Firewall (WAF). /// The status of the NGINX App Protect Web Application Firewall. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentPropertiesNginxAppProtect(WebApplicationFirewallSettings webApplicationFirewallSettings, WebApplicationFirewallStatus webApplicationFirewallStatus, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentPropertiesNginxAppProtect(WebApplicationFirewallSettings webApplicationFirewallSettings, WebApplicationFirewallStatus webApplicationFirewallStatus, IDictionary additionalBinaryDataProperties) { WebApplicationFirewallSettings = webApplicationFirewallSettings; WebApplicationFirewallStatus = webApplicationFirewallStatus; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxDeploymentPropertiesNginxAppProtect() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Settings for the NGINX App Protect Web Application Firewall (WAF). internal WebApplicationFirewallSettings WebApplicationFirewallSettings { get; set; } + + /// The status of the NGINX App Protect Web Application Firewall. + public WebApplicationFirewallStatus WebApplicationFirewallStatus { get; } + /// The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. public WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { - get => WebApplicationFirewallSettings is null ? default : WebApplicationFirewallSettings.ActivationState; + get + { + return WebApplicationFirewallSettings is null ? default : WebApplicationFirewallSettings.ActivationState; + } set { if (WebApplicationFirewallSettings is null) + { WebApplicationFirewallSettings = new WebApplicationFirewallSettings(); + } WebApplicationFirewallSettings.ActivationState = value; } } - - /// The status of the NGINX App Protect Web Application Firewall. - public WebApplicationFirewallStatus WebApplicationFirewallStatus { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.Serialization.cs index db3e384885ba..994dfe69f4e2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentScalingProperties : IUtf8JsonSerializable, IJsonModel + /// Information on how the deployment will be scaled. + public partial class NginxDeploymentScalingProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,39 +29,30 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentScalingProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Capacity)) { writer.WritePropertyName("capacity"u8); writer.WriteNumberValue(Capacity.Value); } - writer.WritePropertyName("autoScaleSettings"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Profiles)) + if (Optional.IsDefined(AutoScaleSettings)) { - writer.WritePropertyName("profiles"u8); - writer.WriteStartArray(); - foreach (var item in Profiles) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WritePropertyName("autoScaleSettings"u8); + writer.WriteObjectValue(AutoScaleSettings, options); } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,80 +61,69 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentScalingProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentScalingProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentScalingProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentScalingProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentScalingProperties(document.RootElement, options); } - internal static NginxDeploymentScalingProperties DeserializeNginxDeploymentScalingProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentScalingProperties DeserializeNginxDeploymentScalingProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int? capacity = default; - IList profiles = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + NginxDeploymentAutoScaleSettings autoScaleSettings = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("capacity"u8)) + if (prop.NameEquals("capacity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - capacity = property.Value.GetInt32(); + capacity = prop.Value.GetInt32(); continue; } - if (property.NameEquals("autoScaleSettings"u8)) + if (prop.NameEquals("autoScaleSettings"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("profiles"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NginxScaleProfile.DeserializeNginxScaleProfile(item, options)); - } - profiles = array; - continue; - } - } + autoScaleSettings = NginxDeploymentAutoScaleSettings.DeserializeNginxDeploymentAutoScaleSettings(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentScalingProperties(capacity, profiles ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NginxDeploymentScalingProperties(capacity, autoScaleSettings, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -152,15 +133,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - NginxDeploymentScalingProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentScalingProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentScalingProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentScalingProperties(document.RootElement, options); } default: @@ -168,6 +154,7 @@ NginxDeploymentScalingProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.cs index 1be09b0da1c8..0da3d87c702a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentScalingProperties.cs @@ -13,58 +13,38 @@ namespace Azure.ResourceManager.Nginx.Models /// Information on how the deployment will be scaled. public partial class NginxDeploymentScalingProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentScalingProperties() { - Profiles = new ChangeTrackingList(); } /// Initializes a new instance of . /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentScalingProperties(int? capacity, IList profiles, IDictionary serializedAdditionalRawData) + /// The settings for enabling automatic scaling of the deployment. If this field is specified, 'scale.capacity' must be empty. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentScalingProperties(int? capacity, NginxDeploymentAutoScaleSettings autoScaleSettings, IDictionary additionalBinaryDataProperties) { Capacity = capacity; - Profiles = profiles; - _serializedAdditionalRawData = serializedAdditionalRawData; + AutoScaleSettings = autoScaleSettings; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the capacity. + /// Gets or sets the Capacity. public int? Capacity { get; set; } - /// Gets the profiles. - public IList Profiles { get; } + + /// The settings for enabling automatic scaling of the deployment. If this field is specified, 'scale.capacity' must be empty. + internal NginxDeploymentAutoScaleSettings AutoScaleSettings { get; set; } + + /// Gets the Profiles. + public IList Profiles + { + get + { + return AutoScaleSettings is null ? default : AutoScaleSettings.Profiles; + } + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.Serialization.cs index b89406decd51..ea0295c402a3 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentUpdateProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Update Properties. + public partial class NginxDeploymentUpdateProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentUpdateProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(EnableDiagnosticsSupport)) { writer.WritePropertyName("enableDiagnosticsSupport"u8); @@ -69,15 +69,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nginxAppProtect"u8); writer.WriteObjectValue(NginxAppProtect, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -86,22 +86,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentUpdateProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentUpdateProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentUpdateProperties(document.RootElement, options); } - internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdateProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -113,79 +118,77 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate NginxNetworkProfile networkProfile = default; AutoUpgradeProfile autoUpgradeProfile = default; NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("enableDiagnosticsSupport"u8)) + if (prop.NameEquals("enableDiagnosticsSupport"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - enableDiagnosticsSupport = property.Value.GetBoolean(); + enableDiagnosticsSupport = prop.Value.GetBoolean(); continue; } - if (property.NameEquals("logging"u8)) + if (prop.NameEquals("logging"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - logging = NginxLogging.DeserializeNginxLogging(property.Value, options); + logging = NginxLogging.DeserializeNginxLogging(prop.Value, options); continue; } - if (property.NameEquals("scalingProperties"u8)) + if (prop.NameEquals("scalingProperties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - scalingProperties = NginxDeploymentScalingProperties.DeserializeNginxDeploymentScalingProperties(property.Value, options); + scalingProperties = NginxDeploymentScalingProperties.DeserializeNginxDeploymentScalingProperties(prop.Value, options); continue; } - if (property.NameEquals("userProfile"u8)) + if (prop.NameEquals("userProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - userProfile = NginxDeploymentUserProfile.DeserializeNginxDeploymentUserProfile(property.Value, options); + userProfile = NginxDeploymentUserProfile.DeserializeNginxDeploymentUserProfile(prop.Value, options); continue; } - if (property.NameEquals("networkProfile"u8)) + if (prop.NameEquals("networkProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - networkProfile = NginxNetworkProfile.DeserializeNginxNetworkProfile(property.Value, options); + networkProfile = NginxNetworkProfile.DeserializeNginxNetworkProfile(prop.Value, options); continue; } - if (property.NameEquals("autoUpgradeProfile"u8)) + if (prop.NameEquals("autoUpgradeProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - autoUpgradeProfile = AutoUpgradeProfile.DeserializeAutoUpgradeProfile(property.Value, options); + autoUpgradeProfile = AutoUpgradeProfile.DeserializeAutoUpgradeProfile(prop.Value, options); continue; } - if (property.NameEquals("nginxAppProtect"u8)) + if (prop.NameEquals("nginxAppProtect"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nginxAppProtect = NginxDeploymentUpdatePropertiesNginxAppProtect.DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(property.Value, options); + nginxAppProtect = NginxDeploymentUpdatePropertiesNginxAppProtect.DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDeploymentUpdateProperties( enableDiagnosticsSupport, logging, @@ -194,13 +197,16 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate networkProfile, autoUpgradeProfile, nginxAppProtect, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -210,15 +216,20 @@ BinaryData IPersistableModel.Write(ModelReaderW } } - NginxDeploymentUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentUpdateProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentUpdateProperties(document.RootElement, options); } default: @@ -226,6 +237,7 @@ NginxDeploymentUpdateProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs index 3c2759835cf0..d6723d60bffd 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentUpdateProperties. + /// Nginx Deployment Update Properties. public partial class NginxDeploymentUpdateProperties { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentUpdateProperties() @@ -52,14 +23,14 @@ public NginxDeploymentUpdateProperties() /// Initializes a new instance of . /// - /// + /// Nginx Logging. /// Information on how the deployment will be scaled. - /// - /// + /// Nginx Deployment User Profile. + /// Nginx Network Profile. /// Autoupgrade settings of a deployment. /// Update settings for NGINX App Protect (NAP). - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLogging logging, NginxDeploymentScalingProperties scalingProperties, NginxDeploymentUserProfile userProfile, NginxNetworkProfile networkProfile, AutoUpgradeProfile autoUpgradeProfile, NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLogging logging, NginxDeploymentScalingProperties scalingProperties, NginxDeploymentUserProfile userProfile, NginxNetworkProfile networkProfile, AutoUpgradeProfile autoUpgradeProfile, NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect, IDictionary additionalBinaryDataProperties) { EnableDiagnosticsSupport = enableDiagnosticsSupport; Logging = logging; @@ -68,63 +39,91 @@ internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLo NetworkProfile = networkProfile; AutoUpgradeProfile = autoUpgradeProfile; NginxAppProtect = nginxAppProtect; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the enable diagnostics support. + /// Gets or sets the EnableDiagnosticsSupport. public bool? EnableDiagnosticsSupport { get; set; } - /// Gets or sets the logging. + + /// Nginx Logging. internal NginxLogging Logging { get; set; } - /// Gets or sets the logging storage account. + + /// Information on how the deployment will be scaled. + public NginxDeploymentScalingProperties ScalingProperties { get; set; } + + /// Nginx Deployment User Profile. + internal NginxDeploymentUserProfile UserProfile { get; set; } + + /// Nginx Network Profile. + public NginxNetworkProfile NetworkProfile { get; set; } + + /// Autoupgrade settings of a deployment. + internal AutoUpgradeProfile AutoUpgradeProfile { get; set; } + + /// Update settings for NGINX App Protect (NAP). + internal NginxDeploymentUpdatePropertiesNginxAppProtect NginxAppProtect { get; set; } + + /// Nginx Storage Account. public NginxStorageAccount LoggingStorageAccount { - get => Logging is null ? default : Logging.StorageAccount; + get + { + return Logging is null ? default : Logging.StorageAccount; + } set { if (Logging is null) + { Logging = new NginxLogging(); + } Logging.StorageAccount = value; } } - /// Information on how the deployment will be scaled. - public NginxDeploymentScalingProperties ScalingProperties { get; set; } - /// Gets or sets the user profile. - internal NginxDeploymentUserProfile UserProfile { get; set; } /// The preferred support contact email address of the user used for sending alerts and notification. Can be an empty string or a valid email address. public string UserPreferredEmail { - get => UserProfile is null ? default : UserProfile.PreferredEmail; + get + { + return UserProfile is null ? default : UserProfile.PreferredEmail; + } set { if (UserProfile is null) + { UserProfile = new NginxDeploymentUserProfile(); + } UserProfile.PreferredEmail = value; } } - /// Gets or sets the network profile. - public NginxNetworkProfile NetworkProfile { get; set; } - /// Autoupgrade settings of a deployment. - internal AutoUpgradeProfile AutoUpgradeProfile { get; set; } /// Channel used for autoupgrade. public string UpgradeChannel { - get => AutoUpgradeProfile is null ? default : AutoUpgradeProfile.UpgradeChannel; - set => AutoUpgradeProfile = new AutoUpgradeProfile(value); + get + { + return AutoUpgradeProfile is null ? default : AutoUpgradeProfile.UpgradeChannel; + } + set + { + AutoUpgradeProfile = new AutoUpgradeProfile(value); + } } - /// Update settings for NGINX App Protect (NAP). - internal NginxDeploymentUpdatePropertiesNginxAppProtect NginxAppProtect { get; set; } /// The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. public WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { - get => NginxAppProtect is null ? default : NginxAppProtect.WebApplicationFirewallActivationState; + get + { + return NginxAppProtect is null ? default : NginxAppProtect.WebApplicationFirewallActivationState; + } set { if (NginxAppProtect is null) + { NginxAppProtect = new NginxDeploymentUpdatePropertiesNginxAppProtect(); - NginxAppProtect.WebApplicationFirewallActivationState = value; + } + NginxAppProtect.WebApplicationFirewallActivationState = value.Value; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs index e2cb927f18b6..1de523e0dba4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxDeploymentUpdatePropertiesNginxAppProtect : IUtf8JsonSerializable, IJsonModel + /// Update settings for NGINX App Protect (NAP). + internal partial class NginxDeploymentUpdatePropertiesNginxAppProtect : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +29,25 @@ void IJsonModel.Write(Utf8JsonWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentUpdatePropertiesNginxAppProtect)} does not support writing '{format}' format."); } - if (Optional.IsDefined(WebApplicationFirewallSettings)) { writer.WritePropertyName("webApplicationFirewallSettings"u8); writer.WriteObjectValue(WebApplicationFirewallSettings, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +56,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentUpdatePropertiesNginxAppProtect IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentUpdatePropertiesNginxAppProtect IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentUpdatePropertiesNginxAppProtect JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentUpdatePropertiesNginxAppProtect)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(document.RootElement, options); } - internal static NginxDeploymentUpdatePropertiesNginxAppProtect DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentUpdatePropertiesNginxAppProtect DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } WebApplicationFirewallSettings webApplicationFirewallSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("webApplicationFirewallSettings"u8)) + if (prop.NameEquals("webApplicationFirewallSettings"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(property.Value, options); + webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentUpdatePropertiesNginxAppProtect(webApplicationFirewallSettings, serializedAdditionalRawData); + return new NginxDeploymentUpdatePropertiesNginxAppProtect(webApplicationFirewallSettings, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +118,20 @@ BinaryData IPersistableModel.Wri } } - NginxDeploymentUpdatePropertiesNginxAppProtect IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentUpdatePropertiesNginxAppProtect IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentUpdatePropertiesNginxAppProtect PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(document.RootElement, options); } default: @@ -128,6 +139,7 @@ NginxDeploymentUpdatePropertiesNginxAppProtect IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs index f66eb6a105f4..e59337d8f173 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Update settings for NGINX App Protect (NAP). internal partial class NginxDeploymentUpdatePropertiesNginxAppProtect { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentUpdatePropertiesNginxAppProtect() @@ -52,23 +23,29 @@ public NginxDeploymentUpdatePropertiesNginxAppProtect() /// Initializes a new instance of . /// Settings for the NGINX App Protect Web Application Firewall (WAF). - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentUpdatePropertiesNginxAppProtect(WebApplicationFirewallSettings webApplicationFirewallSettings, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentUpdatePropertiesNginxAppProtect(WebApplicationFirewallSettings webApplicationFirewallSettings, IDictionary additionalBinaryDataProperties) { WebApplicationFirewallSettings = webApplicationFirewallSettings; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Settings for the NGINX App Protect Web Application Firewall (WAF). internal WebApplicationFirewallSettings WebApplicationFirewallSettings { get; set; } + /// The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. public WebApplicationFirewallActivationState? WebApplicationFirewallActivationState { - get => WebApplicationFirewallSettings is null ? default : WebApplicationFirewallSettings.ActivationState; + get + { + return WebApplicationFirewallSettings is null ? default : WebApplicationFirewallSettings.ActivationState; + } set { if (WebApplicationFirewallSettings is null) + { WebApplicationFirewallSettings = new WebApplicationFirewallSettings(); + } WebApplicationFirewallSettings.ActivationState = value; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.Serialization.cs index 97496f55d352..3e8a46f611bf 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxDeploymentUserProfile : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment User Profile. + internal partial class NginxDeploymentUserProfile : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +29,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentUserProfile)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PreferredEmail)) { writer.WritePropertyName("preferredEmail"u8); writer.WriteStringValue(PreferredEmail); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,49 +56,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentUserProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentUserProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentUserProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentUserProfile)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentUserProfile(document.RootElement, options); } - internal static NginxDeploymentUserProfile DeserializeNginxDeploymentUserProfile(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentUserProfile DeserializeNginxDeploymentUserProfile(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string preferredEmail = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("preferredEmail"u8)) + if (prop.NameEquals("preferredEmail"u8)) { - preferredEmail = property.Value.GetString(); + preferredEmail = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentUserProfile(preferredEmail, serializedAdditionalRawData); + return new NginxDeploymentUserProfile(preferredEmail, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -108,15 +114,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - NginxDeploymentUserProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentUserProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentUserProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentUserProfile(document.RootElement, options); } default: @@ -124,6 +135,7 @@ NginxDeploymentUserProfile IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs index 1eddead15c40..1bb6a7fd8fdb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentUserProfile. + /// Nginx Deployment User Profile. internal partial class NginxDeploymentUserProfile { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxDeploymentUserProfile() @@ -52,11 +23,11 @@ public NginxDeploymentUserProfile() /// Initializes a new instance of . /// The preferred support contact email address of the user used for sending alerts and notification. Can be an empty string or a valid email address. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentUserProfile(string preferredEmail, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentUserProfile(string preferredEmail, IDictionary additionalBinaryDataProperties) { PreferredEmail = preferredEmail; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The preferred support contact email address of the user used for sending alerts and notification. Can be an empty string or a valid email address. diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.Serialization.cs new file mode 100644 index 000000000000..13587dc19e21 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Applying Status. + public partial class NginxDeploymentWafPolicyApplyingStatus : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyApplyingStatus)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DisplayStatus)) + { + writer.WritePropertyName("displayStatus"u8); + writer.WriteStringValue(DisplayStatus); + } + if (options.Format != "W" && Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyApplyingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyApplyingStatus JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyApplyingStatus)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyApplyingStatus(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyApplyingStatus DeserializeNginxDeploymentWafPolicyApplyingStatus(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxDeploymentWafPolicyApplyingStatusCode? code = default; + string displayStatus = default; + string time = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("code"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new NginxDeploymentWafPolicyApplyingStatusCode(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("displayStatus"u8)) + { + displayStatus = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("time"u8)) + { + time = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyApplyingStatus)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyApplyingStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyApplyingStatus PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyApplyingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyApplyingStatus)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs new file mode 100644 index 000000000000..220681c470ef --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Applying Status. + public partial class NginxDeploymentWafPolicyApplyingStatus + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal NginxDeploymentWafPolicyApplyingStatus() + { + } + + /// Initializes a new instance of . + /// Machine readable code indicating the applying status code of a WAF Policy. + /// A readable string of the current status, and sometimes have the reason for the current state. + /// The date and time in UTC the current applying status was set. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyApplyingStatus(NginxDeploymentWafPolicyApplyingStatusCode? code, string displayStatus, string time, IDictionary additionalBinaryDataProperties) + { + Code = code; + DisplayStatus = displayStatus; + Time = time; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Machine readable code indicating the applying status code of a WAF Policy. + public NginxDeploymentWafPolicyApplyingStatusCode? Code { get; } + + /// A readable string of the current status, and sometimes have the reason for the current state. + public string DisplayStatus { get; } + + /// The date and time in UTC the current applying status was set. + public string Time { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs new file mode 100644 index 000000000000..c6ef5af44d7a --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Machine readable code indicating the applying status code of a WAF Policy. + public readonly partial struct NginxDeploymentWafPolicyApplyingStatusCode : IEquatable + { + private readonly string _value; + /// The policy is not referenced in the nginx config and not applied. + private const string NotAppliedValue = "NotApplied"; + /// The policy is referenced in the nginx config and is applying. + private const string ApplyingValue = "Applying"; + /// The policy is referenced in the nginx config and that config has been successfully applied. + private const string SucceededValue = "Succeeded"; + /// The policy is referenced in the nginx config and that config failed to apply. + private const string FailedValue = "Failed"; + /// The policy is now not referenced in the nginx config and its being removed from the applied nginx config. + private const string RemovingValue = "Removing"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public NginxDeploymentWafPolicyApplyingStatusCode(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// The policy is not referenced in the nginx config and not applied. + public static NginxDeploymentWafPolicyApplyingStatusCode NotApplied { get; } = new NginxDeploymentWafPolicyApplyingStatusCode(NotAppliedValue); + + /// The policy is referenced in the nginx config and is applying. + public static NginxDeploymentWafPolicyApplyingStatusCode Applying { get; } = new NginxDeploymentWafPolicyApplyingStatusCode(ApplyingValue); + + /// The policy is referenced in the nginx config and that config has been successfully applied. + public static NginxDeploymentWafPolicyApplyingStatusCode Succeeded { get; } = new NginxDeploymentWafPolicyApplyingStatusCode(SucceededValue); + + /// The policy is referenced in the nginx config and that config failed to apply. + public static NginxDeploymentWafPolicyApplyingStatusCode Failed { get; } = new NginxDeploymentWafPolicyApplyingStatusCode(FailedValue); + + /// The policy is now not referenced in the nginx config and its being removed from the applied nginx config. + public static NginxDeploymentWafPolicyApplyingStatusCode Removing { get; } = new NginxDeploymentWafPolicyApplyingStatusCode(RemovingValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(NginxDeploymentWafPolicyApplyingStatusCode left, NginxDeploymentWafPolicyApplyingStatusCode right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(NginxDeploymentWafPolicyApplyingStatusCode left, NginxDeploymentWafPolicyApplyingStatusCode right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator NginxDeploymentWafPolicyApplyingStatusCode(string value) => new NginxDeploymentWafPolicyApplyingStatusCode(value); + + /// Converts a string to a . + /// The value. + public static implicit operator NginxDeploymentWafPolicyApplyingStatusCode?(string value) => value == null ? null : new NginxDeploymentWafPolicyApplyingStatusCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NginxDeploymentWafPolicyApplyingStatusCode other && Equals(other); + + /// + public bool Equals(NginxDeploymentWafPolicyApplyingStatusCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + + /// + public override string ToString() => _value; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.Serialization.cs new file mode 100644 index 000000000000..a4701dd58447 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Compiling Status. + public partial class NginxDeploymentWafPolicyCompilingStatus : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyCompilingStatus)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DisplayStatus)) + { + writer.WritePropertyName("displayStatus"u8); + writer.WriteStringValue(DisplayStatus); + } + if (options.Format != "W" && Optional.IsDefined(Time)) + { + writer.WritePropertyName("time"u8); + writer.WriteStringValue(Time); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyCompilingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyCompilingStatus JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyCompilingStatus)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyCompilingStatus(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyCompilingStatus DeserializeNginxDeploymentWafPolicyCompilingStatus(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxDeploymentWafPolicyCompilingStatusCode? code = default; + string displayStatus = default; + string time = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("code"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new NginxDeploymentWafPolicyCompilingStatusCode(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("displayStatus"u8)) + { + displayStatus = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("time"u8)) + { + time = prop.Value.GetString(); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyCompilingStatus)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyCompilingStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyCompilingStatus PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyCompilingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyCompilingStatus)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs new file mode 100644 index 000000000000..4fb8b78f925b --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Compiling Status. + public partial class NginxDeploymentWafPolicyCompilingStatus + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal NginxDeploymentWafPolicyCompilingStatus() + { + } + + /// Initializes a new instance of . + /// Machine readable code indicating the compilation status of a WAF Policy. + /// A readable string of the current status, and sometimes have the reason for the current state. If the CompilingStatus is Failed the Display Status will be The waf Policy failed to compile. + /// The date and time the policy was compiled in UTC. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyCompilingStatus(NginxDeploymentWafPolicyCompilingStatusCode? code, string displayStatus, string time, IDictionary additionalBinaryDataProperties) + { + Code = code; + DisplayStatus = displayStatus; + Time = time; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Machine readable code indicating the compilation status of a WAF Policy. + public NginxDeploymentWafPolicyCompilingStatusCode? Code { get; } + + /// A readable string of the current status, and sometimes have the reason for the current state. If the CompilingStatus is Failed the Display Status will be The waf Policy failed to compile. + public string DisplayStatus { get; } + + /// The date and time the policy was compiled in UTC. + public string Time { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs new file mode 100644 index 000000000000..7fb67985598c --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Machine readable code indicating the compilation status of a WAF Policy. + public readonly partial struct NginxDeploymentWafPolicyCompilingStatusCode : IEquatable + { + private readonly string _value; + /// The compilation of the custom waf policy has not started. + private const string NotStartedValue = "NotStarted"; + /// The compilation of the custom waf policy is in progress. + private const string InProgressValue = "InProgress"; + /// The compilation of the custom waf policy is completed successfully and can now be referenced in the nginx config. + private const string SucceededValue = "Succeeded"; + /// The compilation of the custom waf policy failed. + private const string FailedValue = "Failed"; + + /// Initializes a new instance of . + /// The value. + /// is null. + public NginxDeploymentWafPolicyCompilingStatusCode(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// The compilation of the custom waf policy has not started. + public static NginxDeploymentWafPolicyCompilingStatusCode NotStarted { get; } = new NginxDeploymentWafPolicyCompilingStatusCode(NotStartedValue); + + /// The compilation of the custom waf policy is in progress. + public static NginxDeploymentWafPolicyCompilingStatusCode InProgress { get; } = new NginxDeploymentWafPolicyCompilingStatusCode(InProgressValue); + + /// The compilation of the custom waf policy is completed successfully and can now be referenced in the nginx config. + public static NginxDeploymentWafPolicyCompilingStatusCode Succeeded { get; } = new NginxDeploymentWafPolicyCompilingStatusCode(SucceededValue); + + /// The compilation of the custom waf policy failed. + public static NginxDeploymentWafPolicyCompilingStatusCode Failed { get; } = new NginxDeploymentWafPolicyCompilingStatusCode(FailedValue); + + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator ==(NginxDeploymentWafPolicyCompilingStatusCode left, NginxDeploymentWafPolicyCompilingStatusCode right) => left.Equals(right); + + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. + public static bool operator !=(NginxDeploymentWafPolicyCompilingStatusCode left, NginxDeploymentWafPolicyCompilingStatusCode right) => !left.Equals(right); + + /// Converts a string to a . + /// The value. + public static implicit operator NginxDeploymentWafPolicyCompilingStatusCode(string value) => new NginxDeploymentWafPolicyCompilingStatusCode(value); + + /// Converts a string to a . + /// The value. + public static implicit operator NginxDeploymentWafPolicyCompilingStatusCode?(string value) => value == null ? null : new NginxDeploymentWafPolicyCompilingStatusCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NginxDeploymentWafPolicyCompilingStatusCode other && Equals(other); + + /// + public bool Equals(NginxDeploymentWafPolicyCompilingStatusCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + + /// + public override string ToString() => _value; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.Serialization.cs new file mode 100644 index 000000000000..201658da6633 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy List Response. + internal partial class NginxDeploymentWafPolicyListResponse : IJsonModel + { + /// Initializes a new instance of for deserialization. + internal NginxDeploymentWafPolicyListResponse() + { + } + + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyListResponse)} does not support writing '{format}' format."); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (NginxDeploymentWafPolicyMetadata item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyListResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyListResponse)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyListResponse DeserializeNginxDeploymentWafPolicyListResponse(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList value = default; + Uri nextLink = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + array.Add(NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(item, options)); + } + value = array; + continue; + } + if (prop.NameEquals("nextLink"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyListResponse(value, nextLink, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyListResponse)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyListResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyListResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyListResponse)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxDeploymentWafPolicyListResponse FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, ModelSerializationExtensions.WireOptions); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs new file mode 100644 index 000000000000..7b9bb755d722 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy List Response. + internal partial class NginxDeploymentWafPolicyListResponse + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + /// The NginxDeploymentWafPolicyMetadata items on this page. + internal NginxDeploymentWafPolicyListResponse(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NginxDeploymentWafPolicyMetadata items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) + { + Value = value; + NextLink = nextLink; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The NginxDeploymentWafPolicyMetadata items on this page. + public IList Value { get; } + + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs new file mode 100644 index 000000000000..68d54045a963 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Metadata. + public partial class NginxDeploymentWafPolicyMetadata : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadata)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + ((IJsonModel)SystemData).Write(writer, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyMetadata JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadata)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyMetadata(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyMetadata DeserializeNginxDeploymentWafPolicyMetadata(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + string @type = default; + NginxDeploymentWafPolicyMetadataProperties properties = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + id = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + @type = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxDeploymentWafPolicyMetadataProperties.DeserializeNginxDeploymentWafPolicyMetadataProperties(prop.Value, options); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyMetadata( + id, + name, + @type, + properties, + systemData, + additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadata)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyMetadata PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadata)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs new file mode 100644 index 000000000000..a6831071c405 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Metadata. + public partial class NginxDeploymentWafPolicyMetadata + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal NginxDeploymentWafPolicyMetadata() + { + } + + /// Initializes a new instance of . + /// + /// + /// + /// Nginx Deployment Waf Policy Metadata Properties. + /// Metadata pertaining to creation and last modification of the resource. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyMetadata(string id, string name, string @type, NginxDeploymentWafPolicyMetadataProperties properties, SystemData systemData, IDictionary additionalBinaryDataProperties) + { + Id = id; + Name = name; + Type = @type; + Properties = properties; + SystemData = systemData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Gets the Id. + public string Id { get; } + + /// Gets the Name. + public string Name { get; } + + /// Gets the Type. + public string Type { get; } + + /// Nginx Deployment Waf Policy Metadata Properties. + public NginxDeploymentWafPolicyMetadataProperties Properties { get; } + + /// Metadata pertaining to creation and last modification of the resource. + public SystemData SystemData { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.Serialization.cs new file mode 100644 index 000000000000..eea8fb15fe25 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Metadata Properties. + public partial class NginxDeploymentWafPolicyMetadataProperties : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadataProperties)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(Filepath)) + { + writer.WritePropertyName("filepath"u8); + writer.WriteStringValue(Filepath); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CompilingState)) + { + writer.WritePropertyName("compilingState"u8); + writer.WriteObjectValue(CompilingState, options); + } + if (options.Format != "W" && Optional.IsDefined(ApplyingState)) + { + writer.WritePropertyName("applyingState"u8); + writer.WriteObjectValue(ApplyingState, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyMetadataProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyMetadataProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadataProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyMetadataProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyMetadataProperties DeserializeNginxDeploymentWafPolicyMetadataProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string filepath = default; + NginxProvisioningState? provisioningState = default; + NginxDeploymentWafPolicyCompilingStatus compilingState = default; + NginxDeploymentWafPolicyApplyingStatus applyingState = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("filepath"u8)) + { + filepath = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NginxProvisioningState(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("compilingState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(prop.Value, options); + continue; + } + if (prop.NameEquals("applyingState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadataProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyMetadataProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyMetadataProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyMetadataProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadataProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs new file mode 100644 index 000000000000..bb37f71dd5ad --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Metadata Properties. + public partial class NginxDeploymentWafPolicyMetadataProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + internal NginxDeploymentWafPolicyMetadataProperties() + { + } + + /// Initializes a new instance of . + /// + /// Provisioning State. + /// Nginx Deployment Waf Policy Compiling Status. + /// Nginx Deployment Waf Policy Applying Status. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyMetadataProperties(string filepath, NginxProvisioningState? provisioningState, NginxDeploymentWafPolicyCompilingStatus compilingState, NginxDeploymentWafPolicyApplyingStatus applyingState, IDictionary additionalBinaryDataProperties) + { + Filepath = filepath; + ProvisioningState = provisioningState; + CompilingState = compilingState; + ApplyingState = applyingState; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Gets the Filepath. + public string Filepath { get; } + + /// Provisioning State. + public NginxProvisioningState? ProvisioningState { get; } + + /// Nginx Deployment Waf Policy Compiling Status. + public NginxDeploymentWafPolicyCompilingStatus CompilingState { get; } + + /// Nginx Deployment Waf Policy Applying Status. + public NginxDeploymentWafPolicyApplyingStatus ApplyingState { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.Serialization.cs new file mode 100644 index 000000000000..ee4edb1079e9 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.ResourceManager.Nginx; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Properties. + public partial class NginxDeploymentWafPolicyProperties : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyProperties)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteBase64StringValue(Content.ToArray(), "D"); + } + if (Optional.IsDefined(Filepath)) + { + writer.WritePropertyName("filepath"u8); + writer.WriteStringValue(Filepath); + } + if (options.Format != "W" && Optional.IsDefined(CompilingState)) + { + writer.WritePropertyName("compilingState"u8); + writer.WriteObjectValue(CompilingState, options); + } + if (options.Format != "W" && Optional.IsDefined(ApplyingState)) + { + writer.WritePropertyName("applyingState"u8); + writer.WriteObjectValue(ApplyingState, options); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyProperties)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyProperties(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyProperties DeserializeNginxDeploymentWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxProvisioningState? provisioningState = default; + BinaryData content = default; + string filepath = default; + NginxDeploymentWafPolicyCompilingStatus compilingState = default; + NginxDeploymentWafPolicyApplyingStatus applyingState = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("provisioningState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NginxProvisioningState(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("content"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = BinaryData.FromBytes(prop.Value.GetBytesFromBase64("D")); + continue; + } + if (prop.NameEquals("filepath"u8)) + { + filepath = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("compilingState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(prop.Value, options); + continue; + } + if (prop.NameEquals("applyingState"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyProperties( + provisioningState, + content, + filepath, + compilingState, + applyingState, + additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDeploymentWafPolicyProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs new file mode 100644 index 000000000000..83fd56ca64ad --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Properties. + public partial class NginxDeploymentWafPolicyProperties + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public NginxDeploymentWafPolicyProperties() + { + } + + /// Initializes a new instance of . + /// Provisioning State. + /// The byte content of the Policy. + /// The file path where the Policy is to be saved. + /// Nginx Deployment Waf Policy Compiling Status. + /// Nginx Deployment Waf Policy Applying Status. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyProperties(NginxProvisioningState? provisioningState, BinaryData content, string filepath, NginxDeploymentWafPolicyCompilingStatus compilingState, NginxDeploymentWafPolicyApplyingStatus applyingState, IDictionary additionalBinaryDataProperties) + { + ProvisioningState = provisioningState; + Content = content; + Filepath = filepath; + CompilingState = compilingState; + ApplyingState = applyingState; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// Provisioning State. + public NginxProvisioningState? ProvisioningState { get; } + + /// + /// The byte content of the Policy + /// + /// To assign a byte[] to this property use . + /// The byte[] will be serialized to a Base64 encoded string. + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromBytes(new byte[] { 1, 2, 3 }). + /// Creates a payload of "AQID". + /// + /// + /// + /// + public BinaryData Content { get; set; } + + /// The file path where the Policy is to be saved. + public string Filepath { get; set; } + + /// Nginx Deployment Waf Policy Compiling Status. + public NginxDeploymentWafPolicyCompilingStatus CompilingState { get; } + + /// Nginx Deployment Waf Policy Applying Status. + public NginxDeploymentWafPolicyApplyingStatus ApplyingState { get; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.Serialization.cs index e1e60c834bc5..1c6316d98313 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDiagnosticItem : IUtf8JsonSerializable, IJsonModel + /// A diagnostic is a message associated with an NGINX config. The Analyzer returns diagnostics with a level indicating the importance of the diagnostic with optional category. + public partial class NginxDiagnosticItem : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxDiagnosticItem() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDiagnosticItem)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -58,15 +63,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("category"u8); writer.WriteStringValue(Category); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,22 +80,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDiagnosticItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDiagnosticItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxDiagnosticItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDiagnosticItem)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDiagnosticItem(document.RootElement, options); } - internal static NginxDiagnosticItem DeserializeNginxDiagnosticItem(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDiagnosticItem DeserializeNginxDiagnosticItem(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -98,84 +108,85 @@ internal static NginxDiagnosticItem DeserializeNginxDiagnosticItem(JsonElement e string id = default; string directive = default; string description = default; - string file = default; + string @file = default; float line = default; string message = default; string rule = default; NginxDiagnosticLevel level = default; string category = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("id"u8)) + if (prop.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = prop.Value.GetString(); continue; } - if (property.NameEquals("directive"u8)) + if (prop.NameEquals("directive"u8)) { - directive = property.Value.GetString(); + directive = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("file"u8)) + if (prop.NameEquals("file"u8)) { - file = property.Value.GetString(); + @file = prop.Value.GetString(); continue; } - if (property.NameEquals("line"u8)) + if (prop.NameEquals("line"u8)) { - line = property.Value.GetSingle(); + line = prop.Value.GetSingle(); continue; } - if (property.NameEquals("message"u8)) + if (prop.NameEquals("message"u8)) { - message = property.Value.GetString(); + message = prop.Value.GetString(); continue; } - if (property.NameEquals("rule"u8)) + if (prop.NameEquals("rule"u8)) { - rule = property.Value.GetString(); + rule = prop.Value.GetString(); continue; } - if (property.NameEquals("level"u8)) + if (prop.NameEquals("level"u8)) { - level = new NginxDiagnosticLevel(property.Value.GetString()); + level = new NginxDiagnosticLevel(prop.Value.GetString()); continue; } - if (property.NameEquals("category"u8)) + if (prop.NameEquals("category"u8)) { - category = property.Value.GetString(); + category = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDiagnosticItem( id, directive, description, - file, + @file, line, message, rule, level, category, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -185,15 +196,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - NginxDiagnosticItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDiagnosticItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxDiagnosticItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDiagnosticItem(document.RootElement, options); } default: @@ -201,6 +217,7 @@ NginxDiagnosticItem IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.cs index 348cf461d766..1d54b51bdd3c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticItem.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// A diagnostic is a message associated with an NGINX config. The Analyzer returns diagnostics with a level indicating the importance of the diagnostic with optional category. public partial class NginxDiagnosticItem { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// @@ -53,18 +24,11 @@ public partial class NginxDiagnosticItem /// /// /// Warning or Info. - /// , , , or is null. - internal NginxDiagnosticItem(string directive, string description, string file, float line, string message, string rule, NginxDiagnosticLevel level) + internal NginxDiagnosticItem(string directive, string description, string @file, float line, string message, string rule, NginxDiagnosticLevel level) { - Argument.AssertNotNull(directive, nameof(directive)); - Argument.AssertNotNull(description, nameof(description)); - Argument.AssertNotNull(file, nameof(file)); - Argument.AssertNotNull(message, nameof(message)); - Argument.AssertNotNull(rule, nameof(rule)); - Directive = directive; Description = description; - File = file; + File = @file; Line = line; Message = message; Rule = rule; @@ -81,42 +45,45 @@ internal NginxDiagnosticItem(string directive, string description, string file, /// /// Warning or Info. /// Category of warning like Best-practices, Recommendation, Security etc. - /// Keeps track of any properties unknown to the library. - internal NginxDiagnosticItem(string id, string directive, string description, string file, float line, string message, string rule, NginxDiagnosticLevel level, string category, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDiagnosticItem(string id, string directive, string description, string @file, float line, string message, string rule, NginxDiagnosticLevel level, string category, IDictionary additionalBinaryDataProperties) { Id = id; Directive = directive; Description = description; - File = file; + File = @file; Line = line; Message = message; Rule = rule; Level = level; Category = category; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxDiagnosticItem() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Unique identifier for the diagnostic. public string Id { get; } - /// Gets the directive. + + /// Gets the Directive. public string Directive { get; } - /// Gets the description. + + /// Gets the Description. public string Description { get; } + /// The filepath of the most relevant config file. public string File { get; } - /// Gets the line. + + /// Gets the Line. public float Line { get; } - /// Gets the message. + + /// Gets the Message. public string Message { get; } - /// Gets the rule. + + /// Gets the Rule. public string Rule { get; } + /// Warning or Info. public NginxDiagnosticLevel Level { get; } + /// Category of warning like Best-practices, Recommendation, Security etc. public string Category { get; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticLevel.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticLevel.cs index 5ca70cd48484..c6668dbe803e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticLevel.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDiagnosticLevel.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { @@ -14,38 +15,55 @@ namespace Azure.ResourceManager.Nginx.Models public readonly partial struct NginxDiagnosticLevel : IEquatable { private readonly string _value; + private const string InfoValue = "Info"; + private const string WarningValue = "Warning"; /// Initializes a new instance of . + /// The value. /// is null. public NginxDiagnosticLevel(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string InfoValue = "Info"; - private const string WarningValue = "Warning"; + _value = value; + } - /// Info. + /// Gets the Info. public static NginxDiagnosticLevel Info { get; } = new NginxDiagnosticLevel(InfoValue); - /// Warning. + + /// Gets the Warning. public static NginxDiagnosticLevel Warning { get; } = new NginxDiagnosticLevel(WarningValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(NginxDiagnosticLevel left, NginxDiagnosticLevel right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(NginxDiagnosticLevel left, NginxDiagnosticLevel right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator NginxDiagnosticLevel(string value) => new NginxDiagnosticLevel(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator NginxDiagnosticLevel?(string value) => value == null ? null : new NginxDiagnosticLevel(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is NginxDiagnosticLevel other && Equals(other); - /// + + /// public bool Equals(NginxDiagnosticLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.Serialization.cs index 2b3f82e95d76..c374b9432023 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.Serialization.cs @@ -8,17 +8,17 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Text; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxFrontendIPConfiguration : IUtf8JsonSerializable, IJsonModel + /// Nginx Frontend IP Configuration. + public partial class NginxFrontendIPConfiguration : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,19 +30,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxFrontendIPConfiguration)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(PublicIPAddresses)) { writer.WritePropertyName("publicIPAddresses"u8); writer.WriteStartArray(); - foreach (var item in PublicIPAddresses) + foreach (WritableSubResource item in PublicIPAddresses) { - ((IJsonModel)item).Write(writer, options); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } @@ -50,21 +49,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("privateIPAddresses"u8); writer.WriteStartArray(); - foreach (var item in PrivateIPAddresses) + foreach (NginxPrivateIPAddress item in PrivateIPAddresses) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -73,54 +72,49 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxFrontendIPConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxFrontendIPConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxFrontendIPConfiguration JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxFrontendIPConfiguration)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxFrontendIPConfiguration(document.RootElement, options); } - internal static NginxFrontendIPConfiguration DeserializeNginxFrontendIPConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxFrontendIPConfiguration DeserializeNginxFrontendIPConfiguration(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IList publicIPAddresses = default; IList privateIPAddresses = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("publicIPAddresses"u8)) + if (prop.NameEquals("publicIPAddresses"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(item.GetRawText())), options, AzureResourceManagerNginxContext.Default)); - } - publicIPAddresses = array; + DeserializePublicIPAddresses(prop, ref publicIPAddresses); continue; } - if (property.NameEquals("privateIPAddresses"u8)) + if (prop.NameEquals("privateIPAddresses"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxPrivateIPAddress.DeserializeNginxPrivateIPAddress(item, options)); } @@ -129,17 +123,19 @@ internal static NginxFrontendIPConfiguration DeserializeNginxFrontendIPConfigura } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxFrontendIPConfiguration(publicIPAddresses ?? new ChangeTrackingList(), privateIPAddresses ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NginxFrontendIPConfiguration(publicIPAddresses ?? new ChangeTrackingList(), privateIPAddresses ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -149,15 +145,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - NginxFrontendIPConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxFrontendIPConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxFrontendIPConfiguration PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxFrontendIPConfiguration(document.RootElement, options); } default: @@ -165,6 +166,7 @@ NginxFrontendIPConfiguration IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs index 3b61ed54c2e6..c0711043baa9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs @@ -7,44 +7,16 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxFrontendIPConfiguration. + /// Nginx Frontend IP Configuration. public partial class NginxFrontendIPConfiguration { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxFrontendIPConfiguration() @@ -54,19 +26,20 @@ public NginxFrontendIPConfiguration() } /// Initializes a new instance of . - /// Gets the public ip addresses. + /// /// - /// Keeps track of any properties unknown to the library. - internal NginxFrontendIPConfiguration(IList publicIPAddresses, IList privateIPAddresses, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxFrontendIPConfiguration(IList publicIPAddresses, IList privateIPAddresses, IDictionary additionalBinaryDataProperties) { PublicIPAddresses = publicIPAddresses; PrivateIPAddresses = privateIPAddresses; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the public ip addresses. + /// Gets the PublicIPAddresses. public IList PublicIPAddresses { get; } - /// Gets the private ip addresses. + + /// Gets the PrivateIPAddresses. public IList PrivateIPAddresses { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.Serialization.cs index 6b74bb5c5545..85047d80dfe6 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxLogging : IUtf8JsonSerializable, IJsonModel + /// Nginx Logging. + internal partial class NginxLogging : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +29,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxLogging)} does not support writing '{format}' format."); } - if (Optional.IsDefined(StorageAccount)) { writer.WritePropertyName("storageAccount"u8); writer.WriteObjectValue(StorageAccount, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +56,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxLogging IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxLogging IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxLogging JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxLogging)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxLogging(document.RootElement, options); } - internal static NginxLogging DeserializeNginxLogging(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxLogging DeserializeNginxLogging(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } NginxStorageAccount storageAccount = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("storageAccount"u8)) + if (prop.NameEquals("storageAccount"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - storageAccount = NginxStorageAccount.DeserializeNginxStorageAccount(property.Value, options); + storageAccount = NginxStorageAccount.DeserializeNginxStorageAccount(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxLogging(storageAccount, serializedAdditionalRawData); + return new NginxLogging(storageAccount, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +118,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions option } } - NginxLogging IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxLogging IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxLogging PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxLogging(document.RootElement, options); } default: @@ -128,6 +139,7 @@ NginxLogging IPersistableModel.Create(BinaryData data, ModelReader } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs index 0e7b40fdfcd7..ff6d8ffba281 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxLogging. + /// Nginx Logging. internal partial class NginxLogging { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxLogging() @@ -51,15 +22,15 @@ public NginxLogging() } /// Initializes a new instance of . - /// - /// Keeps track of any properties unknown to the library. - internal NginxLogging(NginxStorageAccount storageAccount, IDictionary serializedAdditionalRawData) + /// Nginx Storage Account. + /// Keeps track of any properties unknown to the library. + internal NginxLogging(NginxStorageAccount storageAccount, IDictionary additionalBinaryDataProperties) { StorageAccount = storageAccount; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the storage account. + /// Nginx Storage Account. public NginxStorageAccount StorageAccount { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.Serialization.cs index 02493d4a5bfa..8e17b34afa85 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxNetworkInterfaceConfiguration : IUtf8JsonSerializable, IJsonModel + /// Nginx Network Interface Configuration. + internal partial class NginxNetworkInterfaceConfiguration : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxNetworkInterfaceConfiguration)} does not support writing '{format}' format."); } - if (Optional.IsDefined(SubnetId)) { writer.WritePropertyName("subnetId"u8); writer.WriteStringValue(SubnetId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +57,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxNetworkInterfaceConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxNetworkInterfaceConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxNetworkInterfaceConfiguration JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxNetworkInterfaceConfiguration)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxNetworkInterfaceConfiguration(document.RootElement, options); } - internal static NginxNetworkInterfaceConfiguration DeserializeNginxNetworkInterfaceConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxNetworkInterfaceConfiguration DeserializeNginxNetworkInterfaceConfiguration(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ResourceIdentifier subnetId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("subnetId"u8)) + if (prop.NameEquals("subnetId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - subnetId = new ResourceIdentifier(property.Value.GetString()); + subnetId = new ResourceIdentifier(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxNetworkInterfaceConfiguration(subnetId, serializedAdditionalRawData); + return new NginxNetworkInterfaceConfiguration(subnetId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - NginxNetworkInterfaceConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxNetworkInterfaceConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxNetworkInterfaceConfiguration PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxNetworkInterfaceConfiguration(document.RootElement, options); } default: @@ -128,6 +140,7 @@ NginxNetworkInterfaceConfiguration IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs index 01cbd34d31a4..a3bfab42d7bd 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs @@ -11,40 +11,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxNetworkInterfaceConfiguration. + /// Nginx Network Interface Configuration. internal partial class NginxNetworkInterfaceConfiguration { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxNetworkInterfaceConfiguration() @@ -53,14 +24,14 @@ public NginxNetworkInterfaceConfiguration() /// Initializes a new instance of . /// - /// Keeps track of any properties unknown to the library. - internal NginxNetworkInterfaceConfiguration(ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxNetworkInterfaceConfiguration(ResourceIdentifier subnetId, IDictionary additionalBinaryDataProperties) { SubnetId = subnetId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the subnet id. + /// Gets or sets the SubnetId. public ResourceIdentifier SubnetId { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.Serialization.cs index 7b921bd9738a..9ebfb7f867ed 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxNetworkProfile : IUtf8JsonSerializable, IJsonModel + /// Nginx Network Profile. + public partial class NginxNetworkProfile : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxNetworkProfile)} does not support writing '{format}' format."); } - if (Optional.IsDefined(FrontEndIPConfiguration)) { writer.WritePropertyName("frontEndIPConfiguration"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("networkInterfaceConfiguration"u8); writer.WriteObjectValue(NetworkInterfaceConfiguration, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,63 +61,69 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxNetworkProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxNetworkProfile)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxNetworkProfile(document.RootElement, options); } - internal static NginxNetworkProfile DeserializeNginxNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxNetworkProfile DeserializeNginxNetworkProfile(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } NginxFrontendIPConfiguration frontEndIPConfiguration = default; NginxNetworkInterfaceConfiguration networkInterfaceConfiguration = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("frontEndIPConfiguration"u8)) + if (prop.NameEquals("frontEndIPConfiguration"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - frontEndIPConfiguration = NginxFrontendIPConfiguration.DeserializeNginxFrontendIPConfiguration(property.Value, options); + frontEndIPConfiguration = NginxFrontendIPConfiguration.DeserializeNginxFrontendIPConfiguration(prop.Value, options); continue; } - if (property.NameEquals("networkInterfaceConfiguration"u8)) + if (prop.NameEquals("networkInterfaceConfiguration"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - networkInterfaceConfiguration = NginxNetworkInterfaceConfiguration.DeserializeNginxNetworkInterfaceConfiguration(property.Value, options); + networkInterfaceConfiguration = NginxNetworkInterfaceConfiguration.DeserializeNginxNetworkInterfaceConfiguration(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxNetworkProfile(frontEndIPConfiguration, networkInterfaceConfiguration, serializedAdditionalRawData); + return new NginxNetworkProfile(frontEndIPConfiguration, networkInterfaceConfiguration, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -127,15 +133,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - NginxNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxNetworkProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxNetworkProfile(document.RootElement, options); } default: @@ -143,6 +154,7 @@ NginxNetworkProfile IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs index 76f01418efa4..c1531f287068 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs @@ -11,40 +11,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxNetworkProfile. + /// Nginx Network Profile. public partial class NginxNetworkProfile { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxNetworkProfile() @@ -52,28 +23,35 @@ public NginxNetworkProfile() } /// Initializes a new instance of . - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxNetworkProfile(NginxFrontendIPConfiguration frontEndIPConfiguration, NginxNetworkInterfaceConfiguration networkInterfaceConfiguration, IDictionary serializedAdditionalRawData) + /// Nginx Frontend IP Configuration. + /// Nginx Network Interface Configuration. + /// Keeps track of any properties unknown to the library. + internal NginxNetworkProfile(NginxFrontendIPConfiguration frontEndIPConfiguration, NginxNetworkInterfaceConfiguration networkInterfaceConfiguration, IDictionary additionalBinaryDataProperties) { FrontEndIPConfiguration = frontEndIPConfiguration; NetworkInterfaceConfiguration = networkInterfaceConfiguration; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the front end ip configuration. + /// Nginx Frontend IP Configuration. public NginxFrontendIPConfiguration FrontEndIPConfiguration { get; set; } - /// Gets or sets the network interface configuration. + + /// Nginx Network Interface Configuration. internal NginxNetworkInterfaceConfiguration NetworkInterfaceConfiguration { get; set; } - /// Gets or sets the network interface subnet id. + + /// Gets or sets the SubnetId. public ResourceIdentifier NetworkInterfaceSubnetId { - get => NetworkInterfaceConfiguration is null ? default : NetworkInterfaceConfiguration.SubnetId; + get + { + return NetworkInterfaceConfiguration is null ? default : NetworkInterfaceConfiguration.SubnetId; + } set { if (NetworkInterfaceConfiguration is null) + { NetworkInterfaceConfiguration = new NginxNetworkInterfaceConfiguration(); + } NetworkInterfaceConfiguration.SubnetId = value; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.Serialization.cs index e2d8bba3f1da..5d9c7618d135 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.Serialization.cs @@ -11,13 +11,15 @@ using System.Net; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxPrivateIPAddress : IUtf8JsonSerializable, IJsonModel + /// Nginx Private IP Address. + public partial class NginxPrivateIPAddress : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -29,12 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxPrivateIPAddress)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PrivateIPAddress)) { writer.WritePropertyName("privateIPAddress"u8); @@ -50,15 +51,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("subnetId"u8); writer.WriteStringValue(SubnetId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -67,22 +68,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxPrivateIPAddress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxPrivateIPAddress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxPrivateIPAddress JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxPrivateIPAddress)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxPrivateIPAddress(document.RootElement, options); } - internal static NginxPrivateIPAddress DeserializeNginxPrivateIPAddress(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxPrivateIPAddress DeserializeNginxPrivateIPAddress(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -90,50 +96,51 @@ internal static NginxPrivateIPAddress DeserializeNginxPrivateIPAddress(JsonEleme IPAddress privateIPAddress = default; NginxPrivateIPAllocationMethod? privateIPAllocationMethod = default; ResourceIdentifier subnetId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("privateIPAddress"u8)) + if (prop.NameEquals("privateIPAddress"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - privateIPAddress = IPAddress.Parse(property.Value.GetString()); + privateIPAddress = IPAddress.Parse(prop.Value.GetString()); continue; } - if (property.NameEquals("privateIPAllocationMethod"u8)) + if (prop.NameEquals("privateIPAllocationMethod"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - privateIPAllocationMethod = new NginxPrivateIPAllocationMethod(property.Value.GetString()); + privateIPAllocationMethod = new NginxPrivateIPAllocationMethod(prop.Value.GetString()); continue; } - if (property.NameEquals("subnetId"u8)) + if (prop.NameEquals("subnetId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - subnetId = new ResourceIdentifier(property.Value.GetString()); + subnetId = new ResourceIdentifier(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxPrivateIPAddress(privateIPAddress, privateIPAllocationMethod, subnetId, serializedAdditionalRawData); + return new NginxPrivateIPAddress(privateIPAddress, privateIPAllocationMethod, subnetId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -143,15 +150,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio } } - NginxPrivateIPAddress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxPrivateIPAddress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxPrivateIPAddress PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxPrivateIPAddress(document.RootElement, options); } default: @@ -159,6 +171,7 @@ NginxPrivateIPAddress IPersistableModel.Create(BinaryData } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs index 1242a0ac46ef..dbdf51119bb0 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs @@ -12,40 +12,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxPrivateIPAddress. + /// Nginx Private IP Address. public partial class NginxPrivateIPAddress { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxPrivateIPAddress() @@ -54,22 +25,24 @@ public NginxPrivateIPAddress() /// Initializes a new instance of . /// - /// + /// Nginx Private IP Allocation Method. /// - /// Keeps track of any properties unknown to the library. - internal NginxPrivateIPAddress(IPAddress privateIPAddress, NginxPrivateIPAllocationMethod? privateIPAllocationMethod, ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxPrivateIPAddress(IPAddress privateIPAddress, NginxPrivateIPAllocationMethod? privateIPAllocationMethod, ResourceIdentifier subnetId, IDictionary additionalBinaryDataProperties) { PrivateIPAddress = privateIPAddress; PrivateIPAllocationMethod = privateIPAllocationMethod; SubnetId = subnetId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the private ip address. + /// Gets or sets the PrivateIPAddress. public IPAddress PrivateIPAddress { get; set; } - /// Gets or sets the private ip allocation method. + + /// Nginx Private IP Allocation Method. public NginxPrivateIPAllocationMethod? PrivateIPAllocationMethod { get; set; } - /// Gets or sets the subnet id. + + /// Gets or sets the SubnetId. public ResourceIdentifier SubnetId { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAllocationMethod.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAllocationMethod.cs index fceedcce57d2..eafc0cb09688 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAllocationMethod.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAllocationMethod.cs @@ -7,45 +7,63 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxPrivateIPAllocationMethod. + /// Nginx Private IP Allocation Method. public readonly partial struct NginxPrivateIPAllocationMethod : IEquatable { private readonly string _value; + private const string StaticValue = "Static"; + private const string DynamicValue = "Dynamic"; /// Initializes a new instance of . + /// The value. /// is null. public NginxPrivateIPAllocationMethod(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string StaticValue = "Static"; - private const string DynamicValue = "Dynamic"; + _value = value; + } - /// Static. + /// Gets the Static. public static NginxPrivateIPAllocationMethod Static { get; } = new NginxPrivateIPAllocationMethod(StaticValue); - /// Dynamic. + + /// Gets the Dynamic. public static NginxPrivateIPAllocationMethod Dynamic { get; } = new NginxPrivateIPAllocationMethod(DynamicValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(NginxPrivateIPAllocationMethod left, NginxPrivateIPAllocationMethod right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(NginxPrivateIPAllocationMethod left, NginxPrivateIPAllocationMethod right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator NginxPrivateIPAllocationMethod(string value) => new NginxPrivateIPAllocationMethod(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator NginxPrivateIPAllocationMethod?(string value) => value == null ? null : new NginxPrivateIPAllocationMethod(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is NginxPrivateIPAllocationMethod other && Equals(other); - /// + + /// public bool Equals(NginxPrivateIPAllocationMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxProvisioningState.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxProvisioningState.cs index 9993571e8142..f31f43cac8de 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxProvisioningState.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxProvisioningState.cs @@ -7,21 +7,14 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxProvisioningState. + /// Provisioning State. public readonly partial struct NginxProvisioningState : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public NginxProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string AcceptedValue = "Accepted"; private const string CreatingValue = "Creating"; private const string UpdatingValue = "Updating"; @@ -32,41 +25,73 @@ public NginxProvisioningState(string value) private const string DeletedValue = "Deleted"; private const string NotSpecifiedValue = "NotSpecified"; - /// Accepted. + /// Initializes a new instance of . + /// The value. + /// is null. + public NginxProvisioningState(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Gets the Accepted. public static NginxProvisioningState Accepted { get; } = new NginxProvisioningState(AcceptedValue); - /// Creating. + + /// Gets the Creating. public static NginxProvisioningState Creating { get; } = new NginxProvisioningState(CreatingValue); - /// Updating. + + /// Gets the Updating. public static NginxProvisioningState Updating { get; } = new NginxProvisioningState(UpdatingValue); - /// Deleting. + + /// Gets the Deleting. public static NginxProvisioningState Deleting { get; } = new NginxProvisioningState(DeletingValue); - /// Succeeded. + + /// Gets the Succeeded. public static NginxProvisioningState Succeeded { get; } = new NginxProvisioningState(SucceededValue); - /// Failed. + + /// Gets the Failed. public static NginxProvisioningState Failed { get; } = new NginxProvisioningState(FailedValue); - /// Canceled. + + /// Gets the Canceled. public static NginxProvisioningState Canceled { get; } = new NginxProvisioningState(CanceledValue); - /// Deleted. + + /// Gets the Deleted. public static NginxProvisioningState Deleted { get; } = new NginxProvisioningState(DeletedValue); - /// NotSpecified. + + /// Gets the NotSpecified. public static NginxProvisioningState NotSpecified { get; } = new NginxProvisioningState(NotSpecifiedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(NginxProvisioningState left, NginxProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(NginxProvisioningState left, NginxProvisioningState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator NginxProvisioningState(string value) => new NginxProvisioningState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator NginxProvisioningState?(string value) => value == null ? null : new NginxProvisioningState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is NginxProvisioningState other && Equals(other); - /// + + /// public bool Equals(NginxProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.Serialization.cs index 882214d58408..e26147f42361 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - internal partial class NginxResourceSku : IUtf8JsonSerializable, IJsonModel + /// Resource Sku. + internal partial class NginxResourceSku : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxResourceSku() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,23 +34,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxResourceSku)} does not support writing '{format}' format."); } - writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -53,49 +58,55 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxResourceSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxResourceSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxResourceSku JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxResourceSku)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxResourceSku(document.RootElement, options); } - internal static NginxResourceSku DeserializeNginxResourceSku(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxResourceSku DeserializeNginxResourceSku(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxResourceSku(name, serializedAdditionalRawData); + return new NginxResourceSku(name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -105,15 +116,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions op } } - NginxResourceSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxResourceSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxResourceSku PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxResourceSku(document.RootElement, options); } default: @@ -121,6 +137,7 @@ NginxResourceSku IPersistableModel.Create(BinaryData data, Mod } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.cs index 3aef4091bc67..a1c085b625ae 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxResourceSku. + /// Resource Sku. internal partial class NginxResourceSku { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Name of the SKU. @@ -57,16 +29,11 @@ public NginxResourceSku(string name) /// Initializes a new instance of . /// Name of the SKU. - /// Keeps track of any properties unknown to the library. - internal NginxResourceSku(string name, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxResourceSku(string name, IDictionary additionalBinaryDataProperties) { Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxResourceSku() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Name of the SKU. diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.Serialization.cs index 932229a3bf7d..7d425525273f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxScaleProfile : IUtf8JsonSerializable, IJsonModel + /// The autoscale profile. + public partial class NginxScaleProfile : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxScaleProfile() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +34,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxScaleProfile)} does not support writing '{format}' format."); } - writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("capacity"u8); writer.WriteObjectValue(Capacity, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxScaleProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxScaleProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxScaleProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxScaleProfile)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxScaleProfile(document.RootElement, options); } - internal static NginxScaleProfile DeserializeNginxScaleProfile(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxScaleProfile DeserializeNginxScaleProfile(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string name = default; NginxScaleProfileCapacity capacity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString(); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("capacity"u8)) + if (prop.NameEquals("capacity"u8)) { - capacity = NginxScaleProfileCapacity.DeserializeNginxScaleProfileCapacity(property.Value, options); + capacity = NginxScaleProfileCapacity.DeserializeNginxScaleProfileCapacity(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxScaleProfile(name, capacity, serializedAdditionalRawData); + return new NginxScaleProfile(name, capacity, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions o } } - NginxScaleProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxScaleProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxScaleProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxScaleProfile(document.RootElement, options); } default: @@ -129,6 +145,7 @@ NginxScaleProfile IPersistableModel.Create(BinaryData data, M } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.cs index f8deed43c3c6..0c288d538fe7 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfile.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// The autoscale profile. public partial class NginxScaleProfile { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// @@ -61,21 +33,17 @@ public NginxScaleProfile(string name, NginxScaleProfileCapacity capacity) /// Initializes a new instance of . /// /// The capacity parameters of the profile. - /// Keeps track of any properties unknown to the library. - internal NginxScaleProfile(string name, NginxScaleProfileCapacity capacity, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxScaleProfile(string name, NginxScaleProfileCapacity capacity, IDictionary additionalBinaryDataProperties) { Name = name; Capacity = capacity; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Initializes a new instance of for deserialization. - internal NginxScaleProfile() - { - } - - /// Gets or sets the name. + /// Gets or sets the Name. public string Name { get; set; } + /// The capacity parameters of the profile. public NginxScaleProfileCapacity Capacity { get; set; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.Serialization.cs index edc2c70a664f..8df6935e9aca 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxScaleProfileCapacity : IUtf8JsonSerializable, IJsonModel + /// The capacity parameters of the profile. + public partial class NginxScaleProfileCapacity : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxScaleProfileCapacity() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +34,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxScaleProfileCapacity)} does not support writing '{format}' format."); } - writer.WritePropertyName("min"u8); writer.WriteNumberValue(Min); writer.WritePropertyName("max"u8); writer.WriteNumberValue(Max); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxScaleProfileCapacity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxScaleProfileCapacity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxScaleProfileCapacity JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxScaleProfileCapacity)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxScaleProfileCapacity(document.RootElement, options); } - internal static NginxScaleProfileCapacity DeserializeNginxScaleProfileCapacity(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxScaleProfileCapacity DeserializeNginxScaleProfileCapacity(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } int min = default; int max = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("min"u8)) + if (prop.NameEquals("min"u8)) { - min = property.Value.GetInt32(); + min = prop.Value.GetInt32(); continue; } - if (property.NameEquals("max"u8)) + if (prop.NameEquals("max"u8)) { - max = property.Value.GetInt32(); + max = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxScaleProfileCapacity(min, max, serializedAdditionalRawData); + return new NginxScaleProfileCapacity(min, max, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - NginxScaleProfileCapacity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxScaleProfileCapacity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxScaleProfileCapacity PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxScaleProfileCapacity(document.RootElement, options); } default: @@ -129,6 +145,7 @@ NginxScaleProfileCapacity IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.cs index 0f5f1a67f13d..2748e958a4f9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxScaleProfileCapacity.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// The capacity parameters of the profile. public partial class NginxScaleProfileCapacity { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The minimum number of NCUs the deployment can be autoscaled to. @@ -57,21 +28,17 @@ public NginxScaleProfileCapacity(int min, int max) /// Initializes a new instance of . /// The minimum number of NCUs the deployment can be autoscaled to. /// The maximum number of NCUs the deployment can be autoscaled to. - /// Keeps track of any properties unknown to the library. - internal NginxScaleProfileCapacity(int min, int max, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxScaleProfileCapacity(int min, int max, IDictionary additionalBinaryDataProperties) { Min = min; Max = max; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxScaleProfileCapacity() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The minimum number of NCUs the deployment can be autoscaled to. public int Min { get; set; } + /// The maximum number of NCUs the deployment can be autoscaled to. public int Max { get; set; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.Serialization.cs index 6e22976840ed..5883f11fdc9b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxStorageAccount : IUtf8JsonSerializable, IJsonModel + /// Nginx Storage Account. + public partial class NginxStorageAccount : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxStorageAccount)} does not support writing '{format}' format."); } - if (Optional.IsDefined(AccountName)) { writer.WritePropertyName("accountName"u8); @@ -44,15 +44,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("containerName"u8); writer.WriteStringValue(ContainerName); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,55 +61,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxStorageAccount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxStorageAccount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual NginxStorageAccount JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxStorageAccount)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxStorageAccount(document.RootElement, options); } - internal static NginxStorageAccount DeserializeNginxStorageAccount(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxStorageAccount DeserializeNginxStorageAccount(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string accountName = default; string containerName = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("accountName"u8)) + if (prop.NameEquals("accountName"u8)) { - accountName = property.Value.GetString(); + accountName = prop.Value.GetString(); continue; } - if (property.NameEquals("containerName"u8)) + if (prop.NameEquals("containerName"u8)) { - containerName = property.Value.GetString(); + containerName = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new NginxStorageAccount(accountName, containerName, serializedAdditionalRawData); + return new NginxStorageAccount(accountName, containerName, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -119,15 +125,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - NginxStorageAccount IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxStorageAccount IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual NginxStorageAccount PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxStorageAccount(document.RootElement, options); } default: @@ -135,6 +146,7 @@ NginxStorageAccount IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs index a9387c5aa880..618380187480 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs @@ -10,40 +10,11 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxStorageAccount. + /// Nginx Storage Account. public partial class NginxStorageAccount { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxStorageAccount() @@ -53,17 +24,18 @@ public NginxStorageAccount() /// Initializes a new instance of . /// /// - /// Keeps track of any properties unknown to the library. - internal NginxStorageAccount(string accountName, string containerName, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxStorageAccount(string accountName, string containerName, IDictionary additionalBinaryDataProperties) { AccountName = accountName; ContainerName = containerName; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the account name. + /// Gets or sets the AccountName. public string AccountName { get; set; } - /// Gets or sets the container name. + + /// Gets or sets the ContainerName. public string ContainerName { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallActivationState.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallActivationState.cs index 77ff8b4e9520..cd42418d9a91 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallActivationState.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallActivationState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { @@ -14,38 +15,55 @@ namespace Azure.ResourceManager.Nginx.Models public readonly partial struct WebApplicationFirewallActivationState : IEquatable { private readonly string _value; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; /// Initializes a new instance of . + /// The value. /// is null. public WebApplicationFirewallActivationState(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; + _value = value; + } - /// Enabled. + /// Gets the Enabled. public static WebApplicationFirewallActivationState Enabled { get; } = new WebApplicationFirewallActivationState(EnabledValue); - /// Disabled. + + /// Gets the Disabled. public static WebApplicationFirewallActivationState Disabled { get; } = new WebApplicationFirewallActivationState(DisabledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(WebApplicationFirewallActivationState left, WebApplicationFirewallActivationState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(WebApplicationFirewallActivationState left, WebApplicationFirewallActivationState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator WebApplicationFirewallActivationState(string value) => new WebApplicationFirewallActivationState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator WebApplicationFirewallActivationState?(string value) => value == null ? null : new WebApplicationFirewallActivationState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is WebApplicationFirewallActivationState other && Equals(other); - /// + + /// public bool Equals(WebApplicationFirewallActivationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.Serialization.cs index 60392c2f7346..279a1f9a578e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class WebApplicationFirewallComponentVersions : IUtf8JsonSerializable, IJsonModel + /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. + public partial class WebApplicationFirewallComponentVersions : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal WebApplicationFirewallComponentVersions() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +34,24 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallComponentVersions)} does not support writing '{format}' format."); } - writer.WritePropertyName("wafEngineVersion"u8); writer.WriteStringValue(WafEngineVersion); writer.WritePropertyName("wafNginxVersion"u8); writer.WriteStringValue(WafNginxVersion); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebApplicationFirewallComponentVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebApplicationFirewallComponentVersions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallComponentVersions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallComponentVersions)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebApplicationFirewallComponentVersions(document.RootElement, options); } - internal static WebApplicationFirewallComponentVersions DeserializeWebApplicationFirewallComponentVersions(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebApplicationFirewallComponentVersions DeserializeWebApplicationFirewallComponentVersions(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string wafEngineVersion = default; string wafNginxVersion = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("wafEngineVersion"u8)) + if (prop.NameEquals("wafEngineVersion"u8)) { - wafEngineVersion = property.Value.GetString(); + wafEngineVersion = prop.Value.GetString(); continue; } - if (property.NameEquals("wafNginxVersion"u8)) + if (prop.NameEquals("wafNginxVersion"u8)) { - wafNginxVersion = property.Value.GetString(); + wafNginxVersion = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WebApplicationFirewallComponentVersions(wafEngineVersion, wafNginxVersion, serializedAdditionalRawData); + return new WebApplicationFirewallComponentVersions(wafEngineVersion, wafNginxVersion, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +124,20 @@ BinaryData IPersistableModel.Write(Mode } } - WebApplicationFirewallComponentVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebApplicationFirewallComponentVersions IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallComponentVersions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebApplicationFirewallComponentVersions(document.RootElement, options); } default: @@ -129,6 +145,7 @@ WebApplicationFirewallComponentVersions IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.cs index 38c574f156bf..3cc19f8d9522 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallComponentVersions.cs @@ -13,47 +13,14 @@ namespace Azure.ResourceManager.Nginx.Models /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. public partial class WebApplicationFirewallComponentVersions { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The version of the NGINX App Protect Web Application Firewall (WAF) engine. /// The version of the NGINX App Protect Web Application Firewall (WAF) module for NGINX. - /// or is null. internal WebApplicationFirewallComponentVersions(string wafEngineVersion, string wafNginxVersion) { - Argument.AssertNotNull(wafEngineVersion, nameof(wafEngineVersion)); - Argument.AssertNotNull(wafNginxVersion, nameof(wafNginxVersion)); - WafEngineVersion = wafEngineVersion; WafNginxVersion = wafNginxVersion; } @@ -61,21 +28,17 @@ internal WebApplicationFirewallComponentVersions(string wafEngineVersion, string /// Initializes a new instance of . /// The version of the NGINX App Protect Web Application Firewall (WAF) engine. /// The version of the NGINX App Protect Web Application Firewall (WAF) module for NGINX. - /// Keeps track of any properties unknown to the library. - internal WebApplicationFirewallComponentVersions(string wafEngineVersion, string wafNginxVersion, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebApplicationFirewallComponentVersions(string wafEngineVersion, string wafNginxVersion, IDictionary additionalBinaryDataProperties) { WafEngineVersion = wafEngineVersion; WafNginxVersion = wafNginxVersion; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal WebApplicationFirewallComponentVersions() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The version of the NGINX App Protect Web Application Firewall (WAF) engine. public string WafEngineVersion { get; } + /// The version of the NGINX App Protect Web Application Firewall (WAF) module for NGINX. public string WafNginxVersion { get; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.Serialization.cs index cb6b1f8ff2cd..71e14084761b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class WebApplicationFirewallPackage : IUtf8JsonSerializable, IJsonModel + /// NGINX App Protect Web Application Firewall (WAF) Package. Contains the version and revision date of the package. + public partial class WebApplicationFirewallPackage : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal WebApplicationFirewallPackage() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,25 +34,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallPackage)} does not support writing '{format}' format."); } - writer.WritePropertyName("version"u8); writer.WriteStringValue(Version); writer.WritePropertyName("revisionDatetime"u8); writer.WriteStringValue(RevisionDatetime, "O"); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -55,55 +60,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebApplicationFirewallPackage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebApplicationFirewallPackage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallPackage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallPackage)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebApplicationFirewallPackage(document.RootElement, options); } - internal static WebApplicationFirewallPackage DeserializeWebApplicationFirewallPackage(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebApplicationFirewallPackage DeserializeWebApplicationFirewallPackage(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string version = default; DateTimeOffset revisionDatetime = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("version"u8)) + if (prop.NameEquals("version"u8)) { - version = property.Value.GetString(); + version = prop.Value.GetString(); continue; } - if (property.NameEquals("revisionDatetime"u8)) + if (prop.NameEquals("revisionDatetime"u8)) { - revisionDatetime = property.Value.GetDateTimeOffset("O"); + revisionDatetime = prop.Value.GetDateTimeOffset("O"); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WebApplicationFirewallPackage(version, revisionDatetime, serializedAdditionalRawData); + return new WebApplicationFirewallPackage(version, revisionDatetime, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -113,15 +124,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - WebApplicationFirewallPackage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebApplicationFirewallPackage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallPackage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebApplicationFirewallPackage(document.RootElement, options); } default: @@ -129,6 +145,7 @@ WebApplicationFirewallPackage IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.cs index dd31ba0ff221..5fb6de8760db 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallPackage.cs @@ -13,46 +13,14 @@ namespace Azure.ResourceManager.Nginx.Models /// NGINX App Protect Web Application Firewall (WAF) Package. Contains the version and revision date of the package. public partial class WebApplicationFirewallPackage { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The version of the NGINX App Protect Web Application Firewall (WAF) package. /// The date and time of the package revision. - /// is null. internal WebApplicationFirewallPackage(string version, DateTimeOffset revisionDatetime) { - Argument.AssertNotNull(version, nameof(version)); - Version = version; RevisionDatetime = revisionDatetime; } @@ -60,21 +28,17 @@ internal WebApplicationFirewallPackage(string version, DateTimeOffset revisionDa /// Initializes a new instance of . /// The version of the NGINX App Protect Web Application Firewall (WAF) package. /// The date and time of the package revision. - /// Keeps track of any properties unknown to the library. - internal WebApplicationFirewallPackage(string version, DateTimeOffset revisionDatetime, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebApplicationFirewallPackage(string version, DateTimeOffset revisionDatetime, IDictionary additionalBinaryDataProperties) { Version = version; RevisionDatetime = revisionDatetime; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal WebApplicationFirewallPackage() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The version of the NGINX App Protect Web Application Firewall (WAF) package. public string Version { get; } + /// The date and time of the package revision. public DateTimeOffset RevisionDatetime { get; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.Serialization.cs index c7dc6281d26f..37c917252c22 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class WebApplicationFirewallSettings : IUtf8JsonSerializable, IJsonModel + /// Settings for the NGINX App Protect Web Application Firewall (WAF). + public partial class WebApplicationFirewallSettings : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +29,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallSettings)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ActivationState)) { writer.WritePropertyName("activationState"u8); writer.WriteStringValue(ActivationState.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +56,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebApplicationFirewallSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebApplicationFirewallSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallSettings JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallSettings)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebApplicationFirewallSettings(document.RootElement, options); } - internal static WebApplicationFirewallSettings DeserializeWebApplicationFirewallSettings(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebApplicationFirewallSettings DeserializeWebApplicationFirewallSettings(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } WebApplicationFirewallActivationState? activationState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("activationState"u8)) + if (prop.NameEquals("activationState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - activationState = new WebApplicationFirewallActivationState(property.Value.GetString()); + activationState = new WebApplicationFirewallActivationState(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WebApplicationFirewallSettings(activationState, serializedAdditionalRawData); + return new WebApplicationFirewallSettings(activationState, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +118,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - WebApplicationFirewallSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebApplicationFirewallSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallSettings PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebApplicationFirewallSettings(document.RootElement, options); } default: @@ -128,6 +139,7 @@ WebApplicationFirewallSettings IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.cs index aeddf655b63c..eb70f1d2598e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallSettings.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Settings for the NGINX App Protect Web Application Firewall (WAF). public partial class WebApplicationFirewallSettings { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public WebApplicationFirewallSettings() @@ -52,11 +23,11 @@ public WebApplicationFirewallSettings() /// Initializes a new instance of . /// The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. - /// Keeps track of any properties unknown to the library. - internal WebApplicationFirewallSettings(WebApplicationFirewallActivationState? activationState, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebApplicationFirewallSettings(WebApplicationFirewallActivationState? activationState, IDictionary additionalBinaryDataProperties) { ActivationState = activationState; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.Serialization.cs index b02c447f9cfb..50fe9d6a9645 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class WebApplicationFirewallStatus : IUtf8JsonSerializable, IJsonModel + /// The status of the NGINX App Protect Web Application Firewall. + public partial class WebApplicationFirewallStatus : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallStatus)} does not support writing '{format}' format."); } - + if (Optional.IsDefined(WafRelease)) + { + writer.WritePropertyName("wafRelease"u8); + writer.WriteStringValue(WafRelease); + } if (options.Format != "W" && Optional.IsDefined(AttackSignaturesPackage)) { writer.WritePropertyName("attackSignaturesPackage"u8); @@ -54,15 +59,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("componentVersions"u8); writer.WriteObjectValue(ComponentVersions, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -71,83 +76,101 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - WebApplicationFirewallStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + WebApplicationFirewallStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallStatus JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(WebApplicationFirewallStatus)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeWebApplicationFirewallStatus(document.RootElement, options); } - internal static WebApplicationFirewallStatus DeserializeWebApplicationFirewallStatus(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static WebApplicationFirewallStatus DeserializeWebApplicationFirewallStatus(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } + string wafRelease = default; WebApplicationFirewallPackage attackSignaturesPackage = default; WebApplicationFirewallPackage botSignaturesPackage = default; WebApplicationFirewallPackage threatCampaignsPackage = default; WebApplicationFirewallComponentVersions componentVersions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("attackSignaturesPackage"u8)) + if (prop.NameEquals("wafRelease"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + wafRelease = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("attackSignaturesPackage"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - attackSignaturesPackage = WebApplicationFirewallPackage.DeserializeWebApplicationFirewallPackage(property.Value, options); + attackSignaturesPackage = WebApplicationFirewallPackage.DeserializeWebApplicationFirewallPackage(prop.Value, options); continue; } - if (property.NameEquals("botSignaturesPackage"u8)) + if (prop.NameEquals("botSignaturesPackage"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - botSignaturesPackage = WebApplicationFirewallPackage.DeserializeWebApplicationFirewallPackage(property.Value, options); + botSignaturesPackage = WebApplicationFirewallPackage.DeserializeWebApplicationFirewallPackage(prop.Value, options); continue; } - if (property.NameEquals("threatCampaignsPackage"u8)) + if (prop.NameEquals("threatCampaignsPackage"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - threatCampaignsPackage = WebApplicationFirewallPackage.DeserializeWebApplicationFirewallPackage(property.Value, options); + threatCampaignsPackage = WebApplicationFirewallPackage.DeserializeWebApplicationFirewallPackage(prop.Value, options); continue; } - if (property.NameEquals("componentVersions"u8)) + if (prop.NameEquals("componentVersions"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - componentVersions = WebApplicationFirewallComponentVersions.DeserializeWebApplicationFirewallComponentVersions(property.Value, options); + componentVersions = WebApplicationFirewallComponentVersions.DeserializeWebApplicationFirewallComponentVersions(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new WebApplicationFirewallStatus(attackSignaturesPackage, botSignaturesPackage, threatCampaignsPackage, componentVersions, serializedAdditionalRawData); + return new WebApplicationFirewallStatus( + wafRelease, + attackSignaturesPackage, + botSignaturesPackage, + threatCampaignsPackage, + componentVersions, + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -157,15 +180,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - WebApplicationFirewallStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + WebApplicationFirewallStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual WebApplicationFirewallStatus PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeWebApplicationFirewallStatus(document.RootElement, options); } default: @@ -173,6 +201,7 @@ WebApplicationFirewallStatus IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.cs index ab357bbe9790..9354f6f7da85 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// The status of the NGINX App Protect Web Application Firewall. public partial class WebApplicationFirewallStatus { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal WebApplicationFirewallStatus() @@ -51,26 +22,34 @@ internal WebApplicationFirewallStatus() } /// Initializes a new instance of . + /// NGINX App Protect WAF release version. /// Package containing attack signatures for the NGINX App Protect Web Application Firewall (WAF). /// Package containing bot signatures for the NGINX App Protect Web Application Firewall (WAF). /// Package containing threat campaigns for the NGINX App Protect Web Application Firewall (WAF). /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. - /// Keeps track of any properties unknown to the library. - internal WebApplicationFirewallStatus(WebApplicationFirewallPackage attackSignaturesPackage, WebApplicationFirewallPackage botSignaturesPackage, WebApplicationFirewallPackage threatCampaignsPackage, WebApplicationFirewallComponentVersions componentVersions, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal WebApplicationFirewallStatus(string wafRelease, WebApplicationFirewallPackage attackSignaturesPackage, WebApplicationFirewallPackage botSignaturesPackage, WebApplicationFirewallPackage threatCampaignsPackage, WebApplicationFirewallComponentVersions componentVersions, IDictionary additionalBinaryDataProperties) { + WafRelease = wafRelease; AttackSignaturesPackage = attackSignaturesPackage; BotSignaturesPackage = botSignaturesPackage; ThreatCampaignsPackage = threatCampaignsPackage; ComponentVersions = componentVersions; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } + /// NGINX App Protect WAF release version. + public string WafRelease { get; } + /// Package containing attack signatures for the NGINX App Protect Web Application Firewall (WAF). public WebApplicationFirewallPackage AttackSignaturesPackage { get; } + /// Package containing bot signatures for the NGINX App Protect Web Application Firewall (WAF). public WebApplicationFirewallPackage BotSignaturesPackage { get; } + /// Package containing threat campaigns for the NGINX App Protect Web Application Firewall (WAF). public WebApplicationFirewallPackage ThreatCampaignsPackage { get; } + /// Versions of the NGINX App Protect Web Application Firewall (WAF) components. public WebApplicationFirewallComponentVersions ComponentVersions { get; } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs index c59f891dfa08..90e658f6ea8f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { @@ -24,51 +25,49 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxCertificateCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxCertificateCertificatesClientDiagnostics; - private readonly CertificatesRestOperations _nginxCertificateCertificatesRestClient; + private readonly ClientDiagnostics _nginxCertificatesClientDiagnostics; + private readonly NginxCertificates _nginxCertificatesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxCertificateCollection for mocking. protected NginxCertificateCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal NginxCertificateCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxCertificateCertificatesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxCertificateResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxCertificateResource.ResourceType, out string nginxCertificateCertificatesApiVersion); - _nginxCertificateCertificatesRestClient = new CertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxCertificateCertificatesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(NginxCertificateResource.ResourceType, out string nginxCertificateApiVersion); + _nginxCertificatesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxCertificateResource.ResourceType.Namespace, Diagnostics); + _nginxCertificatesRestClient = new NginxCertificates(_nginxCertificatesClientDiagnostics, Pipeline, Endpoint, nginxCertificateApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != NginxDeploymentResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), id); + } } /// /// Create or update the NGINX certificates for given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -76,21 +75,33 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The name of certificate. /// The certificate. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string certificateName, NginxCertificateData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string certificateName, NginxCertificateData data = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateCertificatesClientDiagnostics, Pipeline, _nginxCertificateCertificatesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, NginxCertificateData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxCertificateOperationSource(Client), + _nginxCertificatesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -104,20 +115,16 @@ public virtual async Task> CreateOrUpdate /// Create or update the NGINX certificates for given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -125,21 +132,33 @@ public virtual async Task> CreateOrUpdate /// The name of certificate. /// The certificate. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string certificateName, NginxCertificateData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string certificateName, NginxCertificateData data = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateCertificatesClientDiagnostics, Pipeline, _nginxCertificateCertificatesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, NginxCertificateData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxCertificateOperationSource(Client), + _nginxCertificatesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -153,38 +172,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// Get a certificate of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificates_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of certificate. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxCertificateData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -198,38 +221,42 @@ public virtual async Task> GetAsync(string ce /// Get a certificate of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of certificate. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxCertificateData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -243,50 +270,44 @@ public virtual Response Get(string certificateName, Ca /// List all certificates of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates - /// - /// - /// Operation Id - /// Certificates_List + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxCertificates_List. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxCertificateCertificatesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxCertificateCertificatesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxCertificateResource(Client, NginxCertificateData.DeserializeNginxCertificateData(e)), _nginxCertificateCertificatesClientDiagnostics, Pipeline, "NginxCertificateCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new NginxCertificatesGetAllAsyncCollectionResultOfT(_nginxCertificatesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new NginxCertificateResource(Client, data)); } /// /// List all certificates of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates. /// /// - /// Operation Id - /// Certificates_List + /// Operation Id. + /// NginxCertificates_List. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -294,45 +315,61 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxCertificateCertificatesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxCertificateCertificatesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxCertificateResource(Client, NginxCertificateData.DeserializeNginxCertificateData(e)), _nginxCertificateCertificatesClientDiagnostics, Pipeline, "NginxCertificateCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new NginxCertificatesGetAllCollectionResultOfT(_nginxCertificatesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new NginxCertificateResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificates_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of certificate. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxCertificateData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxCertificateData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -346,36 +383,50 @@ public virtual async Task> ExistsAsync(string certificateName, Ca /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of certificate. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxCertificateData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxCertificateData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -389,38 +440,54 @@ public virtual Response Exists(string certificateName, CancellationToken c /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificates_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of certificate. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxCertificateData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxCertificateData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -434,38 +501,54 @@ public virtual async Task> GetIfExist /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of certificate. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, certificateName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxCertificateData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxCertificateData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -485,6 +568,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs index 6273548941fc..704fdd5be43f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs @@ -10,16 +10,18 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - public partial class NginxCertificateData : IUtf8JsonSerializable, IJsonModel + /// Nginx Certificate. + public partial class NginxCertificateData : ResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -50,98 +51,112 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - NginxCertificateData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxCertificateData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (NginxCertificateData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxCertificateData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxCertificateData(document.RootElement, options); } - internal static NginxCertificateData DeserializeNginxCertificateData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxCertificateData DeserializeNginxCertificateData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxCertificateProperties properties = default; - AzureLocation? location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + NginxCertificateProperties properties = default; + AzureLocation? location = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxCertificateProperties.DeserializeNginxCertificateProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("type"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("systemData"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("properties"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxCertificateProperties.DeserializeNginxCertificateProperties(prop.Value, options); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + location = new AzureLocation(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxCertificateData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, properties, - location, - serializedAdditionalRawData); + location); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -151,15 +166,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - NginxCertificateData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxCertificateData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (NginxCertificateData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxCertificateData(document.RootElement, options); } default: @@ -167,6 +187,26 @@ NginxCertificateData IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxCertificateData nginxCertificateData) + { + if (nginxCertificateData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxCertificateData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static NginxCertificateData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxCertificateData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs index 2ee2cbbe38f9..139b5175fe1c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs @@ -13,40 +13,11 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxCertificate data model. + /// Nginx Certificate. public partial class NginxCertificateData : ResourceData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public NginxCertificateData() @@ -54,23 +25,24 @@ public NginxCertificateData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxCertificateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxCertificateProperties properties, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Nginx Certificate Properties. + /// The geo-location where the resource lives. + internal NginxCertificateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, NginxCertificateProperties properties, AzureLocation? location) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; Location = location; - _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the properties. + /// Nginx Certificate Properties. public NginxCertificateProperties Properties { get; set; } - /// Gets or sets the location. + + /// The geo-location where the resource lives. public AzureLocation? Location { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.Serialization.cs index 4ebf47811b1e..1aae56e46146 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.Nginx { + /// public partial class NginxCertificateResource : IJsonModel { - private static NginxCertificateData s_dataDeserializationInstance; - private static NginxCertificateData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new NginxCertificateData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - NginxCertificateData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + NginxCertificateData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerNginxContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. NginxCertificateData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerNginxContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs index 24dacf476407..5ca8867ba97d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs @@ -6,46 +6,35 @@ #nullable disable using System; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { /// - /// A Class representing a NginxCertificate along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNginxCertificateResource method. - /// Otherwise you can get one from its parent resource using the GetNginxCertificate method. + /// A class representing a NginxCertificate along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetNginxCertificates method. /// public partial class NginxCertificateResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The deploymentName. - /// The certificateName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _nginxCertificateCertificatesClientDiagnostics; - private readonly CertificatesRestOperations _nginxCertificateCertificatesRestClient; + private readonly ClientDiagnostics _nginxCertificatesClientDiagnostics; + private readonly NginxCertificates _nginxCertificatesRestClient; private readonly NginxCertificateData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Nginx.NginxPlus/nginxDeployments/certificates"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxCertificateResource for mocking. protected NginxCertificateResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal NginxCertificateResource(ArmClient client, NginxCertificateData data) : this(client, data.Id) @@ -54,71 +43,93 @@ internal NginxCertificateResource(ArmClient client, NginxCertificateData data) : _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal NginxCertificateResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxCertificateCertificatesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string nginxCertificateCertificatesApiVersion); - _nginxCertificateCertificatesRestClient = new CertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxCertificateCertificatesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string nginxCertificateApiVersion); + _nginxCertificatesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + _nginxCertificatesRestClient = new NginxCertificates(_nginxCertificatesClientDiagnostics, Pipeline, Endpoint, nginxCertificateApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } /// 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 NginxCertificateData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + /// The certificateName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] 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)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Get a certificate of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxCertificateData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -132,33 +143,41 @@ public virtual async Task> GetAsync(Cancellat /// Get a certificate of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxCertificateData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -172,20 +191,20 @@ public virtual Response Get(CancellationToken cancella /// Deletes a certificate from the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Delete + /// Operation Id. + /// NginxCertificates_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -193,14 +212,21 @@ public virtual Response Get(CancellationToken cancella /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxCertificateCertificatesClientDiagnostics, Pipeline, _nginxCertificateCertificatesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation(_nginxCertificatesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -214,20 +240,20 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// Deletes a certificate from the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_Delete + /// Operation Id. + /// NginxCertificates_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -235,14 +261,21 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxCertificateCertificatesClientDiagnostics, Pipeline, _nginxCertificateCertificatesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation(_nginxCertificatesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -253,42 +286,52 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Create or update the NGINX certificates for given NGINX deployment + /// Update a NginxCertificate. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The certificate. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxCertificateData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxCertificateData data = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateCertificatesClientDiagnostics, Pipeline, _nginxCertificateCertificatesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxCertificateData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxCertificateOperationSource(Client), + _nginxCertificatesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -299,42 +342,52 @@ public virtual async Task> UpdateAsync(Wa } /// - /// Create or update the NGINX certificates for given NGINX deployment + /// Update a NginxCertificate. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Operation Id - /// Certificates_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The certificate. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, NginxCertificateData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NginxCertificateData data = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateCertificatesClientDiagnostics, Pipeline, _nginxCertificateCertificatesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxCertificatesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxCertificateData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxCertificateOperationSource(Client), + _nginxCertificatesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs index 058253f9cafc..f95510cfc0f4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx @@ -25,51 +26,49 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxConfigurationConfigurationsClientDiagnostics; - private readonly ConfigurationsRestOperations _nginxConfigurationConfigurationsRestClient; + private readonly ClientDiagnostics _nginxConfigurationResponsesClientDiagnostics; + private readonly NginxConfigurationResponses _nginxConfigurationResponsesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxConfigurationCollection for mocking. protected NginxConfigurationCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal NginxConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxConfigurationConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxConfigurationResource.ResourceType, out string nginxConfigurationConfigurationsApiVersion); - _nginxConfigurationConfigurationsRestClient = new ConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxConfigurationConfigurationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(NginxConfigurationResource.ResourceType, out string nginxConfigurationApiVersion); + _nginxConfigurationResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxConfigurationResource.ResourceType.Namespace, Diagnostics); + _nginxConfigurationResponsesRestClient = new NginxConfigurationResponses(_nginxConfigurationResponsesClientDiagnostics, Pipeline, Endpoint, nginxConfigurationApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != NginxDeploymentResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), id); + } } /// /// Create or update the NGINX configuration for given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -77,21 +76,33 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The NGINX configuration. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string configurationName, NginxConfigurationCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string configurationName, NginxConfigurationCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationConfigurationsClientDiagnostics, Pipeline, _nginxConfigurationConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, NginxConfigurationCreateOrUpdateContent.ToRequestContent(content), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxConfigurationOperationSource(Client), + _nginxConfigurationResponsesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -105,20 +116,16 @@ public virtual async Task> CreateOrUpda /// Create or update the NGINX configuration for given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -126,21 +133,33 @@ public virtual async Task> CreateOrUpda /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The NGINX configuration. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string configurationName, NginxConfigurationCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string configurationName, NginxConfigurationCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content, cancellationToken); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationConfigurationsClientDiagnostics, Pipeline, _nginxConfigurationConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, NginxConfigurationCreateOrUpdateContent.ToRequestContent(content), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxConfigurationOperationSource(Client), + _nginxConfigurationResponsesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -154,38 +173,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// Get the NGINX configuration of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} - /// - /// - /// Operation Id - /// Configurations_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -199,38 +222,42 @@ public virtual async Task> GetAsync(string /// Get the NGINX configuration of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -244,50 +271,44 @@ public virtual Response Get(string configurationName /// List the NGINX configuration of given NGINX deployment. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations - /// - /// - /// Operation Id - /// Configurations_List + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxConfigurationResponses_List. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxConfigurationConfigurationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxConfigurationConfigurationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxConfigurationResource(Client, NginxConfigurationData.DeserializeNginxConfigurationData(e)), _nginxConfigurationConfigurationsClientDiagnostics, Pipeline, "NginxConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new NginxConfigurationResponsesGetAllAsyncCollectionResultOfT(_nginxConfigurationResponsesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new NginxConfigurationResource(Client, data)); } /// /// List the NGINX configuration of given NGINX deployment. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations. /// /// - /// Operation Id - /// Configurations_List + /// Operation Id. + /// NginxConfigurationResponses_List. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -295,45 +316,61 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxConfigurationConfigurationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxConfigurationConfigurationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxConfigurationResource(Client, NginxConfigurationData.DeserializeNginxConfigurationData(e)), _nginxConfigurationConfigurationsClientDiagnostics, Pipeline, "NginxConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new NginxConfigurationResponsesGetAllCollectionResultOfT(_nginxConfigurationResponsesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new NginxConfigurationResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} - /// - /// - /// Operation Id - /// Configurations_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxConfigurationData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -347,36 +384,50 @@ public virtual async Task> ExistsAsync(string configurationName, /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxConfigurationData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -390,38 +441,54 @@ public virtual Response Exists(string configurationName, CancellationToken /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} - /// - /// - /// Operation Id - /// Configurations_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxConfigurationData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -435,38 +502,54 @@ public virtual async Task> GetIfExi /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string configurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, configurationName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxConfigurationData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -486,6 +569,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.Serialization.cs index 6df3e3877dc2..3b242862fc65 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.Serialization.cs @@ -10,16 +10,18 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - public partial class NginxConfigurationData : IUtf8JsonSerializable, IJsonModel + /// Nginx Configuration Response. + public partial class NginxConfigurationData : ResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -45,87 +46,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - NginxConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (NginxConfigurationData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxConfigurationData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxConfigurationData(document.RootElement, options); } - internal static NginxConfigurationData DeserializeNginxConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxConfigurationData DeserializeNginxConfigurationData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxConfigurationProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + NginxConfigurationProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxConfigurationProperties.DeserializeNginxConfigurationProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("systemData"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + properties = NginxConfigurationProperties.DeserializeNginxConfigurationProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxConfigurationData( id, name, - type, + resourceType, systemData, - properties, - serializedAdditionalRawData); + additionalBinaryDataProperties, + properties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -135,15 +150,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - NginxConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (NginxConfigurationData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxConfigurationData(document.RootElement, options); } default: @@ -151,6 +171,14 @@ NginxConfigurationData IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxConfigurationData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxConfigurationData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs index 3b901729753f..64d60b799fcf 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs @@ -13,60 +13,31 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxConfiguration data model. + /// Nginx Configuration Response. public partial class NginxConfigurationData : ResourceData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - internal NginxConfigurationData() + public NginxConfigurationData() { } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Keeps track of any properties unknown to the library. - internal NginxConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Nginx Configuration Response Properties. + internal NginxConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, NginxConfigurationProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the properties. - public NginxConfigurationProperties Properties { get; } + /// Nginx Configuration Response Properties. + public NginxConfigurationProperties Properties { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.Serialization.cs index 0654355c20d5..732da4c95001 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.Serialization.cs @@ -8,22 +8,33 @@ using System; using System.ClientModel.Primitives; using System.Text.Json; +using Azure.ResourceManager; namespace Azure.ResourceManager.Nginx { - public partial class NginxConfigurationResource : IJsonModel + /// + public partial class NginxConfigurationResource : ArmResource, IJsonModel { - private static NginxConfigurationData s_dataDeserializationInstance; - private static NginxConfigurationData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new NginxConfigurationData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - NginxConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + NginxConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerNginxContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. NginxConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerNginxContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs index 83f3fa796ac6..4181bc08d213 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs @@ -6,47 +6,36 @@ #nullable disable using System; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { /// - /// A Class representing a NginxConfiguration along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNginxConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetNginxConfiguration method. + /// A class representing a NginxConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetNginxConfigurations method. /// public partial class NginxConfigurationResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The deploymentName. - /// The configurationName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _nginxConfigurationConfigurationsClientDiagnostics; - private readonly ConfigurationsRestOperations _nginxConfigurationConfigurationsRestClient; + private readonly ClientDiagnostics _nginxConfigurationResponsesClientDiagnostics; + private readonly NginxConfigurationResponses _nginxConfigurationResponsesRestClient; private readonly NginxConfigurationData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Nginx.NginxPlus/nginxDeployments/configurations"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxConfigurationResource for mocking. protected NginxConfigurationResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal NginxConfigurationResource(ArmClient client, NginxConfigurationData data) : this(client, data.Id) @@ -55,71 +44,93 @@ internal NginxConfigurationResource(ArmClient client, NginxConfigurationData dat _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal NginxConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxConfigurationConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string nginxConfigurationConfigurationsApiVersion); - _nginxConfigurationConfigurationsRestClient = new ConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxConfigurationConfigurationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string nginxConfigurationApiVersion); + _nginxConfigurationResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + _nginxConfigurationResponsesRestClient = new NginxConfigurationResponses(_nginxConfigurationResponsesClientDiagnostics, Pipeline, Endpoint, nginxConfigurationApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } /// 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 NginxConfigurationData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + /// The configurationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] 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)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Get the NGINX configuration of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -133,33 +144,41 @@ public virtual async Task> GetAsync(Cancell /// Get the NGINX configuration of given NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxConfigurationData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -173,20 +192,20 @@ public virtual Response Get(CancellationToken cancel /// Reset the NGINX configuration of given NGINX deployment to default /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Delete + /// Operation Id. + /// NginxConfigurationResponses_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -194,14 +213,21 @@ public virtual Response Get(CancellationToken cancel /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxConfigurationConfigurationsClientDiagnostics, Pipeline, _nginxConfigurationConfigurationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation(_nginxConfigurationResponsesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -215,20 +241,20 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// Reset the NGINX configuration of given NGINX deployment to default /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Delete + /// Operation Id. + /// NginxConfigurationResponses_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -236,14 +262,21 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxConfigurationConfigurationsClientDiagnostics, Pipeline, _nginxConfigurationConfigurationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation(_nginxConfigurationResponsesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -254,43 +287,46 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Create or update the NGINX configuration for given NGINX deployment + /// Analyze an NGINX configuration without applying it to the NGINXaaS deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze. /// /// - /// Operation Id - /// Configurations_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_Analysis. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The NGINX configuration. + /// The NGINX configuration to analyze. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxConfigurationCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual async Task> AnalysisAsync(NginxAnalysisContent content = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationConfigurationsClientDiagnostics, Pipeline, _nginxConfigurationConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateAnalysisRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxAnalysisContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxAnalysisResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; } catch (Exception e) { @@ -300,43 +336,46 @@ public virtual async Task> UpdateAsync( } /// - /// Create or update the NGINX configuration for given NGINX deployment + /// Analyze an NGINX configuration without applying it to the NGINXaaS deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze. /// /// - /// Operation Id - /// Configurations_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_Analysis. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The NGINX configuration. + /// The NGINX configuration to analyze. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, NginxConfigurationCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual Response Analysis(NginxAnalysisContent content = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationConfigurationsClientDiagnostics, Pipeline, _nginxConfigurationConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateAnalysisRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxAnalysisContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxAnalysisResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; } catch (Exception e) { @@ -346,36 +385,53 @@ public virtual ArmOperation Update(WaitUntil waitUnt } /// - /// Analyze an NGINX configuration without applying it to the NGINXaaS deployment + /// Update a NginxConfiguration. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Analysis + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// The NGINX configuration to analyze. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The NGINX configuration. /// The cancellation token to use. - public virtual async Task> AnalysisAsync(NginxAnalysisContent content = null, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxConfigurationCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.AnalysisAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - return response; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxConfigurationCreateOrUpdateContent.ToRequestContent(content), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxConfigurationOperationSource(Client), + _nginxConfigurationResponsesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; } catch (Exception e) { @@ -385,36 +441,53 @@ public virtual async Task> AnalysisAsync(NginxAnal } /// - /// Analyze an NGINX configuration without applying it to the NGINXaaS deployment + /// Update a NginxConfiguration. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Operation Id - /// Configurations_Analysis + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// The NGINX configuration to analyze. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The NGINX configuration. /// The cancellation token to use. - public virtual Response Analysis(NginxAnalysisContent content = null, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NginxConfigurationCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Analysis(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - return response; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxConfigurationCreateOrUpdateContent.ToRequestContent(content), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxConfigurationOperationSource(Client), + _nginxConfigurationResponsesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; } catch (Exception e) { diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyCollection.cs index 2c19040c5561..bb20284436c4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx @@ -25,51 +26,49 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxDeploymentApiKeyCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxDeploymentApiKeyApiKeysClientDiagnostics; - private readonly ApiKeysRestOperations _nginxDeploymentApiKeyApiKeysRestClient; + private readonly ClientDiagnostics _nginxDeploymentApiKeyResponsesClientDiagnostics; + private readonly NginxDeploymentApiKeyResponses _nginxDeploymentApiKeyResponsesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxDeploymentApiKeyCollection for mocking. protected NginxDeploymentApiKeyCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal NginxDeploymentApiKeyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxDeploymentApiKeyApiKeysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentApiKeyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxDeploymentApiKeyResource.ResourceType, out string nginxDeploymentApiKeyApiKeysApiVersion); - _nginxDeploymentApiKeyApiKeysRestClient = new ApiKeysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiKeyApiKeysApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(NginxDeploymentApiKeyResource.ResourceType, out string nginxDeploymentApiKeyApiVersion); + _nginxDeploymentApiKeyResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentApiKeyResource.ResourceType.Namespace, Diagnostics); + _nginxDeploymentApiKeyResponsesRestClient = new NginxDeploymentApiKeyResponses(_nginxDeploymentApiKeyResponsesClientDiagnostics, Pipeline, Endpoint, nginxDeploymentApiKeyApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != NginxDeploymentResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), id); + } } /// /// Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -77,23 +76,30 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The resource name of the API key. /// The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content, cancellationToken).ConfigureAwait(false); - var uri = _nginxDeploymentApiKeyApiKeysRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + NginxArmOperation operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -107,20 +113,16 @@ public virtual async Task> CreateOrU /// Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -128,23 +130,30 @@ public virtual async Task> CreateOrU /// The resource name of the API key. /// The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content, cancellationToken); - var uri = _nginxDeploymentApiKeyApiKeysRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + NginxArmOperation operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -158,38 +167,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// Get the specified API Key of the given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} - /// - /// - /// Operation Id - /// ApiKeys_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The resource name of the API key. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string apiKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -203,38 +216,42 @@ public virtual async Task> GetAsync(stri /// Get the specified API Key of the given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The resource name of the API key. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string apiKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -248,50 +265,44 @@ public virtual Response Get(string apiKeyName, Ca /// List all API Keys of the given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys - /// - /// - /// Operation Id - /// ApiKeys_List + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeploymentApiKeyResponses_List. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentApiKeyApiKeysRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentApiKeyApiKeysRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentApiKeyResource(Client, NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(e)), _nginxDeploymentApiKeyApiKeysClientDiagnostics, Pipeline, "NginxDeploymentApiKeyCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT(_nginxDeploymentApiKeyResponsesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new NginxDeploymentApiKeyResource(Client, data)); } /// /// List all API Keys of the given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys. /// /// - /// Operation Id - /// ApiKeys_List + /// Operation Id. + /// NginxDeploymentApiKeyResponses_List. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -299,45 +310,61 @@ public virtual AsyncPageable GetAllAsync(Cancella /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentApiKeyApiKeysRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentApiKeyApiKeysRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentApiKeyResource(Client, NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(e)), _nginxDeploymentApiKeyApiKeysClientDiagnostics, Pipeline, "NginxDeploymentApiKeyCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT(_nginxDeploymentApiKeyResponsesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new NginxDeploymentApiKeyResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} - /// - /// - /// Operation Id - /// ApiKeys_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The resource name of the API key. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string apiKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentApiKeyData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -351,36 +378,50 @@ public virtual async Task> ExistsAsync(string apiKeyName, Cancell /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The resource name of the API key. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string apiKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentApiKeyData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -394,38 +435,54 @@ public virtual Response Exists(string apiKeyName, CancellationToken cancel /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} - /// - /// - /// Operation Id - /// ApiKeys_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The resource name of the API key. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string apiKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentApiKeyData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -439,38 +496,54 @@ public virtual async Task> GetIf /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The resource name of the API key. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string apiKeyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, apiKeyName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentApiKeyData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -490,6 +563,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.Serialization.cs index b6f6941a99fe..cddd06d3cbfe 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.Serialization.cs @@ -10,16 +10,18 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - public partial class NginxDeploymentApiKeyData : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Api Key Response. + public partial class NginxDeploymentApiKeyData : ResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -45,87 +46,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - NginxDeploymentApiKeyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentApiKeyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (NginxDeploymentApiKeyData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentApiKeyData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentApiKeyData(document.RootElement, options); } - internal static NginxDeploymentApiKeyData DeserializeNginxDeploymentApiKeyData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentApiKeyData DeserializeNginxDeploymentApiKeyData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxDeploymentApiKeyProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + NginxDeploymentApiKeyProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxDeploymentApiKeyProperties.DeserializeNginxDeploymentApiKeyProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("systemData"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + properties = NginxDeploymentApiKeyProperties.DeserializeNginxDeploymentApiKeyProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDeploymentApiKeyData( id, name, - type, + resourceType, systemData, - properties, - serializedAdditionalRawData); + additionalBinaryDataProperties, + properties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -135,15 +150,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - NginxDeploymentApiKeyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentApiKeyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (NginxDeploymentApiKeyData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentApiKeyData(document.RootElement, options); } default: @@ -151,6 +171,14 @@ NginxDeploymentApiKeyData IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static NginxDeploymentApiKeyData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentApiKeyData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs index 5330fd270419..109d8b4cae81 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs @@ -13,40 +13,11 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxDeploymentApiKey data model. + /// Nginx Deployment Api Key Response. public partial class NginxDeploymentApiKeyData : ResourceData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal NginxDeploymentApiKeyData() @@ -54,19 +25,19 @@ internal NginxDeploymentApiKeyData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentApiKeyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxDeploymentApiKeyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Nginx Deployment Api Key Response Properties. + internal NginxDeploymentApiKeyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, NginxDeploymentApiKeyProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the properties. + /// Nginx Deployment Api Key Response Properties. public NginxDeploymentApiKeyProperties Properties { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.Serialization.cs index 95b63e11cdac..5349b630fe80 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.Nginx { + /// public partial class NginxDeploymentApiKeyResource : IJsonModel { - private static NginxDeploymentApiKeyData s_dataDeserializationInstance; - private static NginxDeploymentApiKeyData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new NginxDeploymentApiKeyData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - NginxDeploymentApiKeyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + NginxDeploymentApiKeyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerNginxContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. NginxDeploymentApiKeyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerNginxContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs index 34156f1d2352..e75d2aa6c52b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs @@ -6,47 +6,36 @@ #nullable disable using System; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { /// - /// A Class representing a NginxDeploymentApiKey along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNginxDeploymentApiKeyResource method. - /// Otherwise you can get one from its parent resource using the GetNginxDeploymentApiKey method. + /// A class representing a NginxDeploymentApiKey along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetNginxDeploymentApiKeys method. /// public partial class NginxDeploymentApiKeyResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The deploymentName. - /// The apiKeyName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _nginxDeploymentApiKeyApiKeysClientDiagnostics; - private readonly ApiKeysRestOperations _nginxDeploymentApiKeyApiKeysRestClient; + private readonly ClientDiagnostics _nginxDeploymentApiKeyResponsesClientDiagnostics; + private readonly NginxDeploymentApiKeyResponses _nginxDeploymentApiKeyResponsesRestClient; private readonly NginxDeploymentApiKeyData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Nginx.NginxPlus/nginxDeployments/apiKeys"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxDeploymentApiKeyResource for mocking. protected NginxDeploymentApiKeyResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal NginxDeploymentApiKeyResource(ArmClient client, NginxDeploymentApiKeyData data) : this(client, data.Id) @@ -55,71 +44,93 @@ internal NginxDeploymentApiKeyResource(ArmClient client, NginxDeploymentApiKeyDa _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal NginxDeploymentApiKeyResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxDeploymentApiKeyApiKeysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string nginxDeploymentApiKeyApiKeysApiVersion); - _nginxDeploymentApiKeyApiKeysRestClient = new ApiKeysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiKeyApiKeysApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string nginxDeploymentApiKeyApiVersion); + _nginxDeploymentApiKeyResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + _nginxDeploymentApiKeyResponsesRestClient = new NginxDeploymentApiKeyResponses(_nginxDeploymentApiKeyResponsesClientDiagnostics, Pipeline, Endpoint, nginxDeploymentApiKeyApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } /// 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 NginxDeploymentApiKeyData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + /// The apiKeyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] 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)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Get the specified API Key of the given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -133,33 +144,41 @@ public virtual async Task> GetAsync(Canc /// Get the specified API Key of the given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -173,20 +192,20 @@ public virtual Response Get(CancellationToken can /// Delete API key for Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Delete + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -194,16 +213,23 @@ public virtual Response Get(CancellationToken can /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _nginxDeploymentApiKeyApiKeysRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new NginxArmOperation(response, rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + NginxArmOperation operation = new NginxArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -217,20 +243,20 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// Delete API key for Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_Delete + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -238,16 +264,23 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _nginxDeploymentApiKeyApiKeysRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new NginxArmOperation(response, rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + NginxArmOperation operation = new NginxArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -258,44 +291,49 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint + /// Update a NginxDeploymentApiKey. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentApiKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentApiKeyCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var uri = _nginxDeploymentApiKeyApiKeysRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxDeploymentApiKeyCreateOrUpdateContent.ToRequestContent(content), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + NginxArmOperation operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -306,44 +344,49 @@ public virtual async Task> UpdateAsy } /// - /// Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint + /// Update a NginxDeploymentApiKey. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Operation Id - /// ApiKeys_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentApiKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentApiKeyCreateOrUpdateContent content = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var uri = _nginxDeploymentApiKeyApiKeysRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentApiKeyResponsesRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxDeploymentApiKeyCreateOrUpdateContent.ToRequestContent(content), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentApiKeyData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + NginxArmOperation operation = new NginxArmOperation(Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs index cd9bd9f13b7b..e53fc65157c4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Nginx @@ -25,73 +26,83 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; - private readonly DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; + private readonly ClientDiagnostics _nginxDeploymentsClientDiagnostics; + private readonly NginxDeployments _nginxDeploymentsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxDeploymentCollection for mocking. protected NginxDeploymentCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal NginxDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxDeploymentDeploymentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxDeploymentResource.ResourceType, out string nginxDeploymentDeploymentsApiVersion); - _nginxDeploymentDeploymentsRestClient = new DeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentDeploymentsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(NginxDeploymentResource.ResourceType, out string nginxDeploymentApiVersion); + _nginxDeploymentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); + _nginxDeploymentsRestClient = new NginxDeployments(_nginxDeploymentsClientDiagnostics, Pipeline, Endpoint, nginxDeploymentApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id); + } } /// /// Create or update the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_CreateOrUpdate + /// Operation Id. + /// NginxDeployments_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of targeted NGINX deployment. - /// The to use. + /// The Nginx deployment. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, NginxDeploymentData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, NginxDeploymentData data = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentDeploymentsClientDiagnostics, Pipeline, _nginxDeploymentDeploymentsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, NginxDeploymentData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentOperationSource(Client), + _nginxDeploymentsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -105,42 +116,50 @@ public virtual async Task> CreateOrUpdateA /// Create or update the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_CreateOrUpdate + /// Operation Id. + /// NginxDeployments_CreateOrUpdate. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The name of targeted NGINX deployment. - /// The to use. + /// The Nginx deployment. /// The cancellation token to use. + /// is null. /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, NginxDeploymentData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, NginxDeploymentData data = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data, cancellationToken); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentDeploymentsClientDiagnostics, Pipeline, _nginxDeploymentDeploymentsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, NginxDeploymentData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentOperationSource(Client), + _nginxDeploymentsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -154,38 +173,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// Get the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -199,38 +222,42 @@ public virtual async Task> GetAsync(string dep /// Get the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -244,50 +271,44 @@ public virtual Response Get(string deploymentName, Canc /// List all NGINX deployments under the specified resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// Deployments_ListByResourceGroup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_ListByResourceGroup. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentDeploymentsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentDeploymentsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), _nginxDeploymentDeploymentsClientDiagnostics, Pipeline, "NginxDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT(_nginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new NginxDeploymentResource(Client, data)); } /// /// List all NGINX deployments under the specified resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Operation Id - /// Deployments_ListByResourceGroup + /// Operation Id. + /// NginxDeployments_ListByResourceGroup. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -295,45 +316,61 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentDeploymentsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentDeploymentsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), _nginxDeploymentDeploymentsClientDiagnostics, Pipeline, "NginxDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new NginxDeploymentsGetByResourceGroupCollectionResultOfT(_nginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, context), data => new NginxDeploymentResource(Client, data)); } /// /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -347,36 +384,50 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -390,38 +441,54 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -435,38 +502,54 @@ public virtual async Task> GetIfExists /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of targeted NGINX deployment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, deploymentName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -486,6 +569,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.Serialization.cs index 851fbb548ec6..27e77a456714 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.Serialization.cs @@ -10,16 +10,23 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.Models; using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - public partial class NginxDeploymentData : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment. + public partial class NginxDeploymentData : TrackedResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal NginxDeploymentData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,23 +38,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - ((IJsonModel)Identity).Write(writer, options); - } if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + ((IJsonModel)Identity).Write(writer, options); + } if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -55,132 +61,153 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - NginxDeploymentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (NginxDeploymentData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(NginxDeploymentData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentData(document.RootElement, options); } - internal static NginxDeploymentData DeserializeNginxDeploymentData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentData DeserializeNginxDeploymentData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - ManagedServiceIdentity identity = default; - NginxDeploymentProperties properties = default; - NginxResourceSku sku = default; - IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + NginxDeploymentProperties properties = default; + ManagedServiceIdentity identity = default; + NginxResourceSku sku = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerNginxContext.Default); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxDeploymentProperties.DeserializeNginxDeploymentProperties(property.Value, options); + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("sku"u8)) + if (prop.NameEquals("systemData"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sku = NginxResourceSku.DeserializeNginxResourceSku(property.Value, options); + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("location"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("properties"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxDeploymentProperties.DeserializeNginxDeploymentProperties(prop.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("identity"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("sku"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + sku = NginxResourceSku.DeserializeNginxResourceSku(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new NginxDeploymentData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, tags ?? new ChangeTrackingDictionary(), location, - identity, properties, - sku, - serializedAdditionalRawData); + identity, + sku); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -190,15 +217,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - NginxDeploymentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (NginxDeploymentData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentData(document.RootElement, options); } default: @@ -206,6 +238,26 @@ NginxDeploymentData IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxDeploymentData nginxDeploymentData) + { + if (nginxDeploymentData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxDeploymentData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static NginxDeploymentData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs index 54759c5e6679..8fb46b3bbf81 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs @@ -13,82 +13,57 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxDeployment data model. + /// Nginx Deployment. public partial class NginxDeploymentData : TrackedResourceData { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The location. + /// The geo-location where the resource lives. public NginxDeploymentData(AzureLocation location) : base(location) { } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Gets or sets the identity. - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, NginxDeploymentProperties properties, NginxResourceSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Resource tags. + /// The geo-location where the resource lives. + /// Nginx Deployment Properties. + /// Identity Properties. + /// Resource Sku. + internal NginxDeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, NginxDeploymentProperties properties, ManagedServiceIdentity identity, NginxResourceSku sku) : base(id, name, resourceType, systemData, tags, location) { - Identity = identity; + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; + Identity = identity; Sku = sku; - _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal NginxDeploymentData() - { - } + /// Nginx Deployment Properties. + public NginxDeploymentProperties Properties { get; set; } - /// Gets or sets the identity. + /// Identity Properties. public ManagedServiceIdentity Identity { get; set; } - /// Gets or sets the properties. - public NginxDeploymentProperties Properties { get; set; } - /// Gets or sets the sku. + + /// Resource Sku. internal NginxResourceSku Sku { get; set; } + /// Name of the SKU. public string SkuName { - get => Sku is null ? default : Sku.Name; - set => Sku = new NginxResourceSku(value); + get + { + return Sku is null ? default : Sku.Name; + } + set + { + Sku = new NginxResourceSku(value); + } } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.Serialization.cs index 4f49954262ae..9d7579c8cd6a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.Nginx { + /// public partial class NginxDeploymentResource : IJsonModel { - private static NginxDeploymentData s_dataDeserializationInstance; - private static NginxDeploymentData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new NginxDeploymentData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - NginxDeploymentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + NginxDeploymentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerNginxContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. NginxDeploymentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerNginxContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs index 04a7ce73d44a..1b9b7d95e3bc 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs @@ -7,47 +7,37 @@ using System; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Nginx.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Nginx { /// - /// A Class representing a NginxDeployment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetNginxDeploymentResource method. - /// Otherwise you can get one from its parent resource using the GetNginxDeployment method. + /// A class representing a NginxDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetNginxDeployments method. /// public partial class NginxDeploymentResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The deploymentName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; - private readonly DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; + private readonly ClientDiagnostics _nginxDeploymentsClientDiagnostics; + private readonly NginxDeployments _nginxDeploymentsRestClient; private readonly NginxDeploymentData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Nginx.NginxPlus/nginxDeployments"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxDeploymentResource for mocking. protected NginxDeploymentResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal NginxDeploymentResource(ArmClient client, NginxDeploymentData data) : this(client, data.Id) @@ -56,279 +46,197 @@ internal NginxDeploymentResource(ArmClient client, NginxDeploymentData data) : t _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal NginxDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxDeploymentDeploymentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string nginxDeploymentDeploymentsApiVersion); - _nginxDeploymentDeploymentsRestClient = new DeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentDeploymentsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string nginxDeploymentApiVersion); + _nginxDeploymentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + _nginxDeploymentsRestClient = new NginxDeployments(_nginxDeploymentsClientDiagnostics, Pipeline, Endpoint, nginxDeploymentApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); } /// 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 NginxDeploymentData 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 a collection of NginxDeploymentApiKeyResources in the NginxDeployment. - /// An object representing collection of NginxDeploymentApiKeyResources and their operations over a NginxDeploymentApiKeyResource. - public virtual NginxDeploymentApiKeyCollection GetNginxDeploymentApiKeys() - { - return GetCachedClient(client => new NginxDeploymentApiKeyCollection(client, Id)); - } - - /// - /// Get the specified API Key of the given Nginx deployment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} - /// - /// - /// Operation Id - /// ApiKeys_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource name of the API key. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNginxDeploymentApiKeyAsync(string apiKeyName, CancellationToken cancellationToken = default) - { - return await GetNginxDeploymentApiKeys().GetAsync(apiKeyName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the specified API Key of the given Nginx deployment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName} - /// - /// - /// Operation Id - /// ApiKeys_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The resource name of the API key. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNginxDeploymentApiKey(string apiKeyName, CancellationToken cancellationToken = default) - { - return GetNginxDeploymentApiKeys().Get(apiKeyName, cancellationToken); - } - - /// Gets a collection of NginxCertificateResources in the NginxDeployment. - /// An object representing collection of NginxCertificateResources and their operations over a NginxCertificateResource. - public virtual NginxCertificateCollection GetNginxCertificates() - { - return GetCachedClient(client => new NginxCertificateCollection(client, Id)); - } - - /// - /// Get a certificate of given NGINX deployment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificates_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of certificate. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNginxCertificateAsync(string certificateName, CancellationToken cancellationToken = default) - { - return await GetNginxCertificates().GetAsync(certificateName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a certificate of given NGINX deployment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificates_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of certificate. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNginxCertificate(string certificateName, CancellationToken cancellationToken = default) + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName) { - return GetNginxCertificates().Get(certificateName, cancellationToken); + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); } - /// Gets a collection of NginxConfigurationResources in the NginxDeployment. - /// An object representing collection of NginxConfigurationResources and their operations over a NginxConfigurationResource. - public virtual NginxConfigurationCollection GetNginxConfigurations() + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) { - return GetCachedClient(client => new NginxConfigurationCollection(client, Id)); + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// - /// Get the NGINX configuration of given NGINX deployment + /// Get the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNginxConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - return await GetNginxConfigurations().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Get the NGINX configuration of given NGINX deployment + /// Get the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Configurations_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNginxConfiguration(string configurationName, CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - return GetNginxConfigurations().Get(configurationName, cancellationToken); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Get the NGINX deployment + /// Update the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Get + /// Operation Id. + /// NginxDeployments_Update. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Nginx deployment update parameters. /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentPatch patch = default, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, NginxDeploymentPatch.ToRequestContent(patch), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentOperationSource(Client), + _nginxDeploymentsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; } catch (Exception e) { @@ -338,37 +246,53 @@ public virtual async Task> GetAsync(Cancellati } /// - /// Get the NGINX deployment + /// Update the NGINX deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Get + /// Operation Id. + /// NginxDeployments_Update. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Nginx deployment update parameters. /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentPatch patch = default, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, NginxDeploymentPatch.ToRequestContent(patch), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentOperationSource(Client), + _nginxDeploymentsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; } catch (Exception e) { @@ -381,20 +305,20 @@ public virtual Response Get(CancellationToken cancellat /// Delete the NGINX deployment resource /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Delete + /// Operation Id. + /// NginxDeployments_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -402,14 +326,21 @@ public virtual Response Get(CancellationToken cancellat /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxDeploymentDeploymentsClientDiagnostics, Pipeline, _nginxDeploymentDeploymentsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation(_nginxDeploymentsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -423,20 +354,20 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// Delete the NGINX deployment resource /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Operation Id - /// Deployments_Delete + /// Operation Id. + /// NginxDeployments_Delete. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -444,14 +375,21 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxDeploymentDeploymentsClientDiagnostics, Pipeline, _nginxDeploymentDeploymentsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation(_nginxDeploymentsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -462,89 +400,109 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Update the NGINX deployment + /// List Waf Policies of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies. /// /// - /// Operation Id - /// Deployments_Update + /// Operation Id. + /// NginxDeployments_WafPolicyList. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetWafPoliciesAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); - scope.Start(); - try - { - var response = await _nginxDeploymentDeploymentsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentDeploymentsClientDiagnostics, Pipeline, _nginxDeploymentDeploymentsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) + RequestContext context = new RequestContext { - scope.Failed(e); - throw; - } + CancellationToken = cancellationToken + }; + return new NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT(_nginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// - /// Update the NGINX deployment + /// List Waf Policies of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies. /// /// - /// Operation Id - /// Deployments_Update + /// Operation Id. + /// NginxDeployments_WafPolicyList. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The to use. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetWafPolicies(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new NginxDeploymentsGetWafPoliciesCollectionResultOfT(_nginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + } - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies. + /// + /// + /// Operation Id. + /// NginxDeployments_DefaultWafPolicyList. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetDefaultWafPoliciesAsync(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.GetDefaultWafPolicies"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentDeploymentsClientDiagnostics, Pipeline, _nginxDeploymentDeploymentsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetDefaultWafPoliciesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentDefaultWafPolicyListResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; } catch (Exception e) { @@ -554,26 +512,54 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } /// - /// Add a tag to the current resource. + /// Get the Nginx Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies. /// /// - /// Operation Id - /// Deployments_Get + /// Operation Id. + /// NginxDeployments_DefaultWafPolicyList. /// /// - /// Default Api Version - /// 2024-11-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// + /// The cancellation token to use. + public virtual Response GetDefaultWafPolicies(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.GetDefaultWafPolicies"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetDefaultWafPoliciesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentDefaultWafPolicyListResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -583,28 +569,34 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new NginxDeploymentPatch(); - foreach (var tag in current.Tags) + NginxDeploymentData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + NginxDeploymentPatch patch = new NginxDeploymentPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -615,27 +607,7 @@ public virtual async Task> AddTagAsync(string } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -645,28 +617,34 @@ public virtual Response AddTag(string key, string value Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new NginxDeploymentPatch(); - foreach (var tag in current.Tags) + NginxDeploymentData current = Get(cancellationToken: cancellationToken).Value.Data; + NginxDeploymentPatch patch = new NginxDeploymentPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -677,53 +655,39 @@ public virtual Response AddTag(string key, string value } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.SetTags"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.SetTags"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new NginxDeploymentPatch(); + NginxDeploymentData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + NginxDeploymentPatch patch = new NginxDeploymentPatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -734,53 +698,39 @@ public virtual async Task> SetTagsAsync(IDicti } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.SetTags"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.SetTags"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); + GetTagResource().Delete(WaitUntil.Completed, cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new NginxDeploymentPatch(); + NginxDeploymentData current = Get(cancellationToken: cancellationToken).Value.Data; + NginxDeploymentPatch patch = new NginxDeploymentPatch(); patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -791,27 +741,7 @@ public virtual Response SetTags(IDictionary - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -819,28 +749,34 @@ public virtual async Task> RemoveTagAsync(stri { Argument.AssertNotNull(key, nameof(key)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new NginxDeploymentPatch(); - foreach (var tag in current.Tags) + NginxDeploymentData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + NginxDeploymentPatch patch = new NginxDeploymentPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -851,27 +787,7 @@ public virtual async Task> RemoveTagAsync(stri } } - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// Deployments_Get - /// - /// - /// Default Api Version - /// 2024-11-01-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -879,28 +795,34 @@ public virtual Response RemoveTag(string key, Cancellat { Argument.AssertNotNull(key, nameof(key)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentData.FromResponse(result), result); + return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new NginxDeploymentPatch(); - foreach (var tag in current.Tags) + NginxDeploymentData current = Get(cancellationToken: cancellationToken).Value.Data; + NginxDeploymentPatch patch = new NginxDeploymentPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -910,5 +832,137 @@ public virtual Response RemoveTag(string key, Cancellat throw; } } + + /// Gets a collection of NginxDeploymentApiKeys in the . + /// An object representing collection of NginxDeploymentApiKeys and their operations over a NginxDeploymentApiKeyResource. + public virtual NginxDeploymentApiKeyCollection GetNginxDeploymentApiKeys() + { + return GetCachedClient(client => new NginxDeploymentApiKeyCollection(client, Id)); + } + + /// Get the specified API Key of the given Nginx deployment. + /// The resource name of the API key. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNginxDeploymentApiKeyAsync(string apiKeyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); + + return await GetNginxDeploymentApiKeys().GetAsync(apiKeyName, cancellationToken).ConfigureAwait(false); + } + + /// Get the specified API Key of the given Nginx deployment. + /// The resource name of the API key. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNginxDeploymentApiKey(string apiKeyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); + + return GetNginxDeploymentApiKeys().Get(apiKeyName, cancellationToken); + } + + /// Gets a collection of NginxCertificates in the . + /// An object representing collection of NginxCertificates and their operations over a NginxCertificateResource. + public virtual NginxCertificateCollection GetNginxCertificates() + { + return GetCachedClient(client => new NginxCertificateCollection(client, Id)); + } + + /// Get a certificate of given NGINX deployment. + /// The name of certificate. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNginxCertificateAsync(string certificateName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); + + return await GetNginxCertificates().GetAsync(certificateName, cancellationToken).ConfigureAwait(false); + } + + /// Get a certificate of given NGINX deployment. + /// The name of certificate. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNginxCertificate(string certificateName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); + + return GetNginxCertificates().Get(certificateName, cancellationToken); + } + + /// Gets a collection of NginxConfigurations in the . + /// An object representing collection of NginxConfigurations and their operations over a NginxConfigurationResource. + public virtual NginxConfigurationCollection GetNginxConfigurations() + { + return GetCachedClient(client => new NginxConfigurationCollection(client, Id)); + } + + /// Get the NGINX configuration of given NGINX deployment. + /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNginxConfigurationAsync(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + return await GetNginxConfigurations().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); + } + + /// Get the NGINX configuration of given NGINX deployment. + /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNginxConfiguration(string configurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); + + return GetNginxConfigurations().Get(configurationName, cancellationToken); + } + + /// Gets a collection of NginxDeploymentWafPolicies in the . + /// An object representing collection of NginxDeploymentWafPolicies and their operations over a NginxDeploymentWafPolicyResource. + public virtual NginxDeploymentWafPolicyCollection GetNginxDeploymentWafPolicies() + { + return GetCachedClient(client => new NginxDeploymentWafPolicyCollection(client, Id)); + } + + /// Get the Nginx Waf Policy of given Nginx deployment. + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNginxDeploymentWafPolicyAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + return await GetNginxDeploymentWafPolicies().GetAsync(wafPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// Get the Nginx Waf Policy of given Nginx deployment. + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNginxDeploymentWafPolicy(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + return GetNginxDeploymentWafPolicies().Get(wafPolicyName, cancellationToken); + } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs new file mode 100644 index 000000000000..ef1de4e98111 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Nginx +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNginxDeploymentWafPolicies method from an instance of . + /// + public partial class NginxDeploymentWafPolicyCollection : ArmCollection + { + private readonly ClientDiagnostics _nginxDeploymentWafPoliciesClientDiagnostics; + private readonly NginxDeploymentWafPolicies _nginxDeploymentWafPoliciesRestClient; + + /// Initializes a new instance of NginxDeploymentWafPolicyCollection for mocking. + protected NginxDeploymentWafPolicyCollection() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal NginxDeploymentWafPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + TryGetApiVersion(NginxDeploymentWafPolicyResource.ResourceType, out string nginxDeploymentWafPolicyApiVersion); + _nginxDeploymentWafPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentWafPolicyResource.ResourceType.Namespace, Diagnostics); + _nginxDeploymentWafPoliciesRestClient = new NginxDeploymentWafPolicies(_nginxDeploymentWafPoliciesClientDiagnostics, Pipeline, Endpoint, nginxDeploymentWafPolicyApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); + } + + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != NginxDeploymentResource.ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, NginxDeploymentResource.ResourceType), id); + } + } + + /// + /// Create or update the Nginx Waf Policy for given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of Waf Policy. + /// The Nginx Deployment Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string wafPolicyName, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, NginxDeploymentWafPolicyData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentWafPolicyOperationSource(Client), + _nginxDeploymentWafPoliciesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update the Nginx Waf Policy for given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of Waf Policy. + /// The Nginx Deployment Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string wafPolicyName, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, NginxDeploymentWafPolicyData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentWafPolicyOperationSource(Client), + _nginxDeploymentWafPoliciesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentWafPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response Get(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentWafPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> ExistsAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentWafPolicyData)null, result); + break; + default: + throw new RequestFailedException(result); + } + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual Response Exists(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentWafPolicyData)null, result); + break; + default: + throw new RequestFailedException(result); + } + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual async Task> GetIfExistsAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentWafPolicyData)null, result); + break; + default: + throw new RequestFailedException(result); + } + if (response.Value == null) + { + return new NoValueResponse(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentWafPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public virtual NullableResponse GetIfExists(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, wafPolicyName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((NginxDeploymentWafPolicyData)null, result); + break; + default: + throw new RequestFailedException(result); + } + if (response.Value == null) + { + return new NoValueResponse(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentWafPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs new file mode 100644 index 000000000000..31720f439d36 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + /// Nginx Deployment Waf Policy. + public partial class NginxDeploymentWafPolicyData : ResourceData, IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyData)} does not support writing '{format}' format."); + } + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (NginxDeploymentWafPolicyData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyData)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyData(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyData DeserializeNginxDeploymentWafPolicyData(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType resourceType = default; + SystemData systemData = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + NginxDeploymentWafPolicyProperties properties = default; + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("type"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + continue; + } + if (prop.NameEquals("properties"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxDeploymentWafPolicyProperties.DeserializeNginxDeploymentWafPolicyProperties(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentWafPolicyData( + id, + name, + resourceType, + systemData, + additionalBinaryDataProperties, + properties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerNginxContext.Default); + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyData)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (NginxDeploymentWafPolicyData)PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializeNginxDeploymentWafPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyData)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(NginxDeploymentWafPolicyData nginxDeploymentWafPolicyData) + { + if (nginxDeploymentWafPolicyData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(nginxDeploymentWafPolicyData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static NginxDeploymentWafPolicyData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNginxDeploymentWafPolicyData(document.RootElement, ModelSerializationExtensions.WireOptions); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs new file mode 100644 index 000000000000..0ad28bfa11aa --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + /// Nginx Deployment Waf Policy. + public partial class NginxDeploymentWafPolicyData : ResourceData + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public NginxDeploymentWafPolicyData() + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Nginx Deployment Waf Policy Properties. + internal NginxDeploymentWafPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, NginxDeploymentWafPolicyProperties properties) : base(id, name, resourceType, systemData) + { + _additionalBinaryDataProperties = additionalBinaryDataProperties; + Properties = properties; + } + + /// Nginx Deployment Waf Policy Properties. + public NginxDeploymentWafPolicyProperties Properties { get; set; } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs new file mode 100644 index 000000000000..8149623ae42d --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Nginx +{ + /// + public partial class NginxDeploymentWafPolicyResource : IJsonModel + { + private static IJsonModel s_dataDeserializationInstance; + + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new NginxDeploymentWafPolicyData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + /// The reader for deserializing the model. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerNginxContext.Default); + + /// The binary data to be processed. + /// The client options for reading and writing models. + NginxDeploymentWafPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerNginxContext.Default); + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs new file mode 100644 index 000000000000..1c5d478250af --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Nginx +{ + /// + /// A class representing a NginxDeploymentWafPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetNginxDeploymentWafPolicies method. + /// + public partial class NginxDeploymentWafPolicyResource : ArmResource + { + private readonly ClientDiagnostics _nginxDeploymentWafPoliciesClientDiagnostics; + private readonly NginxDeploymentWafPolicies _nginxDeploymentWafPoliciesRestClient; + private readonly NginxDeploymentWafPolicyData _data; + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Nginx.NginxPlus/nginxDeployments/wafPolicies"; + + /// Initializes a new instance of NginxDeploymentWafPolicyResource for mocking. + protected NginxDeploymentWafPolicyResource() + { + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NginxDeploymentWafPolicyResource(ArmClient client, NginxDeploymentWafPolicyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal NginxDeploymentWafPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + TryGetApiVersion(ResourceType, out string nginxDeploymentWafPolicyApiVersion); + _nginxDeploymentWafPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + _nginxDeploymentWafPoliciesRestClient = new NginxDeploymentWafPolicies(_nginxDeploymentWafPoliciesClientDiagnostics, Pipeline, Endpoint, nginxDeploymentWafPolicyApiVersion ?? "2025-03-01-preview"); + ValidateResourceId(id); + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + public virtual NginxDeploymentWafPolicyData Data + { + get + { + if (!HasData) + { + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } + return _data; + } + } + + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + /// The wafPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentWafPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(NginxDeploymentWafPolicyData.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return Response.FromValue(new NginxDeploymentWafPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Reset the Nginx Waf Policy of given Nginx deployment to default + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Delete. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation(_nginxDeploymentWafPoliciesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Reset the Nginx Waf Policy of given Nginx deployment to default + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Delete. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation(_nginxDeploymentWafPoliciesClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletionResponse(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NginxDeploymentWafPolicy. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Nginx Deployment Waf Policy. + /// The cancellation token to use. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxDeploymentWafPolicyData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentWafPolicyOperationSource(Client), + _nginxDeploymentWafPoliciesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NginxDeploymentWafPolicy. + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. + /// + /// + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. + /// + /// + /// Default Api Version. + /// 2025-03-01-preview. + /// + /// + /// Resource. + /// . + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Nginx Deployment Waf Policy. + /// The cancellation token to use. + public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _nginxDeploymentWafPoliciesRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, NginxDeploymentWafPolicyData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + NginxArmOperation operation = new NginxArmOperation( + new NginxDeploymentWafPolicyOperationSource(Client), + _nginxDeploymentWafPoliciesClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + { + operation.WaitForCompletion(cancellationToken); + } + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ProviderConstants.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ProviderConstants.cs index c3695e01a0d8..a0e9bf7a0ef8 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ProviderConstants.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ProviderConstants.cs @@ -9,8 +9,9 @@ namespace Azure.ResourceManager.Nginx { - internal static class ProviderConstants + internal static partial class ProviderConstants { + /// Gets the DefaultProviderNamespace. public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ApiKeysRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ApiKeysRestOperations.cs deleted file mode 100644 index 25acefdb48c5..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ApiKeysRestOperations.cs +++ /dev/null @@ -1,523 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; - -namespace Azure.ResourceManager.Nginx -{ - internal partial class ApiKeysRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ApiKeysRestOperations. - /// 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 ApiKeysRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys/", false); - uri.AppendPath(apiKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys/", false); - uri.AppendPath(apiKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The resource name of the API key. - /// The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - NginxDeploymentApiKeyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The resource name of the API key. - /// The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - NginxDeploymentApiKeyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys/", false); - uri.AppendPath(apiKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys/", false); - uri.AppendPath(apiKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete API key for Nginx deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The resource name of the API key. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete API key for Nginx deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The resource name of the API key. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys/", false); - uri.AppendPath(apiKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys/", false); - uri.AppendPath(apiKeyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the specified API Key of the given Nginx deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The resource name of the API key. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentApiKeyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxDeploymentApiKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the specified API Key of the given Nginx deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The resource name of the API key. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentApiKeyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxDeploymentApiKeyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/apiKeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all API Keys of the given Nginx deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentApiKeyListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentApiKeyListResponse.DeserializeNginxDeploymentApiKeyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all API Keys of the given Nginx deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentApiKeyListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentApiKeyListResponse.DeserializeNginxDeploymentApiKeyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all API Keys of the given Nginx deployment. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentApiKeyListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentApiKeyListResponse.DeserializeNginxDeploymentApiKeyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all API Keys of the given Nginx deployment. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentApiKeyListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentApiKeyListResponse.DeserializeNginxDeploymentApiKeyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/CertificatesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/CertificatesRestOperations.cs deleted file mode 100644 index 92246d90e58f..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/CertificatesRestOperations.cs +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; - -namespace Azure.ResourceManager.Nginx -{ - internal partial class CertificatesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of CertificatesRestOperations. - /// 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 CertificatesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(certificateName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(certificateName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a certificate of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of certificate. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, certificateName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxCertificateData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxCertificateData.DeserializeNginxCertificateData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxCertificateData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a certificate of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of certificate. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, certificateName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxCertificateData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxCertificateData.DeserializeNginxCertificateData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxCertificateData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, NginxCertificateData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(certificateName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, NginxCertificateData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(certificateName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create or update the NGINX certificates for given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of certificate. - /// The certificate. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, NginxCertificateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, certificateName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update the NGINX certificates for given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of certificate. - /// The certificate. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, NginxCertificateData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, certificateName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(certificateName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates/", false); - uri.AppendPath(certificateName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a certificate from the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of certificate. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, certificateName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a certificate from the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of certificate. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, certificateName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/certificates", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all certificates of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxCertificateListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxCertificateListResponse.DeserializeNginxCertificateListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all certificates of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxCertificateListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxCertificateListResponse.DeserializeNginxCertificateListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all certificates of given NGINX deployment. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxCertificateListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxCertificateListResponse.DeserializeNginxCertificateListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all certificates of given NGINX deployment. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxCertificateListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxCertificateListResponse.DeserializeNginxCertificateListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ConfigurationsRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ConfigurationsRestOperations.cs deleted file mode 100644 index c9510222e04b..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ConfigurationsRestOperations.cs +++ /dev/null @@ -1,626 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; - -namespace Azure.ResourceManager.Nginx -{ - internal partial class ConfigurationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ConfigurationsRestOperations. - /// 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 ConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the NGINX configuration of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxConfigurationListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxConfigurationListResponse.DeserializeNginxConfigurationListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the NGINX configuration of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxConfigurationListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxConfigurationListResponse.DeserializeNginxConfigurationListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the NGINX configuration of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxConfigurationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxConfigurationData.DeserializeNginxConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the NGINX configuration of given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxConfigurationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxConfigurationData.DeserializeNginxConfigurationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxConfigurationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create or update the NGINX configuration for given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The NGINX configuration. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update the NGINX configuration for given NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The NGINX configuration. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Reset the NGINX configuration of given NGINX deployment to default. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Reset the NGINX configuration of given NGINX deployment to default. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateAnalysisRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxAnalysisContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendPath("/analyze", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateAnalysisRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxAnalysisContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations/", false); - uri.AppendPath(configurationName, true); - uri.AppendPath("/analyze", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (content != null) - { - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - } - _userAgent.Apply(message); - return message; - } - - /// Analyze an NGINX configuration without applying it to the NGINXaaS deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The NGINX configuration to analyze. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> AnalysisAsync(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxAnalysisContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - - using var message = CreateAnalysisRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxAnalysisResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxAnalysisResult.DeserializeNginxAnalysisResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Analyze an NGINX configuration without applying it to the NGINXaaS deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The name of configuration, only 'default' is supported value due to the singleton of NGINX conf. - /// The NGINX configuration to analyze. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Analysis(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxAnalysisContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - - using var message = CreateAnalysisRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxAnalysisResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxAnalysisResult.DeserializeNginxAnalysisResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the NGINX configuration of given NGINX deployment. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxConfigurationListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxConfigurationListResponse.DeserializeNginxConfigurationListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the NGINX configuration of given NGINX deployment. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxConfigurationListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxConfigurationListResponse.DeserializeNginxConfigurationListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/DeploymentsRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/DeploymentsRestOperations.cs deleted file mode 100644 index 1dfd9fbf6615..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/DeploymentsRestOperations.cs +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; - -namespace Azure.ResourceManager.Nginx -{ - internal partial class DeploymentsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DeploymentsRestOperations. - /// 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 DeploymentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentData.DeserializeNginxDeploymentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxDeploymentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentData.DeserializeNginxDeploymentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxDeploymentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create or update the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or update the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, deploymentName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the NGINX deployment. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, deploymentName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); - uri.AppendPath(deploymentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete the NGINX deployment resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete the NGINX deployment resource. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of targeted NGINX deployment. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the NGINX deployments resources. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the NGINX deployments resources. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all NGINX deployments under the specified resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all NGINX deployments under the specified resource group. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the NGINX deployments resources. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the NGINX deployments resources. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all NGINX deployments under the specified resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all NGINX deployments under the specified resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs new file mode 100644 index 000000000000..8d0a25a11a2f --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxCertificates + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NginxCertificates for mocking. + protected NginxCertificates() + { + } + + /// Initializes a new instance of NginxCertificates. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal NginxCertificates(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string certificateName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(certificateName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string certificateName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(certificateName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string certificateName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/certificates/", false); + uri.AppendPath(certificateName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/certificates", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs new file mode 100644 index 000000000000..8a2a72d75087 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxConfigurationResponses + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NginxConfigurationResponses for mocking. + protected NginxConfigurationResponses() + { + } + + /// Initializes a new instance of NginxConfigurationResponses. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal NginxConfigurationResponses(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/configurations/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/configurations/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/configurations/", false); + uri.AppendPath(configurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/configurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateAnalysisRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/configurations/", false); + uri.AppendPath(configurationName, true); + uri.AppendPath("/analyze", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Post; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs new file mode 100644 index 000000000000..7135556242ff --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentApiKeyResponses + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NginxDeploymentApiKeyResponses for mocking. + protected NginxDeploymentApiKeyResponses() + { + } + + /// Initializes a new instance of NginxDeploymentApiKeyResponses. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal NginxDeploymentApiKeyResponses(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/apiKeys/", false); + uri.AppendPath(apiKeyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/apiKeys/", false); + uri.AppendPath(apiKeyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/apiKeys/", false); + uri.AppendPath(apiKeyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/apiKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs new file mode 100644 index 000000000000..f99db7716444 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentWafPolicies + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NginxDeploymentWafPolicies for mocking. + protected NginxDeploymentWafPolicies() + { + } + + /// Initializes a new instance of NginxDeploymentWafPolicies. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal NginxDeploymentWafPolicies(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs new file mode 100644 index 000000000000..7d7f3754b592 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeployments + { + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NginxDeployments for mocking. + protected NginxDeployments() + { + } + + /// Initializes a new instance of NginxDeployments. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal NginxDeployments(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; + } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Put; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContent content, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Patch; + if ("application/json" != null) + { + request.Headers.SetValue("Content-Type", "application/json"); + } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Delete; + return message; + } + + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetByResourceGroupRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetWafPoliciesRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/wafPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateNextGetWafPoliciesRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetDefaultWafPoliciesRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) + { + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId.ToString(), true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/listDefaultWafPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Post; + request.Headers.SetValue("Accept", "application/json"); + return message; + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/autorest.md b/sdk/nginx/Azure.ResourceManager.Nginx/src/autorest.md deleted file mode 100644 index 19bbc7b88a1f..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/autorest.md +++ /dev/null @@ -1,82 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml - -azure-arm: true -csharp: true -library-name: Nginx -namespace: Azure.ResourceManager.Nginx -require: https://github.com/Azure/azure-rest-api-specs/blob/7a3f210cf6924c6139e2493f5fd0625919af1f32/specification/nginx/resource-manager/readme.md -#tag: package-2024-11-01-preview -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../tests/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -rename-mapping: - NginxNetworkInterfaceConfiguration.subnetId: -|arm-id - NginxPrivateIPAddress.privateIPAddress: -|ip-address - NginxPrivateIPAddress.subnetId: -|arm-id - AnalysisCreate : NginxAnalysisContent - AnalysisCreateConfig: NginxAnalysisConfig - NginxCertificateErrorResponseBody: NginxCertificateError - ActivationState : WebApplicationFirewallActivationState - AnalysisResultData: NginxAnalysisResultDetails - Level: NginxDiagnosticLevel - NginxConfigurationResponse: NginxConfiguration - NginxConfigurationResponseProperties: NginxConfigurationProperties - NginxDeploymentApiKeyResponse: NginxDeploymentApiKey - NginxDeploymentApiKeyResponseProperties: NginxDeploymentApiKeyProperties - NginxConfigurationRequestProperties: NginxConfigurationCreateOrUpdateProperties - NginxConfigurationProtectedFileRequest: NginxConfigurationProtectedFileContent - NginxConfigurationProtectedFileResponse: NginxConfigurationProtectedFileResult - -prepend-rp-prefix: - - AnalysisDiagnostic - - AnalysisResult - - DiagnosticItem - - ProvisioningState - - ResourceSku - - ScaleProfile - - ScaleProfileCapacity - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag -``` diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Azure.ResourceManager.Nginx.Tests.csproj b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Azure.ResourceManager.Nginx.Tests.csproj index 32f11f754ac5..37b84218f0ba 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Azure.ResourceManager.Nginx.Tests.csproj +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Azure.ResourceManager.Nginx.Tests.csproj @@ -11,6 +11,8 @@ - + + + diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/NginxManagementTestBase.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/NginxManagementTestBase.cs index 43996b1b77e2..d5d616bef658 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/NginxManagementTestBase.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/NginxManagementTestBase.cs @@ -240,9 +240,8 @@ protected async Task CreateNginxDeployment(ResourceGrou FrontEndIPConfiguration = frontEndIPConfiguration, NetworkInterfaceSubnetId = subnetId }; - - NginxDeploymentScalingProperties nginxDeploymentScalingProperties = new NginxDeploymentScalingProperties(10, new List(), null); - + NginxDeploymentAutoScaleSettings autoScaleSettings = new NginxDeploymentAutoScaleSettings(new List()); + NginxDeploymentScalingProperties nginxDeploymentScalingProperties = new NginxDeploymentScalingProperties(10, autoScaleSettings, null); AutoUpgradeProfile autoUpgradeProfile = new AutoUpgradeProfile { UpgradeChannel = "preview" @@ -296,7 +295,7 @@ protected async Task CreateNginxConfiguration(NginxD if (protectedFileVirtualPath != null) { - NginxConfigurationProtectedFileContent protectedFile = new NginxConfigurationProtectedFileContent + NginxConfigurationContentProtectedFile protectedFile = new NginxConfigurationContentProtectedFile { Content = NginxConfigurationContent, VirtualPath = protectedFileVirtualPath diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateCollectionTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateCollectionTests.cs index 677f4590c95f..eb9e50ac41f1 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateCollectionTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateCollectionTests.cs @@ -43,13 +43,6 @@ public async Task CreateOrUpdate() const string keyVirtualPath = "/etc/nginx/nginx.key"; NginxCertificateResource nginxCertificate = await CreateNginxCertificate(Location, nginxDeployment, nginxCertificateName, certificateVirtualPath, keyVirtualPath); Assert.IsTrue(nginxCertificateName.Equals(nginxCertificate.Data.Name, StringComparison.InvariantCultureIgnoreCase)); - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.GetNginxCertificates().CreateOrUpdateAsync(WaitUntil.Completed, nginxCertificateName, null)).Value); - - NginxCertificateData nginxCertificateData = new NginxCertificateData - { - Location = Location - }; - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.GetNginxCertificates().CreateOrUpdateAsync(WaitUntil.Completed, null, nginxCertificateData)).Value); } [TestCase] diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs index 5336f9b57474..d382fad7cf40 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs @@ -42,7 +42,6 @@ public void CreateResourceIdentifier() NginxCertificateResource.ValidateResourceId(nginxCertificateResourceIdentifier); Assert.IsTrue(nginxCertificateResourceIdentifier.ResourceType.Equals(NginxCertificateResource.ResourceType)); - Assert.Throws(() => NginxCertificateResource.ValidateResourceId(ResGroup.Data.Id)); } [TestCase] @@ -137,7 +136,6 @@ public async Task Update() Assert.AreNotEqual(nginxCertificate.Data.Properties.CertificateVirtualPath, nginxCertificate2.Data.Properties.CertificateVirtualPath); Assert.AreNotEqual(nginxCertificate.Data.Properties.KeyVirtualPath, nginxCertificate2.Data.Properties.KeyVirtualPath); - Assert.ThrowsAsync(async () => _ = (await nginxCertificate.UpdateAsync(WaitUntil.Completed, null)).Value); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationCollectionTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationCollectionTests.cs index 972495de5f1e..0b9b5f90c46d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationCollectionTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationCollectionTests.cs @@ -42,12 +42,6 @@ public async Task CreateOrUpdate() const string nginxConfigurationName = "default"; const string virtualPath = "/etc/nginx/nginx.conf"; NginxConfigurationResource nginxConfiguration = await CreateNginxConfiguration(nginxDeployment, nginxConfigurationName, virtualPath); - - Assert.IsTrue(nginxConfigurationName.Equals(nginxConfiguration.Data.Name)); - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.GetNginxConfigurations().CreateOrUpdateAsync(WaitUntil.Completed, nginxConfigurationName, null)).Value); - - NginxConfigurationCreateOrUpdateContent nginxConfigurationCreateOrUpdateContent = new NginxConfigurationCreateOrUpdateContent(); - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.GetNginxConfigurations().CreateOrUpdateAsync(WaitUntil.Completed, null, nginxConfigurationCreateOrUpdateContent)).Value); } [TestCase] diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs index 6329eec741e1..14e21dbe2a51 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs @@ -42,7 +42,6 @@ public void CreateResourceIdentifier() NginxConfigurationResource.ValidateResourceId(nginxConfigurationResourceIdentifier); Assert.IsTrue(nginxConfigurationResourceIdentifier.ResourceType.Equals(NginxConfigurationResource.ResourceType)); - Assert.Throws(() => NginxConfigurationResource.ValidateResourceId(ResGroup.Data.Id)); } [TestCase] @@ -138,7 +137,6 @@ public async Task Update() NginxConfigurationResource nginxConfiguration2 = (await nginxConfiguration.UpdateAsync(WaitUntil.Completed, nginxConfigurationCreateOrUpdateContent)).Value; Assert.AreNotEqual(nginxConfiguration.Data.Properties.RootFile, nginxConfiguration2.Data.Properties.RootFile); - Assert.ThrowsAsync(async () => _ = (await nginxConfiguration.UpdateAsync(WaitUntil.Completed, null)).Value); } [TestCase] @@ -159,7 +157,7 @@ public async Task Analysis() VirtualPath = virtualPath }; - NginxConfigurationProtectedFileContent protectedFile = new NginxConfigurationProtectedFileContent + NginxConfigurationContentProtectedFile protectedFile = new NginxConfigurationContentProtectedFile { Content = NginxConfigurationContent, VirtualPath = protectedFileVirtualPath diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyCollectionTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyCollectionTests.cs index 15c1dba6d764..c5fd9d0ae09e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyCollectionTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyCollectionTests.cs @@ -44,18 +44,6 @@ public async Task CreateOrUpdate() NginxDeploymentApiKeyResource nginxDeploymentApiKey = await CreateNginxDeploymentApiKey(nginxDeployment, nginxDeploymentApiKeyName); Assert.IsTrue(nginxDeploymentApiKeyName.Equals(nginxDeploymentApiKey.Data.Name)); - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.GetNginxDeploymentApiKeys().CreateOrUpdateAsync(WaitUntil.Completed, nginxDeploymentApiKeyName, null)).Value); - - NginxDeploymentApiKeyRequestProperties apiKeyProperties = new NginxDeploymentApiKeyRequestProperties - { - SecretText = NginxDeploymentApiKeySecretText - }; - - NginxDeploymentApiKeyCreateOrUpdateContent nginxDeploymentApiKeyCreateOrUpdateContent = new NginxDeploymentApiKeyCreateOrUpdateContent - { - Properties = apiKeyProperties - }; - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.GetNginxDeploymentApiKeys().CreateOrUpdateAsync(WaitUntil.Completed, null, nginxDeploymentApiKeyCreateOrUpdateContent)).Value); } [TestCase] diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs index f848d797e4ac..90e48859cd8d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs @@ -43,7 +43,6 @@ public void CreateResourceIdentifier() NginxDeploymentApiKeyResource.ValidateResourceId(nginxDeploymentApiKeyResourceIdentifier); Assert.IsTrue(nginxDeploymentApiKeyResourceIdentifier.ResourceType.Equals(NginxDeploymentApiKeyResource.ResourceType)); - Assert.Throws(() => NginxDeploymentApiKeyResource.ValidateResourceId(ResGroup.Data.Id)); } [TestCase] @@ -119,7 +118,6 @@ public async Task Update() }; NginxDeploymentApiKeyResource updatedNginxDeploymentApiKey = (await nginxDeploymentApiKey.UpdateAsync(WaitUntil.Completed, nginxDeploymentApiKeyCreateOrUpdateContent)).Value; Assert.AreEqual(apiKeyProperties.SecretText.Substring(0, 3), updatedNginxDeploymentApiKey.Data.Properties.Hint); - Assert.ThrowsAsync(async () => _ = (await nginxDeploymentApiKey.UpdateAsync(WaitUntil.Completed, null)).Value); } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentCollectionTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentCollectionTests.cs index 1d23b4c932d9..454f7109b9d5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentCollectionTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentCollectionTests.cs @@ -39,10 +39,6 @@ public async Task CreateOrUpdate() NginxDeploymentResource nginxDeployment = await CreateNginxDeployment(ResGroup, Location, nginxDeploymentName); Assert.IsTrue(nginxDeploymentName.Equals(nginxDeployment.Data.Name)); - Assert.ThrowsAsync(async () => _ = (await ResGroup.GetNginxDeployments().CreateOrUpdateAsync(WaitUntil.Completed, nginxDeploymentName, null)).Value); - - NginxDeploymentData nginxDeploymentData = new NginxDeploymentData(Location); - Assert.ThrowsAsync(async () => _ = (await ResGroup.GetNginxDeployments().CreateOrUpdateAsync(WaitUntil.Completed, null, nginxDeploymentData)).Value); } [TestCase] diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs index 6f59c00d21ac..c2b9d9d2d5f1 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs @@ -44,7 +44,6 @@ public void CreateResourceIdentifier() Assert.IsTrue(nginxResourceIdentifier.ResourceType.Equals(NginxDeploymentResource.ResourceType)); Assert.IsTrue(nginxResourceIdentifier.Equals($"{ResGroup.Id}/providers/{NginxDeploymentResource.ResourceType}/{nginxDeploymentName}")); - Assert.Throws(() => NginxDeploymentResource.ValidateResourceId(ResGroup.Data.Id)); } [TestCase] @@ -77,7 +76,6 @@ public async Task Data() Assert.IsNull(nginxDeployment.Data.Properties.Logging); Assert.IsNull(nginxDeployment.Data.Properties.LoggingStorageAccount); Assert.IsNotNull(nginxDeployment.Data.Properties.ScalingProperties.Capacity); - Assert.IsNotNull(nginxDeployment.Data.Properties.ScalingProperties.Profiles); Assert.IsNotNull(nginxDeployment.Data.Properties.AutoUpgradeProfile.UpgradeChannel); Assert.IsNotNull(nginxDeployment.Data.Properties.UserProfile.PreferredEmail); Assert.IsNotNull(nginxDeployment.Data.Properties.UserPreferredEmail); @@ -206,7 +204,6 @@ public async Task Update() NginxDeploymentResource nginxDeployment2 = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, deploymentPatch)).Value; Assert.AreEqual("1", nginxDeployment2.Data.Tags["Counter"]); - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, null)).Value); } [TestCase] @@ -221,16 +218,17 @@ public async Task UpdateScaling() NginxScaleProfileCapacity nginxScaleProfileCapacity = new NginxScaleProfileCapacity(20, 30); NginxScaleProfile nginxScaleProfile = new NginxScaleProfile("default", nginxScaleProfileCapacity); nginxScaleProfiles.Add(nginxScaleProfile); - NginxDeploymentScalingProperties testScalingProp = new NginxDeploymentScalingProperties(null, nginxScaleProfiles, null); + NginxDeploymentAutoScaleSettings autoScaleSettings = new NginxDeploymentAutoScaleSettings(nginxScaleProfiles); + NginxDeploymentScalingProperties testScalingProp = new NginxDeploymentScalingProperties(null, autoScaleSettings, null); deploymentPatch.Properties = new NginxDeploymentUpdateProperties { + NginxAppProtect = null, ScalingProperties = testScalingProp }; NginxDeploymentResource nginxDeployment2 = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, deploymentPatch)).Value; Assert.AreEqual(1, nginxDeployment2.Data.Properties.ScalingProperties.Profiles.Count); - Assert.ThrowsAsync(async () => _ = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, null)).Value); } [TestCase] @@ -243,13 +241,14 @@ public async Task UpdateAutoupgrade() NginxDeploymentPatch deploymentPatch = new NginxDeploymentPatch { Properties = new NginxDeploymentUpdateProperties() + { + NginxAppProtect = null, + AutoUpgradeProfile = new AutoUpgradeProfile + { + UpgradeChannel = "stable" + } + } }; - AutoUpgradeProfile autoUpgradeProfile = new AutoUpgradeProfile - { - UpgradeChannel = "stable" - }; - - deploymentPatch.Properties.AutoUpgradeProfile = autoUpgradeProfile; NginxDeploymentResource nginxDeployment2 = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, deploymentPatch)).Value; @@ -298,11 +297,7 @@ public async Task UpdateWebApplicationFirewall() { Properties = new NginxDeploymentUpdateProperties() }; - NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect = new NginxDeploymentUpdatePropertiesNginxAppProtect - { - WebApplicationFirewallActivationState = WebApplicationFirewallActivationState.Enabled - }; - deploymentPatch.Properties.NginxAppProtect = nginxAppProtect; + deploymentPatch.Properties.WebApplicationFirewallActivationState = WebApplicationFirewallActivationState.Enabled; NginxDeploymentResource updatedNginxDeployment = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, deploymentPatch)).Value; Assert.IsNotNull(updatedNginxDeployment.Data.Properties.NginxAppProtect.WebApplicationFirewallActivationState); @@ -314,8 +309,7 @@ public async Task UpdateWebApplicationFirewall() Assert.IsNotNull(updatedNginxDeployment.Data.Properties.NginxAppProtect.WebApplicationFirewallStatus.ThreatCampaignsPackage); Assert.IsNotNull(updatedNginxDeployment.Data.Properties.NginxAppProtect.WebApplicationFirewallStatus.ComponentVersions); - nginxAppProtect.WebApplicationFirewallActivationState = WebApplicationFirewallActivationState.Disabled; - deploymentPatch.Properties.NginxAppProtect = nginxAppProtect; + deploymentPatch.Properties.WebApplicationFirewallActivationState = WebApplicationFirewallActivationState.Disabled; NginxDeploymentResource nginxDeployment2 = (await nginxDeployment.UpdateAsync(WaitUntil.Completed, deploymentPatch)).Value; Assert.AreEqual(nginxDeployment2.Data.Properties.NginxAppProtect.WebApplicationFirewallActivationState, WebApplicationFirewallActivationState.Disabled); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml new file mode 100644 index 000000000000..ec16fe7a8d7c --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/nginx/Nginx.Management +commit: c5c49c665603a5408c5ebc2152e898566791d911 +repo: Azure/azure-rest-api-specs +emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json"