From 28e714b50b3b39a8b1fbdad5754c8223c1ea204a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 9 Oct 2025 13:49:50 +0000 Subject: [PATCH 01/12] Configurations: 'specification/nginx/Nginx.Management/tspconfig.yaml', API Version: 2025-03-01-preview, SDK Release Type: beta, and CommitSHA: 'aae85aa3e7e4fda95ea2d3abac0ba1d8159db214' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5433738 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../api/Azure.ResourceManager.Nginx.net8.0.cs | 186 +++++++- ...re.ResourceManager.Nginx.netstandard2.0.cs | 186 +++++++- .../src/Generated/ArmNginxModelFactory.cs | 303 ++++++++----- .../Extensions/MockableNginxArmClient.cs | 24 +- .../MockableNginxResourceGroupResource.cs | 8 +- .../MockableNginxSubscriptionResource.cs | 28 +- .../Generated/Extensions/NginxExtensions.cs | 47 +- ...NginxDeploymentWafPolicyOperationSource.cs | 36 ++ .../AzureResourceManagerNginxContext.cs | 10 + .../Generated/Models/NginxAnalysisConfig.cs | 4 +- .../Generated/Models/NginxCertificateError.cs | 2 +- ...nxCertificateListResponse.Serialization.cs | 29 +- .../Models/NginxCertificateListResponse.cs | 28 +- .../Models/NginxCertificateProperties.cs | 10 +- ...NginxConfigurationCreateOrUpdateContent.cs | 6 +- ...nxConfigurationCreateOrUpdateProperties.cs | 10 +- .../Models/NginxConfigurationFile.cs | 2 +- ...ConfigurationListResponse.Serialization.cs | 29 +- .../Models/NginxConfigurationListResponse.cs | 26 +- .../Models/NginxConfigurationPackage.cs | 2 +- .../Models/NginxConfigurationProperties.cs | 10 +- .../NginxConfigurationProtectedFileContent.cs | 2 +- .../NginxConfigurationProtectedFileResult.cs | 2 +- ...nxDeploymentApiKeyCreateOrUpdateContent.cs | 6 +- ...loymentApiKeyListResponse.Serialization.cs | 29 +- .../NginxDeploymentApiKeyListResponse.cs | 28 +- .../Models/NginxDeploymentApiKeyProperties.cs | 2 +- .../NginxDeploymentApiKeyRequestProperties.cs | 2 +- ...aultWafPolicyListResponse.Serialization.cs | 154 +++++++ ...xDeploymentDefaultWafPolicyListResponse.cs | 70 +++ ...efaultWafPolicyProperties.Serialization.cs | 144 ++++++ ...inxDeploymentDefaultWafPolicyProperties.cs | 69 +++ ...inxDeploymentListResponse.Serialization.cs | 29 +- .../Models/NginxDeploymentListResponse.cs | 28 +- .../Generated/Models/NginxDeploymentPatch.cs | 18 +- .../Models/NginxDeploymentProperties.cs | 20 +- .../Models/NginxDeploymentUpdateProperties.cs | 16 +- .../Models/NginxDeploymentUserProfile.cs | 2 +- ...ntWafPolicyApplyingStatus.Serialization.cs | 155 +++++++ .../NginxDeploymentWafPolicyApplyingStatus.cs | 73 +++ ...nxDeploymentWafPolicyApplyingStatusCode.cs | 60 +++ ...tWafPolicyCompilingStatus.Serialization.cs | 155 +++++++ ...NginxDeploymentWafPolicyCompilingStatus.cs | 73 +++ ...xDeploymentWafPolicyCompilingStatusCode.cs | 57 +++ ...mentWafPolicyListResponse.Serialization.cs | 151 +++++++ .../NginxDeploymentWafPolicyListResponse.cs | 80 ++++ ...ploymentWafPolicyMetadata.Serialization.cs | 155 +++++++ .../NginxDeploymentWafPolicyMetadata.cs | 71 +++ ...fPolicyMetadataProperties.Serialization.cs | 174 ++++++++ ...nxDeploymentWafPolicyMetadataProperties.cs | 77 ++++ ...oymentWafPolicyProperties.Serialization.cs | 195 ++++++++ .../NginxDeploymentWafPolicyProperties.cs | 81 ++++ .../Models/NginxFrontendIPConfiguration.cs | 2 +- .../src/Generated/Models/NginxLogging.cs | 6 +- .../NginxNetworkInterfaceConfiguration.cs | 2 +- .../Generated/Models/NginxNetworkProfile.cs | 10 +- .../Generated/Models/NginxPrivateIPAddress.cs | 6 +- .../Models/NginxPrivateIPAllocationMethod.cs | 2 +- .../Models/NginxProvisioningState.cs | 2 +- .../src/Generated/Models/NginxResourceSku.cs | 2 +- .../Generated/Models/NginxStorageAccount.cs | 2 +- ...ApplicationFirewallStatus.Serialization.cs | 19 +- .../Models/WebApplicationFirewallStatus.cs | 6 +- .../Generated/NginxCertificateCollection.cs | 98 ++--- .../NginxCertificateData.Serialization.cs | 10 +- .../src/Generated/NginxCertificateData.cs | 17 +- .../src/Generated/NginxCertificateResource.cs | 66 +-- .../Generated/NginxConfigurationCollection.cs | 98 ++--- .../src/Generated/NginxConfigurationData.cs | 9 +- .../Generated/NginxConfigurationResource.cs | 82 ++-- .../NginxDeploymentApiKeyCollection.cs | 98 ++--- .../Generated/NginxDeploymentApiKeyData.cs | 9 +- .../NginxDeploymentApiKeyResource.cs | 66 +-- .../Generated/NginxDeploymentCollection.cs | 102 ++--- .../NginxDeploymentData.Serialization.cs | 22 +- .../src/Generated/NginxDeploymentData.cs | 23 +- .../src/Generated/NginxDeploymentResource.cs | 335 +++++++++++--- .../NginxDeploymentWafPolicyCollection.cs | 415 ++++++++++++++++++ ...nxDeploymentWafPolicyData.Serialization.cs | 156 +++++++ .../Generated/NginxDeploymentWafPolicyData.cs | 75 ++++ ...ploymentWafPolicyResource.Serialization.cs | 29 ++ .../NginxDeploymentWafPolicyResource.cs | 347 +++++++++++++++ ....cs => NginxCertificatesRestOperations.cs} | 15 +- ...nxConfigurationResponsesRestOperations.cs} | 201 +++++---- ...eploymentApiKeyResponsesRestOperations.cs} | 135 +++--- ...ginxDeploymentWafPoliciesRestOperations.cs | 333 ++++++++++++++ ...s.cs => NginxDeploymentsRestOperations.cs} | 351 +++++++++++++-- .../src/autorest.md | 82 ---- .../Sample_NginxCertificateCollection.cs | 196 --------- .../Sample_NginxCertificateResource.cs | 109 ----- .../Sample_NginxConfigurationCollection.cs | 197 --------- .../Sample_NginxConfigurationResource.cs | 137 ------ .../Sample_NginxDeploymentApiKeyCollection.cs | 197 --------- .../Sample_NginxDeploymentApiKeyResource.cs | 110 ----- .../Sample_NginxDeploymentCollection.cs | 295 ------------- .../Samples/Sample_NginxDeploymentResource.cs | 169 ------- .../Sample_SubscriptionResourceExtensions.cs | 50 --- .../tsp-location.yaml | 4 + 98 files changed, 5359 insertions(+), 2502 deletions(-) create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs rename sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/{CertificatesRestOperations.cs => NginxCertificatesRestOperations.cs} (98%) rename sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/{ConfigurationsRestOperations.cs => NginxConfigurationResponsesRestOperations.cs} (98%) rename sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/{ApiKeysRestOperations.cs => NginxDeploymentApiKeyResponsesRestOperations.cs} (98%) create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs rename sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/{DeploymentsRestOperations.cs => NginxDeploymentsRestOperations.cs} (69%) delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/autorest.md delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml 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..876265b9b38d 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 @@ -26,7 +26,7 @@ protected NginxCertificateCollection() { } 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 string Location { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -193,6 +193,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.Pageable GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable 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 +204,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; } @@ -214,6 +221,48 @@ protected NginxDeploymentResource() { } 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 partial class NginxDeploymentWafPolicyCollection : Azure.ResourceManager.ArmCollection + { + protected NginxDeploymentWafPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data, 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, 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 override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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, 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, 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; } @@ -225,6 +274,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 +286,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 { @@ -258,7 +309,7 @@ public static partial class ArmNginxModelFactory 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.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, string location = null) { 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; } @@ -268,13 +319,20 @@ public static partial class ArmNginxModelFactory 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.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 = 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.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(byte[] content = null, string filepath = 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.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(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.NginxDeploymentWafPolicyMetadataProperties properties = 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?), byte[] 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.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 { @@ -497,6 +555,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NginxDeploymentDefaultWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyProperties() { } + public byte[] Content { get { throw null; } } + public string Filepath { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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() { } @@ -574,6 +644,113 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 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 : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadata() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 byte[] Content { get { throw null; } set { } } + public string Filepath { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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() { } @@ -787,6 +964,7 @@ 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } 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..876265b9b38d 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 @@ -26,7 +26,7 @@ protected NginxCertificateCollection() { } 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 string Location { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -193,6 +193,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.Pageable GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable 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 +204,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; } @@ -214,6 +221,48 @@ protected NginxDeploymentResource() { } 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 partial class NginxDeploymentWafPolicyCollection : Azure.ResourceManager.ArmCollection + { + protected NginxDeploymentWafPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string wafPolicyName, Azure.ResourceManager.Nginx.NginxDeploymentWafPolicyData data, 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, 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 override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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, 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, 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; } @@ -225,6 +274,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 +286,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 { @@ -258,7 +309,7 @@ public static partial class ArmNginxModelFactory 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.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, string location = null) { 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; } @@ -268,13 +319,20 @@ public static partial class ArmNginxModelFactory 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.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 = 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.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(byte[] content = null, string filepath = 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.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(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.NginxDeploymentWafPolicyMetadataProperties properties = 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?), byte[] 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.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 { @@ -497,6 +555,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NginxDeploymentDefaultWafPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentDefaultWafPolicyProperties() { } + public byte[] Content { get { throw null; } } + public string Filepath { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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() { } @@ -574,6 +644,113 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 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 : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NginxDeploymentWafPolicyMetadata() { } + public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyMetadataProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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 byte[] Content { get { throw null; } set { } } + public string Filepath { get { throw null; } set { } } + public Azure.ResourceManager.Nginx.Models.NginxProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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() { } @@ -787,6 +964,7 @@ 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 void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } 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) { } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs index 8b03cde8740a..e1019d806882 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs @@ -16,12 +16,39 @@ namespace Azure.ResourceManager.Nginx.Models /// Model factory for models. public static partial class ArmNginxModelFactory { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Nginx Deployment Api Key Response Properties. + /// A new instance for mocking. + public static NginxDeploymentApiKeyData NginxDeploymentApiKeyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentApiKeyProperties properties = null) + { + return new NginxDeploymentApiKeyData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: 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) + { + return new NginxDeploymentApiKeyProperties(hint, endOn, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// + /// Nginx Deployment Api Key Request Properties. /// A new instance for mocking. public static NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentApiKeyRequestProperties properties = null) { @@ -34,31 +61,165 @@ public static NginxDeploymentApiKeyCreateOrUpdateContent NginxDeploymentApiKeyCr serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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) + /// The tags. + /// The location. + /// Nginx Deployment Properties. + /// Identity Properties. + /// Resource Sku. + /// 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, NginxDeploymentProperties properties = null, ManagedServiceIdentity identity = null, string skuName = null) { - return new NginxDeploymentApiKeyData( + tags ??= new Dictionary(); + + return new NginxDeploymentData( id, name, resourceType, systemData, + tags, + location, properties, + identity, + skuName != null ? new NginxResourceSku(skuName, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: 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) + /// 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. + /// 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) { - return new NginxDeploymentApiKeyProperties(hint, endOn, serializedAdditionalRawData: null); + return new NginxDeploymentProperties( + 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 . + /// 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 = null, WebApplicationFirewallPackage attackSignaturesPackage = null, WebApplicationFirewallPackage botSignaturesPackage = null, WebApplicationFirewallPackage threatCampaignsPackage = null, WebApplicationFirewallComponentVersions componentVersions = null) + { + return new WebApplicationFirewallStatus( + wafRelease, + 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); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Nginx Deployment Waf Policy Metadata Properties. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyMetadata NginxDeploymentWafPolicyMetadata(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentWafPolicyMetadataProperties properties = null) + { + return new NginxDeploymentWafPolicyMetadata( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// 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 = null, NginxProvisioningState? provisioningState = null, NginxDeploymentWafPolicyCompilingStatus compilingState = null, NginxDeploymentWafPolicyApplyingStatus applyingState = null) + { + return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, serializedAdditionalRawData: null); + } + + /// 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. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyCompilingStatus NginxDeploymentWafPolicyCompilingStatus(NginxDeploymentWafPolicyCompilingStatusCode? code = null, string displayStatus = null, string time = null) + { + return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, serializedAdditionalRawData: null); + } + + /// 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. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyApplyingStatus NginxDeploymentWafPolicyApplyingStatus(NginxDeploymentWafPolicyApplyingStatusCode? code = null, string displayStatus = null, string time = null) + { + return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(byte[] content = null, string filepath = null) + { + return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -66,10 +227,10 @@ public static NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(st /// The name. /// The resourceType. /// The systemData. - /// - /// + /// 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 = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxCertificateProperties properties = null, string location = null) { return new NginxCertificateData( id, @@ -82,14 +243,14 @@ public static NginxCertificateData NginxCertificateData(ResourceIdentifier id = } /// Initializes a new instance of . - /// + /// 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) { @@ -110,7 +271,7 @@ public static NginxCertificateProperties NginxCertificateProperties(NginxProvisi /// The name. /// The resourceType. /// The systemData. - /// + /// 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) { @@ -124,10 +285,10 @@ public static NginxConfigurationData NginxConfigurationData(ResourceIdentifier i } /// Initializes a new instance of . - /// + /// 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) @@ -158,7 +319,7 @@ public static NginxConfigurationProtectedFileResult NginxConfigurationProtectedF /// The name. /// The resourceType. /// The systemData. - /// + /// Nginx Configuration Request Properties. /// A new instance for mocking. public static NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxConfigurationCreateOrUpdateProperties properties = null) { @@ -172,10 +333,10 @@ public static NginxConfigurationCreateOrUpdateContent NginxConfigurationCreateOr } /// Initializes a new instance of . - /// + /// 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) @@ -261,100 +422,40 @@ public static NginxDiagnosticItem NginxDiagnosticItem(string id = null, string d serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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) + /// Nginx Deployment Waf Policy Properties. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyData NginxDeploymentWafPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentWafPolicyProperties properties = null) { - tags ??= new Dictionary(); - - return new NginxDeploymentData( + return new NginxDeploymentWafPolicyData( id, name, resourceType, systemData, - tags, - location, - identity, properties, - skuName != null ? new NginxResourceSku(skuName, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } - /// 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) + /// 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. + /// A new instance for mocking. + public static NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyProperties(NginxProvisioningState? provisioningState = null, byte[] content = null, string filepath = null, NginxDeploymentWafPolicyCompilingStatus compilingState = null, NginxDeploymentWafPolicyApplyingStatus applyingState = null) { - 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, + content, + filepath, + compilingState, + applyingState, 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); - } } } 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..673c6cc33985 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxArmClient.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxArmClient.cs @@ -46,6 +46,18 @@ 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. + /// + /// 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. /// You can use to create a from its components. @@ -71,15 +83,15 @@ public virtual NginxConfigurationResource GetNginxConfigurationResource(Resource } /// - /// 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. + /// You can use to create a from its components. /// /// 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..59438a4b6071 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxResourceGroupResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxResourceGroupResource.cs @@ -49,11 +49,11 @@ public virtual NginxDeploymentCollection GetNginxDeployments() /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -80,11 +80,11 @@ public virtual async Task> GetNginxDeploymentA /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource 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..3f83c24a38eb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxSubscriptionResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/MockableNginxSubscriptionResource.cs @@ -15,8 +15,8 @@ namespace Azure.ResourceManager.Nginx.Mocking /// A class to add extension methods to SubscriptionResource. public partial class MockableNginxSubscriptionResource : ArmResource { - private ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; - private DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; + private ClientDiagnostics _nginxDeploymentClientDiagnostics; + private NginxDeploymentsRestOperations _nginxDeploymentRestClient; /// Initializes a new instance of the class for mocking. protected MockableNginxSubscriptionResource() @@ -30,8 +30,8 @@ internal MockableNginxSubscriptionResource(ArmClient client, ResourceIdentifier { } - 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 NginxDeploymentClientDiagnostics => _nginxDeploymentClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); + private NginxDeploymentsRestOperations NginxDeploymentRestClient => _nginxDeploymentRestClient ??= new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NginxDeploymentResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -48,11 +48,11 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Operation Id - /// Deployments_List + /// NginxDeployment_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -64,9 +64,9 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// An async 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => NginxDeploymentRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentClientDiagnostics, Pipeline, "MockableNginxSubscriptionResource.GetNginxDeployments", "value", "nextLink", cancellationToken); } /// @@ -78,11 +78,11 @@ public virtual AsyncPageable GetNginxDeploymentsAsync(C /// /// /// Operation Id - /// Deployments_List + /// NginxDeployment_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -94,9 +94,9 @@ 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => NginxDeploymentRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentClientDiagnostics, Pipeline, "MockableNginxSubscriptionResource.GetNginxDeployments", "value", "nextLink", cancellationToken); } } } 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..ac0381769cdc 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Extensions/NginxExtensions.cs @@ -51,6 +51,25 @@ public static NginxDeploymentApiKeyResource GetNginxDeploymentApiKeyResource(thi return GetMockableNginxArmClient(client).GetNginxDeploymentApiKeyResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static 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. /// You can use to create a from its components. @@ -90,22 +109,22 @@ 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. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static 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); } /// @@ -134,11 +153,11 @@ public static NginxDeploymentCollection GetNginxDeployments(this ResourceGroupRe /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -172,11 +191,11 @@ public static async Task> GetNginxDeploymentAs /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -210,11 +229,11 @@ public static Response GetNginxDeployment(this Resource /// /// /// Operation Id - /// Deployments_List + /// NginxDeployment_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -246,11 +265,11 @@ public static AsyncPageable GetNginxDeploymentsAsync(th /// /// /// Operation Id - /// Deployments_List + /// NginxDeployment_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource 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..2835a5ca861c --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Nginx +{ + internal class NginxDeploymentWafPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NginxDeploymentWafPolicyOperationSource(ArmClient client) + { + _client = client; + } + + NginxDeploymentWafPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); + return new NginxDeploymentWafPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); + return await Task.FromResult(new NginxDeploymentWafPolicyResource(_client, data)).ConfigureAwait(false); + } + } +} 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..dd54fc0593e2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs @@ -45,6 +45,8 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyRequestProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyResource))] [ModelReaderWriterBuildable(typeof(NginxDeploymentData))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentDefaultWafPolicyListResponse))] + [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))] 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..5a62ff24c1db 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxAnalysisConfig.cs @@ -56,7 +56,7 @@ public NginxAnalysisConfig() /// The root file of the NGINX config file(s). It must match one of the files' filepath. /// /// - /// + /// Nginx Configuration Package. /// Keeps track of any properties unknown to the library. internal NginxAnalysisConfig(string rootFile, IList files, IList protectedFiles, NginxConfigurationPackage package, IDictionary serializedAdditionalRawData) { @@ -73,7 +73,7 @@ internal NginxAnalysisConfig(string rootFile, IList file public IList Files { get; } /// Gets the protected files. public IList ProtectedFiles { get; } - /// Gets or sets the package. + /// Nginx Configuration Package. public NginxConfigurationPackage Package { get; set; } } } 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..ef1a993f08ff 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxCertificateError. + /// Nginx Certificate Error Response Body. public partial class NginxCertificateError { /// 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..87600e9828d0 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 @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NginxCertificateListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var 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) { @@ -87,17 +84,13 @@ internal static NginxCertificateListResponse DeserializeNginxCertificateListResp return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NginxCertificateListResponse DeserializeNginxCertificateListResp } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NginxCertificateListResponse DeserializeNginxCertificateListResp } } serializedAdditionalRawData = rawDataDictionary; - return new NginxCertificateListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxCertificateListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) 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..ab8313ce818d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxCertificateListResponse. + /// Nginx Certificate List Response. internal partial class NginxCertificateListResponse { /// @@ -46,25 +47,34 @@ internal partial class NginxCertificateListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NginxCertificateListResponse() + /// The NginxCertificate items on this page. + /// is null. + internal NginxCertificateListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// + /// 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(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NginxCertificateListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal NginxCertificateListResponse() + { + } + + /// The NginxCertificate items on this page. public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { 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.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs index f0c35cbf52d2..16883a9dd3bc 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxCertificateProperties. + /// Nginx Certificate Properties. public partial class NginxCertificateProperties { /// @@ -51,14 +51,14 @@ public NginxCertificateProperties() } /// Initializes a new instance of . - /// + /// Provisioning State. /// /// /// /// /// /// - /// + /// 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 serializedAdditionalRawData) { @@ -73,7 +73,7 @@ internal NginxCertificateProperties(NginxProvisioningState? provisioningState, s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } /// Gets or sets the key virtual path. public string KeyVirtualPath { get; set; } @@ -87,7 +87,7 @@ internal NginxCertificateProperties(NginxProvisioningState? provisioningState, s public string KeyVaultSecretVersion { get; } /// Gets the key vault secret created. 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/NginxConfigurationCreateOrUpdateContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs index 69a36e66da30..1be45798713e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateContent.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationCreateOrUpdateContent. + /// Nginx Configuration Request. public partial class NginxConfigurationCreateOrUpdateContent : ResourceData { /// @@ -57,7 +57,7 @@ public NginxConfigurationCreateOrUpdateContent() /// The name. /// The resourceType. /// The systemData. - /// + /// Nginx Configuration Request Properties. /// 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) { @@ -65,7 +65,7 @@ internal NginxConfigurationCreateOrUpdateContent(ResourceIdentifier id, string n _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the properties. + /// Nginx Configuration Request Properties. public NginxConfigurationCreateOrUpdateProperties Properties { get; set; } } } 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..9a6e391a9cd9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationCreateOrUpdateProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationCreateOrUpdateProperties. + /// Nginx Configuration Request Properties. public partial class NginxConfigurationCreateOrUpdateProperties { /// @@ -53,10 +53,10 @@ public NginxConfigurationCreateOrUpdateProperties() } /// 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) @@ -69,13 +69,13 @@ internal NginxConfigurationCreateOrUpdateProperties(NginxProvisioningState? prov _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } /// Gets the files. public IList Files { get; } /// Gets the protected files. public IList ProtectedFiles { get; } - /// Gets or sets the package. + /// Nginx Configuration Package. public NginxConfigurationPackage Package { get; set; } /// Gets or sets the root file. public string RootFile { get; set; } 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..941e81ddd633 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationFile. + /// Nginx Configuration File. public partial class NginxConfigurationFile { /// 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..c1cc97f0e30d 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 @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NginxConfigurationListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var 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) { @@ -87,17 +84,13 @@ internal static NginxConfigurationListResponse DeserializeNginxConfigurationList return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NginxConfigurationListResponse DeserializeNginxConfigurationList } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NginxConfigurationListResponse DeserializeNginxConfigurationList } } serializedAdditionalRawData = rawDataDictionary; - return new NginxConfigurationListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxConfigurationListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) 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..16fa8543bbb4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Nginx.Models { @@ -46,25 +47,34 @@ internal partial class NginxConfigurationListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NginxConfigurationListResponse() + /// The NginxConfigurationResponse items on this page. + /// is null. + internal NginxConfigurationListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// Results of a list operation. - /// Link to the next set of results, if any. + /// 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(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NginxConfigurationListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Results of a list operation. + /// Initializes a new instance of for deserialization. + internal NginxConfigurationListResponse() + { + } + + /// The NginxConfigurationResponse items on this page. public IReadOnlyList Value { get; } - /// Link to the next set of results, if any. - public string NextLink { 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.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs index 12e54712683b..e4f7f38b2516 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationPackage.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationPackage. + /// Nginx Configuration Package. public partial class NginxConfigurationPackage { /// 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..8adba78123bc 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationProperties. + /// Nginx Configuration Response Properties. public partial class NginxConfigurationProperties { /// @@ -53,10 +53,10 @@ internal NginxConfigurationProperties() } /// 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) @@ -69,13 +69,13 @@ internal NginxConfigurationProperties(NginxProvisioningState? provisioningState, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// 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. + /// Nginx Configuration Package. public NginxConfigurationPackage Package { get; } /// Gets the root file. public string RootFile { get; } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs index 698160d1a8fb..4b1040c12aec 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationProtectedFileContent. + /// Nginx Configuration Protected File Request. public partial class NginxConfigurationProtectedFileContent { /// diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs index 612f155b2242..c59fdf0aeaa2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxConfigurationProtectedFileResult. + /// Nginx Configuration Protected File Response. public partial class NginxConfigurationProtectedFileResult { /// 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..e744b8673af5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyCreateOrUpdateContent.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyCreateOrUpdateContent. + /// Nginx Deployment Api Key Request. public partial class NginxDeploymentApiKeyCreateOrUpdateContent : ResourceData { /// @@ -57,7 +57,7 @@ public NginxDeploymentApiKeyCreateOrUpdateContent() /// The name. /// The resourceType. /// The systemData. - /// + /// Nginx Deployment Api Key Request Properties. /// 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) { @@ -65,7 +65,7 @@ internal NginxDeploymentApiKeyCreateOrUpdateContent(ResourceIdentifier id, strin _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the properties. + /// Nginx Deployment Api Key Request Properties. public NginxDeploymentApiKeyRequestProperties Properties { get; set; } } } 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..f5941117f4a3 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 @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NginxDeploymentApiKeyListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var 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) { @@ -87,17 +84,13 @@ internal static NginxDeploymentApiKeyListResponse DeserializeNginxDeploymentApiK return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NginxDeploymentApiKeyListResponse DeserializeNginxDeploymentApiK } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NginxDeploymentApiKeyListResponse DeserializeNginxDeploymentApiK } } serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentApiKeyListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxDeploymentApiKeyListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) 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..4b607177e4eb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyListResponse. + /// Nginx Deployment Api Key List Response. internal partial class NginxDeploymentApiKeyListResponse { /// @@ -46,25 +47,34 @@ internal partial class NginxDeploymentApiKeyListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NginxDeploymentApiKeyListResponse() + /// The NginxDeploymentApiKeyResponse items on this page. + /// is null. + internal NginxDeploymentApiKeyListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// + /// 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(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NginxDeploymentApiKeyListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal NginxDeploymentApiKeyListResponse() + { + } + + /// The NginxDeploymentApiKeyResponse items on this page. public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { 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.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs index a63e5cce2de7..5a3744f57b5a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyProperties. + /// Nginx Deployment Api Key Response Properties. public partial class NginxDeploymentApiKeyProperties { /// 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..02fb7356bfcd 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentApiKeyRequestProperties. + /// Nginx Deployment Api Key Request Properties. public partial class NginxDeploymentApiKeyRequestProperties { /// diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs new file mode 100644 index 000000000000..d88b19583e79 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs @@ -0,0 +1,154 @@ +// 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 +{ + internal partial class NginxDeploymentDefaultWafPolicyListResponse : 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(NginxDeploymentDefaultWafPolicyListResponse)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NginxDeploymentDefaultWafPolicyListResponse 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(NginxDeploymentDefaultWafPolicyListResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentDefaultWafPolicyListResponse(document.RootElement, options); + } + + internal static NginxDeploymentDefaultWafPolicyListResponse DeserializeNginxDeploymentDefaultWafPolicyListResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentDefaultWafPolicyListResponse(value ?? new ChangeTrackingList(), nextLink, 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(NginxDeploymentDefaultWafPolicyListResponse)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentDefaultWafPolicyListResponse 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 DeserializeNginxDeploymentDefaultWafPolicyListResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyListResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs new file mode 100644 index 000000000000..1991a9bcdfe2 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Default Waf Policy List Response. + internal partial class NginxDeploymentDefaultWafPolicyListResponse + { + /// + /// 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 NginxDeploymentDefaultWafPolicyListResponse() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentDefaultWafPolicyListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the value. + public IReadOnlyList Value { get; } + /// Gets the next link. + 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..413917c4773f --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.Serialization.cs @@ -0,0 +1,144 @@ +// 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 NginxDeploymentDefaultWafPolicyProperties : 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(NginxDeploymentDefaultWafPolicyProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteBase64StringValue(Content, "D"); + } + if (options.Format != "W" && Optional.IsDefined(Filepath)) + { + writer.WritePropertyName("filepath"u8); + writer.WriteStringValue(Filepath); + } + 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 + } + } + } + + NginxDeploymentDefaultWafPolicyProperties 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(NginxDeploymentDefaultWafPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentDefaultWafPolicyProperties(document.RootElement, options); + } + + internal static NginxDeploymentDefaultWafPolicyProperties DeserializeNginxDeploymentDefaultWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + byte[] content = default; + string filepath = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = property.Value.GetBytesFromBase64("D"); + continue; + } + if (property.NameEquals("filepath"u8)) + { + filepath = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, 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(NginxDeploymentDefaultWafPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentDefaultWafPolicyProperties 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 DeserializeNginxDeploymentDefaultWafPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + 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..1631830ddcc0 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs @@ -0,0 +1,69 @@ +// 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. + /// + /// 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 NginxDeploymentDefaultWafPolicyProperties() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentDefaultWafPolicyProperties(byte[] content, string filepath, IDictionary serializedAdditionalRawData) + { + Content = content; + Filepath = filepath; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the content. + public byte[] 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..301241ad28f9 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 @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NginxDeploymentListResponse)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var 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) { @@ -87,17 +84,13 @@ internal static NginxDeploymentListResponse DeserializeNginxDeploymentListRespon return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NginxDeploymentListResponse DeserializeNginxDeploymentListRespon } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NginxDeploymentListResponse DeserializeNginxDeploymentListRespon } } serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentListResponse(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NginxDeploymentListResponse(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) 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..724618e0b0f9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentListResponse. + /// Nginx Deployment List Response. internal partial class NginxDeploymentListResponse { /// @@ -46,25 +47,34 @@ internal partial class NginxDeploymentListResponse private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NginxDeploymentListResponse() + /// The NginxDeployment items on this page. + /// is null. + internal NginxDeploymentListResponse(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// + /// 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(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NginxDeploymentListResponse(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal NginxDeploymentListResponse() + { + } + + /// The NginxDeployment items on this page. public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { 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.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs index b2838c5550fc..68afaefedb41 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentPatch.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentPatch. + /// Nginx Deployment Update Parameters. public partial class NginxDeploymentPatch { /// @@ -54,11 +54,11 @@ public NginxDeploymentPatch() } /// Initializes a new instance of . - /// Gets or sets the identity. + /// Identity Properties. /// Dictionary of <string>. - /// - /// - /// + /// 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 serializedAdditionalRawData) { @@ -70,11 +70,11 @@ internal NginxDeploymentPatch(ManagedServiceIdentity identity, IDictionary 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; } /// Name of the SKU. public string SkuName @@ -83,9 +83,9 @@ public string SkuName set => Sku = new NginxResourceSku(value); } - /// Gets or sets the location. + /// The geo-location where the resource lives. public AzureLocation? Location { get; set; } - /// Gets or sets the properties. + /// Nginx Deployment Update Properties. public NginxDeploymentUpdateProperties Properties { get; set; } } } 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..8555063131df 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentProperties. + /// Nginx Deployment Properties. public partial class NginxDeploymentProperties { /// @@ -51,15 +51,15 @@ 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. @@ -79,19 +79,19 @@ internal NginxDeploymentProperties(NginxProvisioningState? provisioningState, st _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the provisioning state. + /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } /// Gets the nginx version. 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. public bool? EnableDiagnosticsSupport { get; set; } - /// Gets or sets the logging. + /// Nginx Logging. internal NginxLogging Logging { get; set; } - /// Gets or sets the logging storage account. + /// Nginx Storage Account. public NginxStorageAccount LoggingStorageAccount { get => Logging is null ? default : Logging.StorageAccount; @@ -114,7 +114,7 @@ public string UpgradeChannel set => AutoUpgradeProfile = new AutoUpgradeProfile(value); } - /// Gets or sets the user profile. + /// Nginx Deployment 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 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..ea4ce464d0fd 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentUpdateProperties. + /// Nginx Deployment Update Properties. public partial class NginxDeploymentUpdateProperties { /// @@ -52,10 +52,10 @@ 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. @@ -73,9 +73,9 @@ internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLo /// Gets or sets the enable diagnostics support. public bool? EnableDiagnosticsSupport { get; set; } - /// Gets or sets the logging. + /// Nginx Logging. internal NginxLogging Logging { get; set; } - /// Gets or sets the logging storage account. + /// Nginx Storage Account. public NginxStorageAccount LoggingStorageAccount { get => Logging is null ? default : Logging.StorageAccount; @@ -89,7 +89,7 @@ public NginxStorageAccount LoggingStorageAccount /// Information on how the deployment will be scaled. public NginxDeploymentScalingProperties ScalingProperties { get; set; } - /// Gets or sets the user profile. + /// Nginx Deployment 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 @@ -103,7 +103,7 @@ public string UserPreferredEmail } } - /// Gets or sets the network profile. + /// Nginx Network Profile. public NginxNetworkProfile NetworkProfile { get; set; } /// Autoupgrade settings of a deployment. internal AutoUpgradeProfile AutoUpgradeProfile { get; set; } 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..fb25afbc3b08 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxDeploymentUserProfile. + /// Nginx Deployment User Profile. internal partial class NginxDeploymentUserProfile { /// 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..f5cddc99a9fc --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.Serialization.cs @@ -0,0 +1,155 @@ +// 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 NginxDeploymentWafPolicyApplyingStatus : 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(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" && _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 + } + } + } + + NginxDeploymentWafPolicyApplyingStatus 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(NginxDeploymentWafPolicyApplyingStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyApplyingStatus(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyApplyingStatus DeserializeNginxDeploymentWafPolicyApplyingStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxDeploymentWafPolicyApplyingStatusCode? code = default; + string displayStatus = default; + string time = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new NginxDeploymentWafPolicyApplyingStatusCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayStatus"u8)) + { + displayStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + time = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, 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(NginxDeploymentWafPolicyApplyingStatus)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyApplyingStatus 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 DeserializeNginxDeploymentWafPolicyApplyingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyApplyingStatus)} does not support reading '{options.Format}' format."); + } + } + + 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..e065e7ab6485 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs @@ -0,0 +1,73 @@ +// 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. + /// + /// 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 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 serializedAdditionalRawData) + { + Code = code; + DisplayStatus = displayStatus; + Time = time; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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..6205b3c878ec --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +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; + + /// Initializes a new instance of . + /// is null. + public NginxDeploymentWafPolicyApplyingStatusCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotAppliedValue = "NotApplied"; + private const string ApplyingValue = "Applying"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string RemovingValue = "Removing"; + + /// 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. + public static bool operator ==(NginxDeploymentWafPolicyApplyingStatusCode left, NginxDeploymentWafPolicyApplyingStatusCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NginxDeploymentWafPolicyApplyingStatusCode left, NginxDeploymentWafPolicyApplyingStatusCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NginxDeploymentWafPolicyApplyingStatusCode(string value) => 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..eff2cf1a4c15 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.Serialization.cs @@ -0,0 +1,155 @@ +// 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 NginxDeploymentWafPolicyCompilingStatus : 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(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" && _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 + } + } + } + + NginxDeploymentWafPolicyCompilingStatus 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(NginxDeploymentWafPolicyCompilingStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyCompilingStatus(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyCompilingStatus DeserializeNginxDeploymentWafPolicyCompilingStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxDeploymentWafPolicyCompilingStatusCode? code = default; + string displayStatus = default; + string time = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new NginxDeploymentWafPolicyCompilingStatusCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayStatus"u8)) + { + displayStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("time"u8)) + { + time = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, 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(NginxDeploymentWafPolicyCompilingStatus)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyCompilingStatus 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 DeserializeNginxDeploymentWafPolicyCompilingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyCompilingStatus)} does not support reading '{options.Format}' format."); + } + } + + 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..60c9e2345275 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs @@ -0,0 +1,73 @@ +// 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. + /// + /// 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 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 serializedAdditionalRawData) + { + Code = code; + DisplayStatus = displayStatus; + Time = time; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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..ce47d8b46f75 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Machine readable code indicating the compilation status of a WAF Policy. + public readonly partial struct NginxDeploymentWafPolicyCompilingStatusCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NginxDeploymentWafPolicyCompilingStatusCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + + /// 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. + public static bool operator ==(NginxDeploymentWafPolicyCompilingStatusCode left, NginxDeploymentWafPolicyCompilingStatusCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NginxDeploymentWafPolicyCompilingStatusCode left, NginxDeploymentWafPolicyCompilingStatusCode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NginxDeploymentWafPolicyCompilingStatusCode(string value) => 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..a817976b35ca --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.Serialization.cs @@ -0,0 +1,151 @@ +// 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 +{ + internal partial class NginxDeploymentWafPolicyListResponse : 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(NginxDeploymentWafPolicyListResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + 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 + } + } + } + + NginxDeploymentWafPolicyListResponse 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(NginxDeploymentWafPolicyListResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyListResponse DeserializeNginxDeploymentWafPolicyListResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyListResponse(value, nextLink, 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(NginxDeploymentWafPolicyListResponse)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyListResponse 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 DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyListResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..5002bc7cdafb --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy List Response. + internal partial class NginxDeploymentWafPolicyListResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NginxDeploymentWafPolicyMetadata items on this page. + /// is null. + internal NginxDeploymentWafPolicyListResponse(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(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(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NginxDeploymentWafPolicyListResponse() + { + } + + /// The NginxDeploymentWafPolicyMetadata items on this page. + public IReadOnlyList 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..5e63b49c6af6 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Nginx.Models +{ + public partial class NginxDeploymentWafPolicyMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadata)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NginxDeploymentWafPolicyMetadata 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(NginxDeploymentWafPolicyMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyMetadata(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyMetadata DeserializeNginxDeploymentWafPolicyMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxDeploymentWafPolicyMetadataProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxDeploymentWafPolicyMetadataProperties.DeserializeNginxDeploymentWafPolicyMetadataProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyMetadata( + id, + name, + type, + systemData, + properties, + 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(NginxDeploymentWafPolicyMetadata)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyMetadata 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 DeserializeNginxDeploymentWafPolicyMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadata)} does not support reading '{options.Format}' format."); + } + } + + 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..100c4a908487 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.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; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Metadata. + public partial class NginxDeploymentWafPolicyMetadata : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NginxDeploymentWafPolicyMetadata() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Nginx Deployment Waf Policy Metadata Properties. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyMetadata(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxDeploymentWafPolicyMetadataProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Nginx Deployment Waf Policy Metadata Properties. + public NginxDeploymentWafPolicyMetadataProperties Properties { 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..eba9d693bb11 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.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.Core; + +namespace Azure.ResourceManager.Nginx.Models +{ + public partial class NginxDeploymentWafPolicyMetadataProperties : 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(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" && _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 + } + } + } + + NginxDeploymentWafPolicyMetadataProperties 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(NginxDeploymentWafPolicyMetadataProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyMetadataProperties(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyMetadataProperties DeserializeNginxDeploymentWafPolicyMetadataProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string filepath = default; + NginxProvisioningState? provisioningState = default; + NginxDeploymentWafPolicyCompilingStatus compilingState = default; + NginxDeploymentWafPolicyApplyingStatus applyingState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("filepath"u8)) + { + filepath = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NginxProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("compilingState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(property.Value, options); + continue; + } + if (property.NameEquals("applyingState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, 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(NginxDeploymentWafPolicyMetadataProperties)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyMetadataProperties 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 DeserializeNginxDeploymentWafPolicyMetadataProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyMetadataProperties)} does not support reading '{options.Format}' format."); + } + } + + 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..2efbf5ce44f5 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Metadata Properties. + public partial class NginxDeploymentWafPolicyMetadataProperties + { + /// + /// 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 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 serializedAdditionalRawData) + { + Filepath = filepath; + ProvisioningState = provisioningState; + CompilingState = compilingState; + ApplyingState = applyingState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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..965d94cf10c0 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.Serialization.cs @@ -0,0 +1,195 @@ +// 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 NginxDeploymentWafPolicyProperties : 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(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, "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" && _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 + } + } + } + + NginxDeploymentWafPolicyProperties 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(NginxDeploymentWafPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyProperties(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyProperties DeserializeNginxDeploymentWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxProvisioningState? provisioningState = default; + byte[] content = default; + string filepath = default; + NginxDeploymentWafPolicyCompilingStatus compilingState = default; + NginxDeploymentWafPolicyApplyingStatus applyingState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NginxProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("content"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + content = property.Value.GetBytesFromBase64("D"); + continue; + } + if (property.NameEquals("filepath"u8)) + { + filepath = property.Value.GetString(); + continue; + } + if (property.NameEquals("compilingState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(property.Value, options); + continue; + } + if (property.NameEquals("applyingState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyProperties( + provisioningState, + content, + filepath, + compilingState, + applyingState, + 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(NginxDeploymentWafPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyProperties 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 DeserializeNginxDeploymentWafPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + 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..8d37db6f137a --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Waf Policy Properties. + public partial class NginxDeploymentWafPolicyProperties + { + /// + /// 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 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, byte[] content, string filepath, NginxDeploymentWafPolicyCompilingStatus compilingState, NginxDeploymentWafPolicyApplyingStatus applyingState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + Content = content; + Filepath = filepath; + CompilingState = compilingState; + ApplyingState = applyingState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Provisioning State. + public NginxProvisioningState? ProvisioningState { get; } + /// The byte content of the Policy. + public byte[] 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/NginxFrontendIPConfiguration.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs index 3b61ed54c2e6..0094bfebaf39 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxFrontendIPConfiguration.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxFrontendIPConfiguration. + /// Nginx Frontend IP Configuration. public partial class NginxFrontendIPConfiguration { /// 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..5b9f0a4bc6e6 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxLogging. + /// Nginx Logging. internal partial class NginxLogging { /// @@ -51,7 +51,7 @@ public NginxLogging() } /// Initializes a new instance of . - /// + /// Nginx Storage Account. /// Keeps track of any properties unknown to the library. internal NginxLogging(NginxStorageAccount storageAccount, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal NginxLogging(NginxStorageAccount storageAccount, IDictionary 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.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs index 01cbd34d31a4..d3e2260e02e2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxNetworkInterfaceConfiguration. + /// Nginx Network Interface Configuration. internal partial class NginxNetworkInterfaceConfiguration { /// 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..9b6633bad86a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxNetworkProfile. + /// Nginx Network Profile. public partial class NginxNetworkProfile { /// @@ -52,8 +52,8 @@ public NginxNetworkProfile() } /// Initializes a new instance of . - /// - /// + /// Nginx Frontend IP Configuration. + /// Nginx Network Interface Configuration. /// Keeps track of any properties unknown to the library. internal NginxNetworkProfile(NginxFrontendIPConfiguration frontEndIPConfiguration, NginxNetworkInterfaceConfiguration networkInterfaceConfiguration, IDictionary serializedAdditionalRawData) { @@ -62,9 +62,9 @@ internal NginxNetworkProfile(NginxFrontendIPConfiguration frontEndIPConfiguratio _serializedAdditionalRawData = serializedAdditionalRawData; } - /// 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. public ResourceIdentifier NetworkInterfaceSubnetId 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..86f286993e3d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxPrivateIPAddress. + /// Nginx Private IP Address. public partial class NginxPrivateIPAddress { /// @@ -54,7 +54,7 @@ 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) @@ -67,7 +67,7 @@ internal NginxPrivateIPAddress(IPAddress privateIPAddress, NginxPrivateIPAllocat /// Gets or sets the private ip address. 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. 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..bc3828313470 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAllocationMethod.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAllocationMethod.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxPrivateIPAllocationMethod. + /// Nginx Private IP Allocation Method. public readonly partial struct NginxPrivateIPAllocationMethod : IEquatable { private readonly string _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..63822b0c29da 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxProvisioningState.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxProvisioningState.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxProvisioningState. + /// Provisioning State. public readonly partial struct NginxProvisioningState : IEquatable { private readonly string _value; 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..457431157765 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxResourceSku.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxResourceSku. + /// Resource Sku. internal partial class NginxResourceSku { /// 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..5f4e6b0440a5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Nginx.Models { - /// The NginxStorageAccount. + /// Nginx Storage Account. public partial class NginxStorageAccount { /// 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..7e48fb885ed5 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 @@ -34,6 +34,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit 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); @@ -91,6 +96,7 @@ internal static WebApplicationFirewallStatus DeserializeWebApplicationFirewallSt { return null; } + string wafRelease = default; WebApplicationFirewallPackage attackSignaturesPackage = default; WebApplicationFirewallPackage botSignaturesPackage = default; WebApplicationFirewallPackage threatCampaignsPackage = default; @@ -99,6 +105,11 @@ internal static WebApplicationFirewallStatus DeserializeWebApplicationFirewallSt Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("wafRelease"u8)) + { + wafRelease = property.Value.GetString(); + continue; + } if (property.NameEquals("attackSignaturesPackage"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -141,7 +152,13 @@ internal static WebApplicationFirewallStatus DeserializeWebApplicationFirewallSt } } serializedAdditionalRawData = rawDataDictionary; - return new WebApplicationFirewallStatus(attackSignaturesPackage, botSignaturesPackage, threatCampaignsPackage, componentVersions, serializedAdditionalRawData); + return new WebApplicationFirewallStatus( + wafRelease, + attackSignaturesPackage, + botSignaturesPackage, + threatCampaignsPackage, + componentVersions, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) 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..e9f5c50b9cf2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/WebApplicationFirewallStatus.cs @@ -51,13 +51,15 @@ 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) + internal WebApplicationFirewallStatus(string wafRelease, WebApplicationFirewallPackage attackSignaturesPackage, WebApplicationFirewallPackage botSignaturesPackage, WebApplicationFirewallPackage threatCampaignsPackage, WebApplicationFirewallComponentVersions componentVersions, IDictionary serializedAdditionalRawData) { + WafRelease = wafRelease; AttackSignaturesPackage = attackSignaturesPackage; BotSignaturesPackage = botSignaturesPackage; ThreatCampaignsPackage = threatCampaignsPackage; @@ -65,6 +67,8 @@ internal WebApplicationFirewallStatus(WebApplicationFirewallPackage attackSignat _serializedAdditionalRawData = serializedAdditionalRawData; } + /// 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). diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs index c59f891dfa08..347a41d5d176 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateCollection.cs @@ -24,8 +24,8 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxCertificateCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxCertificateCertificatesClientDiagnostics; - private readonly CertificatesRestOperations _nginxCertificateCertificatesRestClient; + private readonly ClientDiagnostics _nginxCertificateClientDiagnostics; + private readonly NginxCertificatesRestOperations _nginxCertificateRestClient; /// Initializes a new instance of the class for mocking. protected NginxCertificateCollection() @@ -37,9 +37,9 @@ protected NginxCertificateCollection() /// The identifier of the parent 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); + _nginxCertificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxCertificateResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NginxCertificateResource.ResourceType, out string nginxCertificateApiVersion); + _nginxCertificateRestClient = new NginxCertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxCertificateApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -60,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Certificates_CreateOrUpdate + /// NginxCertificate_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -83,12 +83,12 @@ public virtual async Task> CreateOrUpdate Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); + using var scope = _nginxCertificateClientDiagnostics.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); + var response = await _nginxCertificateRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -109,11 +109,11 @@ public virtual async Task> CreateOrUpdate /// /// /// Operation Id - /// Certificates_CreateOrUpdate + /// NginxCertificate_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -132,12 +132,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); + using var scope = _nginxCertificateClientDiagnostics.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); + var response = _nginxCertificateRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken); + var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -158,11 +158,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -178,11 +178,11 @@ public virtual async Task> GetAsync(string ce { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken).ConfigureAwait(false); + var response = await _nginxCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -203,11 +203,11 @@ public virtual async Task> GetAsync(string ce /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -223,11 +223,11 @@ public virtual Response Get(string certificateName, Ca { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken); + var response = _nginxCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -248,11 +248,11 @@ public virtual Response Get(string certificateName, Ca /// /// /// Operation Id - /// Certificates_List + /// NginxCertificate_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -264,9 +264,9 @@ public virtual Response Get(string certificateName, Ca /// An async 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxCertificateRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxCertificateRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxCertificateResource(Client, NginxCertificateData.DeserializeNginxCertificateData(e)), _nginxCertificateClientDiagnostics, Pipeline, "NginxCertificateCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -278,11 +278,11 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Operation Id - /// Certificates_List + /// NginxCertificate_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -294,9 +294,9 @@ 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxCertificateRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxCertificateRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxCertificateResource(Client, NginxCertificateData.DeserializeNginxCertificateData(e)), _nginxCertificateClientDiagnostics, Pipeline, "NginxCertificateCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -308,11 +308,11 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -328,11 +328,11 @@ public virtual async Task> ExistsAsync(string certificateName, Ca { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -351,11 +351,11 @@ public virtual async Task> ExistsAsync(string certificateName, Ca /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -371,11 +371,11 @@ public virtual Response Exists(string certificateName, CancellationToken c { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); + var response = _nginxCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -394,11 +394,11 @@ public virtual Response Exists(string certificateName, CancellationToken c /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -414,11 +414,11 @@ public virtual async Task> GetIfExist { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -439,11 +439,11 @@ public virtual async Task> GetIfExist /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -459,11 +459,11 @@ public virtual NullableResponse GetIfExists(string cer { Argument.AssertNotNullOrEmpty(certificateName, nameof(certificateName)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); + var response = _nginxCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); 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..8a136a93b10d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs @@ -46,7 +46,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); + writer.WriteStringValue(Location); } } @@ -71,7 +71,7 @@ internal static NginxCertificateData DeserializeNginxCertificateData(JsonElement return null; } NginxCertificateProperties properties = default; - AzureLocation? location = default; + string location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -91,11 +91,7 @@ internal static NginxCertificateData DeserializeNginxCertificateData(JsonElement } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (property.NameEquals("id"u8)) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs index 2ee2cbbe38f9..a88294bb52b4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs @@ -13,7 +13,10 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxCertificate data model. + /// + /// A class representing the NginxCertificate data model. + /// Nginx Certificate + /// public partial class NginxCertificateData : ResourceData { /// @@ -58,19 +61,19 @@ public NginxCertificateData() /// The name. /// The resourceType. /// The systemData. - /// - /// + /// Nginx Certificate Properties. + /// The geo-location where the resource lives. /// 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) + internal NginxCertificateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxCertificateProperties properties, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; Location = location; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the properties. + /// Nginx Certificate Properties. public NginxCertificateProperties Properties { get; set; } - /// Gets or sets the location. - public AzureLocation? Location { get; set; } + /// The geo-location where the resource lives. + public string Location { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs index 24dacf476407..a446983e466c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateResource.cs @@ -33,8 +33,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _nginxCertificateCertificatesClientDiagnostics; - private readonly CertificatesRestOperations _nginxCertificateCertificatesRestClient; + private readonly ClientDiagnostics _nginxCertificateClientDiagnostics; + private readonly NginxCertificatesRestOperations _nginxCertificateRestClient; private readonly NginxCertificateData _data; /// Gets the resource type for the operations. @@ -59,9 +59,9 @@ internal NginxCertificateResource(ArmClient client, NginxCertificateData data) : /// 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); + _nginxCertificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string nginxCertificateApiVersion); + _nginxCertificateRestClient = new NginxCertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxCertificateApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -97,11 +97,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -112,11 +112,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Get"); scope.Start(); try { - var response = await _nginxCertificateCertificatesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _nginxCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -137,11 +137,11 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -152,11 +152,11 @@ public virtual async Task> GetAsync(Cancellat /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); + using var scope = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Get"); scope.Start(); try { - var response = _nginxCertificateCertificatesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _nginxCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -177,11 +177,11 @@ public virtual Response Get(CancellationToken cancella /// /// /// Operation Id - /// Certificates_Delete + /// NginxCertificate_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -193,12 +193,12 @@ 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 var scope = _nginxCertificateClientDiagnostics.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); + var response = await _nginxCertificateRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(_nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -219,11 +219,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Certificates_Delete + /// NginxCertificate_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -235,12 +235,12 @@ 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 var scope = _nginxCertificateClientDiagnostics.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); + var response = _nginxCertificateRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new NginxArmOperation(_nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -261,11 +261,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Certificates_CreateOrUpdate + /// NginxCertificate_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -281,12 +281,12 @@ public virtual async Task> UpdateAsync(Wa { Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); + using var scope = _nginxCertificateClientDiagnostics.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); + var response = await _nginxCertificateRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -307,11 +307,11 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Operation Id - /// Certificates_CreateOrUpdate + /// NginxCertificate_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -327,12 +327,12 @@ public virtual ArmOperation Update(WaitUntil waitUntil { Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxCertificateCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); + using var scope = _nginxCertificateClientDiagnostics.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); + var response = _nginxCertificateRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs index 058253f9cafc..acec49f38359 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationCollection.cs @@ -25,8 +25,8 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxConfigurationConfigurationsClientDiagnostics; - private readonly ConfigurationsRestOperations _nginxConfigurationConfigurationsRestClient; + private readonly ClientDiagnostics _nginxConfigurationNginxConfigurationResponsesClientDiagnostics; + private readonly NginxConfigurationResponsesRestOperations _nginxConfigurationNginxConfigurationResponsesRestClient; /// Initializes a new instance of the class for mocking. protected NginxConfigurationCollection() @@ -38,9 +38,9 @@ protected NginxConfigurationCollection() /// The identifier of the parent 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); + _nginxConfigurationNginxConfigurationResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NginxConfigurationResource.ResourceType, out string nginxConfigurationNginxConfigurationResponsesApiVersion); + _nginxConfigurationNginxConfigurationResponsesRestClient = new NginxConfigurationResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxConfigurationNginxConfigurationResponsesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Configurations_CreateOrUpdate + /// NginxConfigurationResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -84,12 +84,12 @@ public virtual async Task> CreateOrUpda Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.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); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -110,11 +110,11 @@ public virtual async Task> CreateOrUpda /// /// /// Operation Id - /// Configurations_CreateOrUpdate + /// NginxConfigurationResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -133,12 +133,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.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); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content, cancellationToken); + var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -179,11 +179,11 @@ public virtual async Task> GetAsync(string { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -204,11 +204,11 @@ public virtual async Task> GetAsync(string /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -224,11 +224,11 @@ public virtual Response Get(string configurationName { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -249,11 +249,11 @@ public virtual Response Get(string configurationName /// /// /// Operation Id - /// Configurations_List + /// NginxConfigurationResponse_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -265,9 +265,9 @@ public virtual Response Get(string configurationName /// An async 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxConfigurationResource(Client, NginxConfigurationData.DeserializeNginxConfigurationData(e)), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, "NginxConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Operation Id - /// Configurations_List + /// NginxConfigurationResponse_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -295,9 +295,9 @@ 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxConfigurationResource(Client, NginxConfigurationData.DeserializeNginxConfigurationData(e)), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, "NginxConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -309,11 +309,11 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string configurationName, { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string configurationName, /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -372,11 +372,11 @@ public virtual Response Exists(string configurationName, CancellationToken { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -395,11 +395,11 @@ public virtual Response Exists(string configurationName, CancellationToken /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -415,11 +415,11 @@ public virtual async Task> GetIfExi { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -440,11 +440,11 @@ public virtual async Task> GetIfExi /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -460,11 +460,11 @@ public virtual NullableResponse GetIfExists(string c { Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs index 3b901729753f..13f6c8e741c9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs @@ -13,7 +13,10 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxConfiguration data model. + /// + /// A class representing the NginxConfiguration data model. + /// Nginx Configuration Response + /// public partial class NginxConfigurationData : ResourceData { /// @@ -58,7 +61,7 @@ internal NginxConfigurationData() /// The name. /// The resourceType. /// The systemData. - /// + /// Nginx Configuration Response Properties. /// 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) { @@ -66,7 +69,7 @@ internal NginxConfigurationData(ResourceIdentifier id, string name, ResourceType _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the properties. + /// Nginx Configuration Response Properties. public NginxConfigurationProperties Properties { get; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs index 83f3fa796ac6..a8811b756e01 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationResource.cs @@ -34,8 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _nginxConfigurationConfigurationsClientDiagnostics; - private readonly ConfigurationsRestOperations _nginxConfigurationConfigurationsRestClient; + private readonly ClientDiagnostics _nginxConfigurationNginxConfigurationResponsesClientDiagnostics; + private readonly NginxConfigurationResponsesRestOperations _nginxConfigurationNginxConfigurationResponsesRestClient; private readonly NginxConfigurationData _data; /// Gets the resource type for the operations. @@ -60,9 +60,9 @@ internal NginxConfigurationResource(ArmClient client, NginxConfigurationData dat /// 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); + _nginxConfigurationNginxConfigurationResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string nginxConfigurationNginxConfigurationResponsesApiVersion); + _nginxConfigurationNginxConfigurationResponsesRestClient = new NginxConfigurationResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxConfigurationNginxConfigurationResponsesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -98,11 +98,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -113,11 +113,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -138,11 +138,11 @@ public virtual async Task> GetAsync(Cancell /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -153,11 +153,11 @@ public virtual async Task> GetAsync(Cancell /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -178,11 +178,11 @@ public virtual Response Get(CancellationToken cancel /// /// /// Operation Id - /// Configurations_Delete + /// NginxConfigurationResponse_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -194,12 +194,12 @@ 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 var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.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); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(_nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -220,11 +220,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Configurations_Delete + /// NginxConfigurationResponse_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -236,12 +236,12 @@ 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 var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.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); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new NginxArmOperation(_nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -262,11 +262,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Configurations_CreateOrUpdate + /// NginxConfigurationResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -282,12 +282,12 @@ public virtual async Task> UpdateAsync( { Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); 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); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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; @@ -308,11 +308,11 @@ public virtual async Task> UpdateAsync( /// /// /// Operation Id - /// Configurations_CreateOrUpdate + /// NginxConfigurationResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -328,12 +328,12 @@ public virtual ArmOperation Update(WaitUntil waitUnt { Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); 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); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -354,11 +354,11 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Operation Id - /// Configurations_Analysis + /// NginxConfigurationResponses_Analysis /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -370,11 +370,11 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// The cancellation token to use. public virtual async Task> AnalysisAsync(NginxAnalysisContent content = null, CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); scope.Start(); try { - var response = await _nginxConfigurationConfigurationsRestClient.AnalysisAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.AnalysisAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -393,11 +393,11 @@ public virtual async Task> AnalysisAsync(NginxAnal /// /// /// Operation Id - /// Configurations_Analysis + /// NginxConfigurationResponses_Analysis /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -409,11 +409,11 @@ public virtual async Task> AnalysisAsync(NginxAnal /// The cancellation token to use. public virtual Response Analysis(NginxAnalysisContent content = null, CancellationToken cancellationToken = default) { - using var scope = _nginxConfigurationConfigurationsClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); + using var scope = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); scope.Start(); try { - var response = _nginxConfigurationConfigurationsRestClient.Analysis(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Analysis(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); return response; } 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..edaf647c2a52 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyCollection.cs @@ -25,8 +25,8 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxDeploymentApiKeyCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxDeploymentApiKeyApiKeysClientDiagnostics; - private readonly ApiKeysRestOperations _nginxDeploymentApiKeyApiKeysRestClient; + private readonly ClientDiagnostics _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics; + private readonly NginxDeploymentApiKeyResponsesRestOperations _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient; /// Initializes a new instance of the class for mocking. protected NginxDeploymentApiKeyCollection() @@ -38,9 +38,9 @@ protected NginxDeploymentApiKeyCollection() /// The identifier of the parent 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); + _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentApiKeyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NginxDeploymentApiKeyResource.ResourceType, out string nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); + _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient = new NginxDeploymentApiKeyResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// ApiKeys_CreateOrUpdate + /// NginxDeploymentApiKeyResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -84,12 +84,12 @@ public virtual async Task> CreateOrU Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.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 response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content, cancellationToken).ConfigureAwait(false); + var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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); if (waitUntil == WaitUntil.Completed) @@ -112,11 +112,11 @@ public virtual async Task> CreateOrU /// /// /// Operation Id - /// ApiKeys_CreateOrUpdate + /// NginxDeploymentApiKeyResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -135,12 +135,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUn Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.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 response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content, cancellationToken); + var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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); if (waitUntil == WaitUntil.Completed) @@ -163,11 +163,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -183,11 +183,11 @@ public virtual async Task> GetAsync(stri { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); @@ -208,11 +208,11 @@ public virtual async Task> GetAsync(stri /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -228,11 +228,11 @@ public virtual Response Get(string apiKeyName, Ca { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken); + var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); @@ -253,11 +253,11 @@ public virtual Response Get(string apiKeyName, Ca /// /// /// Operation Id - /// ApiKeys_List + /// NginxDeploymentApiKeyResponse_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -269,9 +269,9 @@ public virtual Response Get(string apiKeyName, Ca /// An async 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentApiKeyResource(Client, NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(e)), _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics, Pipeline, "NginxDeploymentApiKeyCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -283,11 +283,11 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Operation Id - /// ApiKeys_List + /// NginxDeploymentApiKeyResponse_List /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -299,9 +299,9 @@ 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentApiKeyResource(Client, NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(e)), _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics, Pipeline, "NginxDeploymentApiKeyCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -313,11 +313,11 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -333,11 +333,11 @@ public virtual async Task> ExistsAsync(string apiKeyName, Cancell { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -356,11 +356,11 @@ public virtual async Task> ExistsAsync(string apiKeyName, Cancell /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -376,11 +376,11 @@ public virtual Response Exists(string apiKeyName, CancellationToken cancel { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken); + var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -399,11 +399,11 @@ public virtual Response Exists(string apiKeyName, CancellationToken cancel /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -419,11 +419,11 @@ public virtual async Task> GetIf { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); @@ -444,11 +444,11 @@ public virtual async Task> GetIf /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -464,11 +464,11 @@ public virtual NullableResponse GetIfExists(strin { Argument.AssertNotNullOrEmpty(apiKeyName, nameof(apiKeyName)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken); + var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs index 5330fd270419..5ab6f813243b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs @@ -13,7 +13,10 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxDeploymentApiKey data model. + /// + /// A class representing the NginxDeploymentApiKey data model. + /// Nginx Deployment Api Key Response + /// public partial class NginxDeploymentApiKeyData : ResourceData { /// @@ -58,7 +61,7 @@ internal NginxDeploymentApiKeyData() /// The name. /// The resourceType. /// The systemData. - /// + /// Nginx Deployment Api Key Response Properties. /// 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) { @@ -66,7 +69,7 @@ internal NginxDeploymentApiKeyData(ResourceIdentifier id, string name, ResourceT _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.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs index 34156f1d2352..9fddcd23d5d1 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyResource.cs @@ -34,8 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _nginxDeploymentApiKeyApiKeysClientDiagnostics; - private readonly ApiKeysRestOperations _nginxDeploymentApiKeyApiKeysRestClient; + private readonly ClientDiagnostics _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics; + private readonly NginxDeploymentApiKeyResponsesRestOperations _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient; private readonly NginxDeploymentApiKeyData _data; /// Gets the resource type for the operations. @@ -60,9 +60,9 @@ internal NginxDeploymentApiKeyResource(ArmClient client, NginxDeploymentApiKeyDa /// 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); + _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); + _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient = new NginxDeploymentApiKeyResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -98,11 +98,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -113,11 +113,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyApiKeysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); @@ -138,11 +138,11 @@ public virtual async Task> GetAsync(Canc /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -153,11 +153,11 @@ public virtual async Task> GetAsync(Canc /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); scope.Start(); try { - var response = _nginxDeploymentApiKeyApiKeysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentApiKeyResource(Client, response.Value), response.GetRawResponse()); @@ -178,11 +178,11 @@ public virtual Response Get(CancellationToken can /// /// /// Operation Id - /// ApiKeys_Delete + /// NginxDeploymentApiKeyResponse_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -194,12 +194,12 @@ 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 var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.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 response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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); if (waitUntil == WaitUntil.Completed) @@ -222,11 +222,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// ApiKeys_Delete + /// NginxDeploymentApiKeyResponse_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -238,12 +238,12 @@ 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 var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.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 response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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); if (waitUntil == WaitUntil.Completed) @@ -266,11 +266,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// ApiKeys_CreateOrUpdate + /// NginxDeploymentApiKeyResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -286,12 +286,12 @@ public virtual async Task> UpdateAsy { Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.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 response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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); if (waitUntil == WaitUntil.Completed) @@ -314,11 +314,11 @@ public virtual async Task> UpdateAsy /// /// /// Operation Id - /// ApiKeys_CreateOrUpdate + /// NginxDeploymentApiKeyResponse_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -334,12 +334,12 @@ public virtual ArmOperation Update(WaitUntil wait { Argument.AssertNotNull(content, nameof(content)); - using var scope = _nginxDeploymentApiKeyApiKeysClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); + using var scope = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.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 response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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); if (waitUntil == WaitUntil.Completed) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs index cd9bd9f13b7b..aecca902f7a7 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentCollection.cs @@ -25,8 +25,8 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; - private readonly DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; + private readonly ClientDiagnostics _nginxDeploymentClientDiagnostics; + private readonly NginxDeploymentsRestOperations _nginxDeploymentRestClient; /// Initializes a new instance of the class for mocking. protected NginxDeploymentCollection() @@ -38,9 +38,9 @@ protected NginxDeploymentCollection() /// The identifier of the parent 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); + _nginxDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NginxDeploymentResource.ResourceType, out string nginxDeploymentApiVersion); + _nginxDeploymentRestClient = new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Deployments_CreateOrUpdate + /// NginxDeployment_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -75,7 +75,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// 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 an empty string, and was expected to be non-empty. /// or is null. @@ -84,12 +84,12 @@ public virtual async Task> CreateOrUpdateA Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); + using var scope = _nginxDeploymentClientDiagnostics.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); + var response = await _nginxDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -110,11 +110,11 @@ public virtual async Task> CreateOrUpdateA /// /// /// Operation Id - /// Deployments_CreateOrUpdate + /// NginxDeployment_CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -124,7 +124,7 @@ public virtual async Task> CreateOrUpdateA /// /// 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 an empty string, and was expected to be non-empty. /// or is null. @@ -133,12 +133,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); + using var scope = _nginxDeploymentClientDiagnostics.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); + var response = _nginxDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data, cancellationToken); + var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -179,11 +179,11 @@ public virtual async Task> GetAsync(string dep { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); @@ -204,11 +204,11 @@ public virtual async Task> GetAsync(string dep /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -224,11 +224,11 @@ public virtual Response Get(string deploymentName, Canc { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken); + var response = _nginxDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); @@ -249,11 +249,11 @@ public virtual Response Get(string deploymentName, Canc /// /// /// Operation Id - /// Deployments_ListByResourceGroup + /// NginxDeployment_ListByResourceGroup /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -265,9 +265,9 @@ public virtual Response Get(string deploymentName, Canc /// An async 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), _nginxDeploymentClientDiagnostics, Pipeline, "NginxDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Operation Id - /// Deployments_ListByResourceGroup + /// NginxDeployment_ListByResourceGroup /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -295,9 +295,9 @@ 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); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), _nginxDeploymentClientDiagnostics, Pipeline, "NginxDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -309,11 +309,11 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string deploymentName, Can { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -372,11 +372,11 @@ public virtual Response Exists(string deploymentName, CancellationToken ca { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken); + var response = _nginxDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -395,11 +395,11 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -415,11 +415,11 @@ public virtual async Task> GetIfExists { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); @@ -440,11 +440,11 @@ public virtual async Task> GetIfExists /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -460,11 +460,11 @@ public virtual NullableResponse GetIfExists(string depl { Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken); + var response = _nginxDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); 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..5cdbef2ebf87 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.Serialization.cs @@ -38,16 +38,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } 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); @@ -75,8 +75,8 @@ internal static NginxDeploymentData DeserializeNginxDeploymentData(JsonElement e { return null; } - ManagedServiceIdentity identity = default; NginxDeploymentProperties properties = default; + ManagedServiceIdentity identity = default; NginxResourceSku sku = default; IDictionary tags = default; AzureLocation location = default; @@ -88,22 +88,22 @@ internal static NginxDeploymentData DeserializeNginxDeploymentData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) + if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerNginxContext.Default); + properties = NginxDeploymentProperties.DeserializeNginxDeploymentProperties(property.Value, options); continue; } - if (property.NameEquals("properties"u8)) + if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxDeploymentProperties.DeserializeNginxDeploymentProperties(property.Value, options); + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerNginxContext.Default); continue; } if (property.NameEquals("sku"u8)) @@ -171,8 +171,8 @@ internal static NginxDeploymentData DeserializeNginxDeploymentData(JsonElement e systemData, tags ?? new ChangeTrackingDictionary(), location, - identity, properties, + identity, sku, serializedAdditionalRawData); } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs index 54759c5e6679..71d7a7f7f5ec 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs @@ -13,7 +13,10 @@ namespace Azure.ResourceManager.Nginx { - /// A class representing the NginxDeployment data model. + /// + /// A class representing the NginxDeployment data model. + /// Nginx Deployment + /// public partial class NginxDeploymentData : TrackedResourceData { /// @@ -61,14 +64,14 @@ public NginxDeploymentData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Gets or sets the identity. - /// - /// + /// Nginx Deployment Properties. + /// Identity Properties. + /// Resource Sku. /// 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) + internal NginxDeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NginxDeploymentProperties properties, ManagedServiceIdentity identity, NginxResourceSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Identity = identity; Properties = properties; + Identity = identity; Sku = sku; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,11 +81,11 @@ internal NginxDeploymentData() { } - /// Gets or sets the identity. - public ManagedServiceIdentity Identity { get; set; } - /// Gets or sets the properties. + /// Nginx Deployment Properties. public NginxDeploymentProperties Properties { get; set; } - /// Gets or sets the sku. + /// Identity Properties. + public ManagedServiceIdentity Identity { get; set; } + /// Resource Sku. internal NginxResourceSku Sku { get; set; } /// Name of the SKU. public string SkuName diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs index 04a7ce73d44a..b7f79575e03e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs @@ -10,6 +10,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Nginx.Models; @@ -35,8 +36,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _nginxDeploymentDeploymentsClientDiagnostics; - private readonly DeploymentsRestOperations _nginxDeploymentDeploymentsRestClient; + private readonly ClientDiagnostics _nginxDeploymentClientDiagnostics; + private readonly NginxDeploymentsRestOperations _nginxDeploymentRestClient; + private readonly ClientDiagnostics _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics; + private readonly NginxDeploymentsRestOperations _nginxDeploymentWafPolicyNginxDeploymentsRestClient; private readonly NginxDeploymentData _data; /// Gets the resource type for the operations. @@ -61,9 +64,12 @@ internal NginxDeploymentResource(ArmClient client, NginxDeploymentData data) : t /// 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); + _nginxDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string nginxDeploymentApiVersion); + _nginxDeploymentRestClient = new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiVersion); + _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentWafPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NginxDeploymentWafPolicyResource.ResourceType, out string nginxDeploymentWafPolicyNginxDeploymentsApiVersion); + _nginxDeploymentWafPolicyNginxDeploymentsRestClient = new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentWafPolicyNginxDeploymentsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -106,11 +112,11 @@ public virtual NginxDeploymentApiKeyCollection GetNginxDeploymentApiKeys() /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -137,11 +143,11 @@ public virtual async Task> GetNginxDeplo /// /// /// Operation Id - /// ApiKeys_Get + /// NginxDeploymentApiKeyResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -175,11 +181,11 @@ public virtual NginxCertificateCollection GetNginxCertificates() /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -206,11 +212,11 @@ public virtual async Task> GetNginxCertificat /// /// /// Operation Id - /// Certificates_Get + /// NginxCertificate_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -244,11 +250,11 @@ public virtual NginxConfigurationCollection GetNginxConfigurations() /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -275,11 +281,11 @@ public virtual async Task> GetNginxConfigur /// /// /// Operation Id - /// Configurations_Get + /// NginxConfigurationResponse_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -297,6 +303,75 @@ public virtual Response GetNginxConfiguration(string return GetNginxConfigurations().Get(configurationName, cancellationToken); } + /// Gets a collection of NginxDeploymentWafPolicyResources in the NginxDeployment. + /// An object representing collection of NginxDeploymentWafPolicyResources 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 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// + /// + /// Operation Id + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) + { + return await GetNginxDeploymentWafPolicies().GetAsync(wafPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// + /// + /// Operation Id + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) + { + return GetNginxDeploymentWafPolicies().Get(wafPolicyName, cancellationToken); + } + /// /// Get the NGINX deployment /// @@ -306,11 +381,11 @@ public virtual Response GetNginxConfiguration(string /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -321,11 +396,11 @@ public virtual Response GetNginxConfiguration(string /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); scope.Start(); try { - var response = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _nginxDeploymentRestClient.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()); @@ -346,11 +421,11 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -361,11 +436,11 @@ public virtual async Task> GetAsync(Cancellati /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); scope.Start(); try { - var response = _nginxDeploymentDeploymentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _nginxDeploymentRestClient.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()); @@ -386,11 +461,11 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Operation Id - /// Deployments_Delete + /// NginxDeployment_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -402,12 +477,12 @@ 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 var scope = _nginxDeploymentClientDiagnostics.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); + var response = await _nginxDeploymentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(_nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -428,11 +503,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Deployments_Delete + /// NginxDeployment_Delete /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -444,12 +519,12 @@ 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 var scope = _nginxDeploymentClientDiagnostics.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); + var response = _nginxDeploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new NginxArmOperation(_nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -470,11 +545,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Deployments_Update + /// NginxDeployment_Update /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -483,19 +558,19 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// 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 Nginx deployment update parameters. /// The cancellation token to use. /// is null. public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); + using var scope = _nginxDeploymentClientDiagnostics.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); + var response = await _nginxDeploymentRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -516,11 +591,11 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Operation Id - /// Deployments_Update + /// NginxDeployment_Update /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -529,19 +604,19 @@ public virtual async Task> UpdateAsync(Wai /// /// /// 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 Nginx deployment update parameters. /// The cancellation token to use. /// is null. public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); 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); + var response = _nginxDeploymentRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -553,6 +628,124 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } } + /// + /// List Waf Policies of given Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies + /// + /// + /// Operation Id + /// NginxDeployments_GetWafPolicies + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetWafPoliciesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(e), _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics, Pipeline, "NginxDeploymentResource.GetWafPolicies", "value", "nextLink", cancellationToken); + } + + /// + /// List Waf Policies of given Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies + /// + /// + /// Operation Id + /// NginxDeployments_GetWafPolicies + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetWafPolicies(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(e), _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics, Pipeline, "NginxDeploymentResource.GetWafPolicies", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies + /// + /// + /// Operation Id + /// NginxDeployments_GetDefaultWafPolicies + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDefaultWafPoliciesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentRestClient.CreateGetDefaultWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(e), _nginxDeploymentClientDiagnostics, Pipeline, "NginxDeploymentResource.GetDefaultWafPolicies", "value", null, cancellationToken); + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies + /// + /// + /// Operation Id + /// NginxDeployments_GetDefaultWafPolicies + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDefaultWafPolicies(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentRestClient.CreateGetDefaultWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(e), _nginxDeploymentClientDiagnostics, Pipeline, "NginxDeploymentResource.GetDefaultWafPolicies", "value", null, cancellationToken); + } + /// /// Add a tag to the current resource. /// @@ -562,11 +755,11 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -583,7 +776,7 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); scope.Start(); try { @@ -592,7 +785,7 @@ public virtual async Task> AddTagAsync(string var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -624,11 +817,11 @@ public virtual async Task> AddTagAsync(string /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -645,7 +838,7 @@ 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 var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.AddTag"); scope.Start(); try { @@ -654,7 +847,7 @@ public virtual Response AddTag(string key, string value var 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); + var originalResponse = _nginxDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -686,11 +879,11 @@ public virtual Response AddTag(string key, string value /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -705,7 +898,7 @@ public virtual async Task> SetTagsAsync(IDicti { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.SetTags"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.SetTags"); scope.Start(); try { @@ -715,7 +908,7 @@ public virtual async Task> SetTagsAsync(IDicti var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -743,11 +936,11 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -762,7 +955,7 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary SetTags(IDictionary /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -819,7 +1012,7 @@ public virtual async Task> RemoveTagAsync(stri { Argument.AssertNotNull(key, nameof(key)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); scope.Start(); try { @@ -828,7 +1021,7 @@ public virtual async Task> RemoveTagAsync(stri var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _nginxDeploymentDeploymentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -860,11 +1053,11 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Operation Id - /// Deployments_Get + /// NginxDeployment_Get /// /// /// Default Api Version - /// 2024-11-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -879,7 +1072,7 @@ public virtual Response RemoveTag(string key, Cancellat { Argument.AssertNotNull(key, nameof(key)); - using var scope = _nginxDeploymentDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); + using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.RemoveTag"); scope.Start(); try { @@ -888,7 +1081,7 @@ public virtual Response RemoveTag(string key, Cancellat var 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); + var originalResponse = _nginxDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new NginxDeploymentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else 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..d7b057c147a3 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +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 _nginxDeploymentWafPolicyClientDiagnostics; + private readonly NginxDeploymentWafPoliciesRestOperations _nginxDeploymentWafPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected NginxDeploymentWafPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal NginxDeploymentWafPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _nginxDeploymentWafPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentWafPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NginxDeploymentWafPolicyResource.ResourceType, out string nginxDeploymentWafPolicyApiVersion); + _nginxDeploymentWafPolicyRestClient = new NginxDeploymentWafPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentWafPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + 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)); + } + + /// + /// 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 + /// NginxDeploymentWafPolicy_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 name of Waf Policy. + /// The Nginx Deployment Waf Policy. + /// 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 wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data).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 + /// NginxDeploymentWafPolicy_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 name of Waf Policy. + /// The Nginx Deployment Waf Policy. + /// 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 wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data, cancellationToken); + var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data).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 + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken).ConfigureAwait(false); + 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 + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken); + 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 + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// + /// + /// Operation Id + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// + /// + /// Operation Id + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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 + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Waf Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken); + 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..aadcaa53213e --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx.Models; + +namespace Azure.ResourceManager.Nginx +{ + public partial class NginxDeploymentWafPolicyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NginxDeploymentWafPolicyData 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(NginxDeploymentWafPolicyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNginxDeploymentWafPolicyData(document.RootElement, options); + } + + internal static NginxDeploymentWafPolicyData DeserializeNginxDeploymentWafPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NginxDeploymentWafPolicyProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NginxDeploymentWafPolicyProperties.DeserializeNginxDeploymentWafPolicyProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerNginxContext.Default); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NginxDeploymentWafPolicyData( + id, + name, + type, + systemData, + properties, + 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(NginxDeploymentWafPolicyData)} does not support writing '{options.Format}' format."); + } + } + + NginxDeploymentWafPolicyData 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 DeserializeNginxDeploymentWafPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentWafPolicyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} 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..bb96f34346db --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs @@ -0,0 +1,75 @@ +// 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 +{ + /// + /// A class representing the NginxDeploymentWafPolicy data model. + /// Nginx Deployment Waf Policy + /// + public partial class NginxDeploymentWafPolicyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NginxDeploymentWafPolicyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Nginx Deployment Waf Policy Properties. + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxDeploymentWafPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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..0240855d5c0a --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs @@ -0,0 +1,29 @@ +// 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 NginxDeploymentWafPolicyData s_dataDeserializationInstance; + private static NginxDeploymentWafPolicyData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NginxDeploymentWafPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerNginxContext.Default); + + NginxDeploymentWafPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerNginxContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)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..b0ccdee57d1b --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +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 GetNginxDeploymentWafPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetNginxDeploymentWafPolicy method. + /// + public partial class NginxDeploymentWafPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + /// The wafPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _nginxDeploymentWafPolicyClientDiagnostics; + private readonly NginxDeploymentWafPoliciesRestOperations _nginxDeploymentWafPolicyRestClient; + 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 the class for mocking. + protected NginxDeploymentWafPolicyResource() + { + } + + /// Initializes a new instance of the 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 the 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) + { + _nginxDeploymentWafPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string nginxDeploymentWafPolicyApiVersion); + _nginxDeploymentWafPolicyRestClient = new NginxDeploymentWafPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentWafPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual NginxDeploymentWafPolicyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get the Nginx Waf Policy of given Nginx deployment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// + /// + /// Operation Id + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new 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 + /// NginxDeploymentWafPolicy_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + 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 + /// NginxDeploymentWafPolicy_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 var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(_nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// 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 + /// NginxDeploymentWafPolicy_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 var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new NginxArmOperation(_nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// 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 + /// NginxDeploymentWafPolicy_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. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); + scope.Start(); + try + { + var response = await _nginxDeploymentWafPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// 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 + /// NginxDeploymentWafPolicy_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. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); + scope.Start(); + try + { + var response = _nginxDeploymentWafPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/CertificatesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs similarity index 98% rename from sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/CertificatesRestOperations.cs rename to sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs index 92246d90e58f..72fcb2f7f5e5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/CertificatesRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs @@ -15,24 +15,24 @@ namespace Azure.ResourceManager.Nginx { - internal partial class CertificatesRestOperations + internal partial class NginxCertificatesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CertificatesRestOperations. + /// Initializes a new instance of NginxCertificatesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public CertificatesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public NginxCertificatesRestOperations(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"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -273,7 +273,6 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(certificateName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } @@ -297,7 +296,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -325,7 +323,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string d _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ConfigurationsRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs similarity index 98% rename from sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ConfigurationsRestOperations.cs rename to sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs index c9510222e04b..612dc854892b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ConfigurationsRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.Nginx { - internal partial class ConfigurationsRestOperations + internal partial class NginxConfigurationResponsesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of ConfigurationsRestOperations. + /// Initializes a new instance of NginxConfigurationResponsesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public ConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public NginxConfigurationResponsesRestOperations(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"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,12 +46,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations", false); + uri.AppendPath("/configurations/", false); + uri.AppendPath(configurationName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string deploymentName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,7 +65,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); uri.AppendPath(deploymentName, true); - uri.AppendPath("/configurations", false); + uri.AppendPath("/configurations/", false); + uri.AppendPath(configurationName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,65 +74,73 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// List the NGINX configuration of given NGINX deployment. + /// 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> ListAsync(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) + /// , , 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 = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NginxConfigurationListResponse value = default; + NginxConfigurationData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxConfigurationListResponse.DeserializeNginxConfigurationListResponse(document.RootElement); + 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); } } - /// List the NGINX configuration of given NGINX deployment. + /// 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 List(string subscriptionId, string resourceGroupName, string deploymentName, CancellationToken cancellationToken = default) + /// , , 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 = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NginxConfigurationListResponse value = default; + NginxConfigurationData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxConfigurationListResponse.DeserializeNginxConfigurationListResponse(document.RootElement); + 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 CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,11 +156,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -164,77 +174,73 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou 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; } - /// Get the NGINX configuration of given NGINX deployment. + /// 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 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) + 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 = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); 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); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get the NGINX configuration of given NGINX deployment. + /// 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 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) + 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 = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); _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); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -250,11 +256,11 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxConfigurationCreateOrUpdateContent content) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -267,74 +273,65 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r 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. + /// 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 NGINX configuration. /// The cancellation token to use. - /// , , , or is null. + /// , , 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) + 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)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - case 201: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Create or update the NGINX configuration for given NGINX deployment. + /// 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 NGINX configuration. /// The cancellation token to use. - /// , , , or is null. + /// , , 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) + 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)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, configurationName, content); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - case 201: + case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -344,17 +341,16 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string 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("/configurations", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string deploymentName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -363,8 +359,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG 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("/configurations", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -372,57 +367,59 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Reset the NGINX configuration of given NGINX deployment to default. + /// 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 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) + /// , 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)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + 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); } } - /// Reset the NGINX configuration of given NGINX deployment to default. + /// 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 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) + /// , 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)); - Argument.AssertNotNullOrEmpty(configurationName, nameof(configurationName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, configurationName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, deploymentName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + 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/ApiKeysRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs similarity index 98% rename from sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ApiKeysRestOperations.cs rename to sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs index 25acefdb48c5..5a51ae60e44f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/ApiKeysRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.Nginx { - internal partial class ApiKeysRestOperations + internal partial class NginxDeploymentApiKeyResponsesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of ApiKeysRestOperations. + /// Initializes a new instance of NginxDeploymentApiKeyResponsesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public ApiKeysRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public NginxDeploymentApiKeyResponsesRestOperations(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"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -52,11 +52,11 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -70,83 +70,77 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r 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. + /// 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 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 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) + 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)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName, content); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); 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); } + case 404: + return Response.FromValue((NginxDeploymentApiKeyData)null, 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. + /// 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 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 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) + 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)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName, content); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); _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); } + case 404: + return Response.FromValue((NginxDeploymentApiKeyData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -162,11 +156,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -180,65 +174,83 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG 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; } - /// Delete API key for Nginx deployment. + /// 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 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) + 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 = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + 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); } } - /// Delete API key for Nginx deployment. + /// 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 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) + 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 = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + 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 CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -254,11 +266,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -271,12 +283,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou 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. + /// 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. @@ -284,32 +295,26 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// 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) + 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 = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + using var message = CreateDeleteRequest(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); + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get the specified API Key of the given Nginx deployment. + /// 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. @@ -317,26 +322,20 @@ public async Task> GetAsync(string subscript /// 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) + 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 = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + using var message = CreateDeleteRequest(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); + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } 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..3f4aba5ceb9b --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs @@ -0,0 +1,333 @@ +// 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; + +namespace Azure.ResourceManager.Nginx +{ + internal partial class NginxDeploymentWafPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NginxDeploymentWafPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public NginxDeploymentWafPoliciesRestOperations(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 ?? "2025-03-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) + { + 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("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) + { + 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("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Nginx Waf Policy 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 Waf Policy. + /// 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 wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NginxDeploymentWafPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NginxDeploymentWafPolicyData.DeserializeNginxDeploymentWafPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NginxDeploymentWafPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Nginx Waf Policy 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 Waf Policy. + /// 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 wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NginxDeploymentWafPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NginxDeploymentWafPolicyData.DeserializeNginxDeploymentWafPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NginxDeploymentWafPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData 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("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData 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("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, 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 Waf Policy 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 Waf Policy. + /// The Nginx Deployment Waf Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName, 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 Waf Policy 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 Waf Policy. + /// The Nginx Deployment Waf Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName, 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 wafPolicyName) + { + 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("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) + { + 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("/wafPolicies/", false); + uri.AppendPath(wafPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + _userAgent.Apply(message); + return message; + } + + /// Reset the Nginx Waf Policy 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 Waf Policy. + /// 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 wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Reset the Nginx Waf Policy 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 Waf Policy. + /// 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 wafPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return 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/NginxDeploymentsRestOperations.cs similarity index 69% rename from sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/DeploymentsRestOperations.cs rename to sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs index 1dfd9fbf6615..24b1566d58da 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/DeploymentsRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs @@ -15,24 +15,24 @@ namespace Azure.ResourceManager.Nginx { - internal partial class DeploymentsRestOperations + internal partial class NginxDeploymentsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of DeploymentsRestOperations. + /// Initializes a new instance of NginxDeploymentsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public DeploymentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public NginxDeploymentsRestOperations(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"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -174,7 +174,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// 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 Nginx deployment. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -201,7 +201,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// 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 Nginx deployment. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -266,7 +266,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// 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 Nginx deployment update parameters. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -282,7 +282,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 201: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); @@ -293,7 +293,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// 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 Nginx deployment update parameters. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -309,7 +309,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string d switch (message.Response.Status) { case 200: - case 201: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); @@ -345,7 +345,6 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(deploymentName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } @@ -367,7 +366,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -393,7 +391,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string d _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -402,6 +399,92 @@ public Response Delete(string subscriptionId, string resourceGroupName, string d } } + 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 CreateListRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); @@ -480,7 +563,7 @@ public Response List(string subscriptionId, Cancell } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateGetWafPoliciesRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -488,12 +571,14 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/wafPolicies", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateGetWafPoliciesRequest(string subscriptionId, string resourceGroupName, string deploymentName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -504,7 +589,103 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments", false); + uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/wafPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Waf Policies 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> GetWafPoliciesAsync(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 = CreateGetWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NginxDeploymentWafPolicyListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Waf Policies 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 GetWafPolicies(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 = CreateGetWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NginxDeploymentWafPolicyListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDefaultWafPoliciesRequestUri(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("/listDefaultWafPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDefaultWafPoliciesRequest(string subscriptionId, string resourceGroupName, string deploymentName) + { + 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("/listDefaultWafPolicies", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -512,18 +693,100 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } + /// Get the Nginx Waf Policy 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> GetDefaultWafPoliciesAsync(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 = CreateGetDefaultWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NginxDeploymentDefaultWafPolicyListResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NginxDeploymentDefaultWafPolicyListResponse.DeserializeNginxDeploymentDefaultWafPolicyListResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Nginx Waf Policy 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 GetDefaultWafPolicies(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 = CreateGetDefaultWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NginxDeploymentDefaultWafPolicyListResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NginxDeploymentDefaultWafPolicyListResponse.DeserializeNginxDeploymentDefaultWafPolicyListResponse(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 null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + 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 = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -540,17 +803,19 @@ public async Task> ListByResourceGroupAsyn } /// 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 null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + 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 = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -642,7 +907,7 @@ public Response ListNextPage(string nextLink, strin } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateGetWafPoliciesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -650,7 +915,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateGetWafPoliciesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -664,28 +929,30 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List all NGINX deployments under the specified resource group. + /// List Waf Policies 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> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetWafPoliciesNextPageAsync(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 = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateGetWafPoliciesNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NginxDeploymentListResponse value = default; + NginxDeploymentWafPolicyListResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); + value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -693,28 +960,30 @@ public async Task> ListByResourceGroupNext } } - /// List all NGINX deployments under the specified resource group. + /// List Waf Policies 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 ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetWafPoliciesNextPage(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 = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateGetWafPoliciesNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NginxDeploymentListResponse value = default; + NginxDeploymentWafPolicyListResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentListResponse.DeserializeNginxDeploymentListResponse(document.RootElement); + value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: 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/Generated/Samples/Sample_NginxCertificateCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs deleted file mode 100644 index 1aa0eb2752e3..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxCertificateCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_CertificatesCreateOrUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_CreateOrUpdate.json - // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxCertificateResource - NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); - - // invoke the operation - string certificateName = "default"; - NginxCertificateData data = new NginxCertificateData(); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, certificateName, data); - NginxCertificateResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxCertificateData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_CertificatesGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json - // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxCertificateResource - NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); - - // invoke the operation - string certificateName = "default"; - NginxCertificateResource result = await collection.GetAsync(certificateName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxCertificateData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_CertificatesList() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_List.json - // this example is just showing the usage of "Certificates_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxCertificateResource - NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); - - // invoke the operation and iterate over the result - await foreach (NginxCertificateResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxCertificateData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_CertificatesGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json - // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxCertificateResource - NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); - - // invoke the operation - string certificateName = "default"; - bool result = await collection.ExistsAsync(certificateName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_CertificatesGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json - // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxCertificateResource - NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); - - // invoke the operation - string certificateName = "default"; - NullableResponse response = await collection.GetIfExistsAsync(certificateName); - NginxCertificateResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxCertificateData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs deleted file mode 100644 index a38dd6b1eb46..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxCertificateResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_CertificatesGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json - // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxCertificateResource created on azure - // for more information of creating NginxCertificateResource, please refer to the document of NginxCertificateResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string certificateName = "default"; - ResourceIdentifier nginxCertificateResourceId = NginxCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, certificateName); - NginxCertificateResource nginxCertificate = client.GetNginxCertificateResource(nginxCertificateResourceId); - - // invoke the operation - NginxCertificateResource result = await nginxCertificate.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxCertificateData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Delete_CertificatesDelete() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Delete.json - // this example is just showing the usage of "Certificates_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxCertificateResource created on azure - // for more information of creating NginxCertificateResource, please refer to the document of NginxCertificateResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string certificateName = "default"; - ResourceIdentifier nginxCertificateResourceId = NginxCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, certificateName); - NginxCertificateResource nginxCertificate = client.GetNginxCertificateResource(nginxCertificateResourceId); - - // invoke the operation - await nginxCertificate.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_CertificatesCreateOrUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_CreateOrUpdate.json - // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxCertificateResource created on azure - // for more information of creating NginxCertificateResource, please refer to the document of NginxCertificateResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string certificateName = "default"; - ResourceIdentifier nginxCertificateResourceId = NginxCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, certificateName); - NginxCertificateResource nginxCertificate = client.GetNginxCertificateResource(nginxCertificateResourceId); - - // invoke the operation - NginxCertificateData data = new NginxCertificateData(); - ArmOperation lro = await nginxCertificate.UpdateAsync(WaitUntil.Completed, data); - NginxCertificateResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxCertificateData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs deleted file mode 100644 index eab6e91e2b50..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Nginx.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxConfigurationCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_ConfigurationsCreateOrUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_CreateOrUpdate.json - // this example is just showing the usage of "Configurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxConfigurationResource - NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); - - // invoke the operation - string configurationName = "default"; - NginxConfigurationCreateOrUpdateContent content = new NginxConfigurationCreateOrUpdateContent(); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, content); - NginxConfigurationResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_ConfigurationsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json - // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxConfigurationResource - NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); - - // invoke the operation - string configurationName = "default"; - NginxConfigurationResource result = await collection.GetAsync(configurationName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_ConfigurationsList() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_List.json - // this example is just showing the usage of "Configurations_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxConfigurationResource - NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); - - // invoke the operation and iterate over the result - await foreach (NginxConfigurationResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_ConfigurationsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json - // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxConfigurationResource - NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); - - // invoke the operation - string configurationName = "default"; - bool result = await collection.ExistsAsync(configurationName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_ConfigurationsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json - // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxConfigurationResource - NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); - - // invoke the operation - string configurationName = "default"; - NullableResponse response = await collection.GetIfExistsAsync(configurationName); - NginxConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs deleted file mode 100644 index e5ad1878da39..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Nginx.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxConfigurationResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_ConfigurationsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json - // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxConfigurationResource created on azure - // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string configurationName = "default"; - ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); - NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); - - // invoke the operation - NginxConfigurationResource result = await nginxConfiguration.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Delete_ConfigurationsDelete() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Delete.json - // this example is just showing the usage of "Configurations_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxConfigurationResource created on azure - // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string configurationName = "default"; - ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); - NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); - - // invoke the operation - await nginxConfiguration.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_ConfigurationsCreateOrUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_CreateOrUpdate.json - // this example is just showing the usage of "Configurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxConfigurationResource created on azure - // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string configurationName = "default"; - ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); - NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); - - // invoke the operation - NginxConfigurationCreateOrUpdateContent content = new NginxConfigurationCreateOrUpdateContent(); - ArmOperation lro = await nginxConfiguration.UpdateAsync(WaitUntil.Completed, content); - NginxConfigurationResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Analysis_ConfigurationsAnalysis() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Analysis.json - // this example is just showing the usage of "Configurations_Analysis" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxConfigurationResource created on azure - // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string configurationName = "default"; - ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); - NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); - - // invoke the operation - NginxAnalysisResult result = await nginxConfiguration.AnalysisAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs deleted file mode 100644 index 9381fb5929ce..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Nginx.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxDeploymentApiKeyCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_ApiKeysCreateOrUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_CreateOrUpdate.json - // this example is just showing the usage of "ApiKeys_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxDeploymentApiKeyResource - NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); - - // invoke the operation - string apiKeyName = "myApiKey"; - NginxDeploymentApiKeyCreateOrUpdateContent content = new NginxDeploymentApiKeyCreateOrUpdateContent(); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, apiKeyName, content); - NginxDeploymentApiKeyResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentApiKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_ApiKeysGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json - // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxDeploymentApiKeyResource - NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); - - // invoke the operation - string apiKeyName = "myApiKey"; - NginxDeploymentApiKeyResource result = await collection.GetAsync(apiKeyName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentApiKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_ApiKeysList() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_List.json - // this example is just showing the usage of "ApiKeys_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxDeploymentApiKeyResource - NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); - - // invoke the operation and iterate over the result - await foreach (NginxDeploymentApiKeyResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentApiKeyData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_ApiKeysGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json - // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxDeploymentApiKeyResource - NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); - - // invoke the operation - string apiKeyName = "myApiKey"; - bool result = await collection.ExistsAsync(apiKeyName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_ApiKeysGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json - // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // get the collection of this NginxDeploymentApiKeyResource - NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); - - // invoke the operation - string apiKeyName = "myApiKey"; - NullableResponse response = await collection.GetIfExistsAsync(apiKeyName); - NginxDeploymentApiKeyResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentApiKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs deleted file mode 100644 index 83a79c4cce9e..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Nginx.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxDeploymentApiKeyResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_ApiKeysGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json - // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentApiKeyResource created on azure - // for more information of creating NginxDeploymentApiKeyResource, please refer to the document of NginxDeploymentApiKeyResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string apiKeyName = "myApiKey"; - ResourceIdentifier nginxDeploymentApiKeyResourceId = NginxDeploymentApiKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - NginxDeploymentApiKeyResource nginxDeploymentApiKey = client.GetNginxDeploymentApiKeyResource(nginxDeploymentApiKeyResourceId); - - // invoke the operation - NginxDeploymentApiKeyResource result = await nginxDeploymentApiKey.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentApiKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Delete_ApiKeysDelete() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Delete.json - // this example is just showing the usage of "ApiKeys_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentApiKeyResource created on azure - // for more information of creating NginxDeploymentApiKeyResource, please refer to the document of NginxDeploymentApiKeyResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string apiKeyName = "myApiKey"; - ResourceIdentifier nginxDeploymentApiKeyResourceId = NginxDeploymentApiKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - NginxDeploymentApiKeyResource nginxDeploymentApiKey = client.GetNginxDeploymentApiKeyResource(nginxDeploymentApiKeyResourceId); - - // invoke the operation - await nginxDeploymentApiKey.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_ApiKeysCreateOrUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_CreateOrUpdate.json - // this example is just showing the usage of "ApiKeys_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentApiKeyResource created on azure - // for more information of creating NginxDeploymentApiKeyResource, please refer to the document of NginxDeploymentApiKeyResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - string apiKeyName = "myApiKey"; - ResourceIdentifier nginxDeploymentApiKeyResourceId = NginxDeploymentApiKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, apiKeyName); - NginxDeploymentApiKeyResource nginxDeploymentApiKey = client.GetNginxDeploymentApiKeyResource(nginxDeploymentApiKeyResourceId); - - // invoke the operation - NginxDeploymentApiKeyCreateOrUpdateContent content = new NginxDeploymentApiKeyCreateOrUpdateContent(); - ArmOperation lro = await nginxDeploymentApiKey.UpdateAsync(WaitUntil.Completed, content); - NginxDeploymentApiKeyResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentApiKeyData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs deleted file mode 100644 index f8017738e6e4..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxDeploymentCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_DeploymentsCreate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Create.json - // this example is just showing the usage of "Deployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - NginxDeploymentData data = new NginxDeploymentData(default); - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); - NginxDeploymentResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_DeploymentsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - NginxDeploymentResource result = await collection.GetAsync(deploymentName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_DeploymentsGetAutoScale() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - NginxDeploymentResource result = await collection.GetAsync(deploymentName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_DeploymentsListByResourceGroup() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_ListByResourceGroup.json - // this example is just showing the usage of "Deployments_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation and iterate over the result - await foreach (NginxDeploymentResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_DeploymentsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - bool result = await collection.ExistsAsync(deploymentName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_DeploymentsGetAutoScale() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - bool result = await collection.ExistsAsync(deploymentName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_DeploymentsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - NullableResponse response = await collection.GetIfExistsAsync(deploymentName); - NginxDeploymentResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_DeploymentsGetAutoScale() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this NginxDeploymentResource - NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); - - // invoke the operation - string deploymentName = "myDeployment"; - NullableResponse response = await collection.GetIfExistsAsync(deploymentName); - NginxDeploymentResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs deleted file mode 100644 index b2df491b0c83..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Nginx.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_NginxDeploymentResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_DeploymentsGet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // invoke the operation - NginxDeploymentResource result = await nginxDeployment.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_DeploymentsGetAutoScale() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json - // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // invoke the operation - NginxDeploymentResource result = await nginxDeployment.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Delete_DeploymentsDelete() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Delete.json - // this example is just showing the usage of "Deployments_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // invoke the operation - await nginxDeployment.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_DeploymentsUpdate() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Update.json - // this example is just showing the usage of "Deployments_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // invoke the operation - NginxDeploymentPatch patch = new NginxDeploymentPatch(); - ArmOperation lro = await nginxDeployment.UpdateAsync(WaitUntil.Completed, patch); - NginxDeploymentResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_DeploymentsUpdateSubnet() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_UpdateSubnet.json - // this example is just showing the usage of "Deployments_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this NginxDeploymentResource created on azure - // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "myResourceGroup"; - string deploymentName = "myDeployment"; - ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); - NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); - - // invoke the operation - NginxDeploymentPatch patch = new NginxDeploymentPatch(); - ArmOperation lro = await nginxDeployment.UpdateAsync(WaitUntil.Completed, patch); - NginxDeploymentResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs deleted file mode 100644 index d267633d0a58..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; -using NUnit.Framework; - -namespace Azure.ResourceManager.Nginx.Samples -{ - public partial class Sample_SubscriptionResourceExtensions - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetNginxDeployments_DeploymentsList() - { - // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_List.json - // this example is just showing the usage of "Deployments_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (NginxDeploymentResource item in subscriptionResource.GetNginxDeploymentsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - NginxDeploymentData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml new file mode 100644 index 000000000000..874f27338079 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/nginx/Nginx.Management +commit: aae85aa3e7e4fda95ea2d3abac0ba1d8159db214 +repo: Azure/azure-rest-api-specs +additionalDirectories: From 1527fe7570eb9d6e8e8eb45d88c8aee60023c1bb Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 13 Nov 2025 18:15:53 +0800 Subject: [PATCH 02/12] update --- .../api/Azure.ResourceManager.Nginx.net8.0.cs | 4 +- ...re.ResourceManager.Nginx.netstandard2.0.cs | 4 +- .../src/Generated/ArmNginxModelFactory.cs | 2 +- .../AzureResourceManagerNginxContext.cs | 1 - ...eploymentUpdateProperties.Serialization.cs | 27 +++- .../Models/NginxDeploymentUpdateProperties.cs | 18 +-- ...PropertiesNginxAppProtect.Serialization.cs | 133 ------------------ ...ploymentUpdatePropertiesNginxAppProtect.cs | 76 ---------- .../NginxCertificateData.Serialization.cs | 10 +- .../src/Generated/NginxCertificateData.cs | 4 +- .../Scenario/NginxDeploymentResourceTests.cs | 9 +- 11 files changed, 46 insertions(+), 242 deletions(-) delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs 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 876265b9b38d..91278f27b163 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 @@ -26,7 +26,7 @@ protected NginxCertificateCollection() { } public partial class NginxCertificateData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxCertificateData() { } - public string Location { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -309,7 +309,7 @@ public static partial class ArmNginxModelFactory 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, string location = 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 = 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; } 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 876265b9b38d..91278f27b163 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 @@ -26,7 +26,7 @@ protected NginxCertificateCollection() { } public partial class NginxCertificateData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NginxCertificateData() { } - public string Location { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public Azure.ResourceManager.Nginx.Models.NginxCertificateProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Nginx.NginxCertificateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -309,7 +309,7 @@ public static partial class ArmNginxModelFactory 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, string location = 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 = 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; } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs index e1019d806882..c8ce0f538419 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs @@ -230,7 +230,7 @@ public static NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWa /// 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, string location = null) + public static NginxCertificateData NginxCertificateData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxCertificateProperties properties = null, AzureLocation? location = null) { return new NginxCertificateData( id, 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 dd54fc0593e2..193448337bc8 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/AzureResourceManagerNginxContext.cs @@ -54,7 +54,6 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxDeploymentResource))] [ModelReaderWriterBuildable(typeof(NginxDeploymentScalingProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentUpdateProperties))] - [ModelReaderWriterBuildable(typeof(NginxDeploymentUpdatePropertiesNginxAppProtect))] [ModelReaderWriterBuildable(typeof(NginxDeploymentUserProfile))] [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyApplyingStatus))] [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyCompilingStatus))] 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..f8140583f3ad 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 @@ -64,11 +64,14 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("autoUpgradeProfile"u8); writer.WriteObjectValue(AutoUpgradeProfile, options); } - if (Optional.IsDefined(NginxAppProtect)) + writer.WritePropertyName("nginxAppProtect"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(WebApplicationFirewallSettings)) { - writer.WritePropertyName("nginxAppProtect"u8); - writer.WriteObjectValue(NginxAppProtect, options); + writer.WritePropertyName("webApplicationFirewallSettings"u8); + writer.WriteObjectValue(WebApplicationFirewallSettings, options); } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -112,7 +115,7 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate NginxDeploymentUserProfile userProfile = default; NginxNetworkProfile networkProfile = default; AutoUpgradeProfile autoUpgradeProfile = default; - NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect = default; + WebApplicationFirewallSettings webApplicationFirewallSettings = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -175,9 +178,21 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate { if (property.Value.ValueKind == JsonValueKind.Null) { + property.ThrowNonNullablePropertyIsNull(); continue; } - nginxAppProtect = NginxDeploymentUpdatePropertiesNginxAppProtect.DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(property.Value, options); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("webApplicationFirewallSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(property0.Value, options); + continue; + } + } continue; } if (options.Format != "W") @@ -193,7 +208,7 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate userProfile, networkProfile, autoUpgradeProfile, - nginxAppProtect, + webApplicationFirewallSettings, serializedAdditionalRawData); } 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 ea4ce464d0fd..18d45cb1d7ff 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs @@ -57,9 +57,9 @@ public NginxDeploymentUpdateProperties() /// Nginx Deployment User Profile. /// Nginx Network Profile. /// Autoupgrade settings of a deployment. - /// Update settings for NGINX App Protect (NAP). + /// Settings for the NGINX App Protect Web Application Firewall (WAF). /// 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) + internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLogging logging, NginxDeploymentScalingProperties scalingProperties, NginxDeploymentUserProfile userProfile, NginxNetworkProfile networkProfile, AutoUpgradeProfile autoUpgradeProfile, WebApplicationFirewallSettings webApplicationFirewallSettings, IDictionary serializedAdditionalRawData) { EnableDiagnosticsSupport = enableDiagnosticsSupport; Logging = logging; @@ -67,7 +67,7 @@ internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLo UserProfile = userProfile; NetworkProfile = networkProfile; AutoUpgradeProfile = autoUpgradeProfile; - NginxAppProtect = nginxAppProtect; + WebApplicationFirewallSettings = webApplicationFirewallSettings; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -114,17 +114,17 @@ public string UpgradeChannel set => AutoUpgradeProfile = new AutoUpgradeProfile(value); } - /// Update settings for NGINX App Protect (NAP). - internal NginxDeploymentUpdatePropertiesNginxAppProtect NginxAppProtect { get; set; } + /// 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 => NginxAppProtect is null ? default : NginxAppProtect.WebApplicationFirewallActivationState; + get => WebApplicationFirewallSettings is null ? default : WebApplicationFirewallSettings.ActivationState; set { - if (NginxAppProtect is null) - NginxAppProtect = new NginxDeploymentUpdatePropertiesNginxAppProtect(); - NginxAppProtect.WebApplicationFirewallActivationState = value; + if (WebApplicationFirewallSettings is null) + WebApplicationFirewallSettings = new WebApplicationFirewallSettings(); + WebApplicationFirewallSettings.ActivationState = 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 deleted file mode 100644 index e2cb927f18b6..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs +++ /dev/null @@ -1,133 +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 -{ - internal partial class NginxDeploymentUpdatePropertiesNginxAppProtect : 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(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) - { - 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 - } - } - } - - NginxDeploymentUpdatePropertiesNginxAppProtect 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(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) - { - 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()) - { - if (property.NameEquals("webApplicationFirewallSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentUpdatePropertiesNginxAppProtect(webApplicationFirewallSettings, 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(NginxDeploymentUpdatePropertiesNginxAppProtect)} does not support writing '{options.Format}' format."); - } - } - - NginxDeploymentUpdatePropertiesNginxAppProtect 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 DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NginxDeploymentUpdatePropertiesNginxAppProtect)} does not support reading '{options.Format}' format."); - } - } - - 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 deleted file mode 100644 index f66eb6a105f4..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs +++ /dev/null @@ -1,76 +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 -{ - /// 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; - - /// Initializes a new instance of . - 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) - { - WebApplicationFirewallSettings = webApplicationFirewallSettings; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// 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; - set - { - if (WebApplicationFirewallSettings is null) - WebApplicationFirewallSettings = new WebApplicationFirewallSettings(); - WebApplicationFirewallSettings.ActivationState = value; - } - } - } -} 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 8a136a93b10d..6273548941fc 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.Serialization.cs @@ -46,7 +46,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); + writer.WriteStringValue(Location.Value); } } @@ -71,7 +71,7 @@ internal static NginxCertificateData DeserializeNginxCertificateData(JsonElement return null; } NginxCertificateProperties properties = default; - string location = default; + AzureLocation? location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -91,7 +91,11 @@ internal static NginxCertificateData DeserializeNginxCertificateData(JsonElement } if (property.NameEquals("location"u8)) { - location = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); continue; } if (property.NameEquals("id"u8)) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs index a88294bb52b4..1e9a3797008f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs @@ -64,7 +64,7 @@ public NginxCertificateData() /// Nginx Certificate Properties. /// The geo-location where the resource lives. /// Keeps track of any properties unknown to the library. - internal NginxCertificateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxCertificateProperties properties, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NginxCertificateData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxCertificateProperties properties, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; Location = location; @@ -74,6 +74,6 @@ internal NginxCertificateData(ResourceIdentifier id, string name, ResourceType r /// Nginx Certificate Properties. public NginxCertificateProperties Properties { get; set; } /// The geo-location where the resource lives. - public string Location { get; set; } + public AzureLocation? Location { get; set; } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs index 6f59c00d21ac..ed816471db49 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs @@ -298,11 +298,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 +310,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); From 850ca85aa2a1fe19bde002e3f89b3a02a4fb8b56 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 13 Nov 2025 18:17:05 +0800 Subject: [PATCH 03/12] update --- sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml index 874f27338079..60592fed56b8 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/nginx/Nginx.Management -commit: aae85aa3e7e4fda95ea2d3abac0ba1d8159db214 +commit: cdc5ac5acf9d2faa1cd9f1ffad70f1ba69c8d788 repo: Azure/azure-rest-api-specs additionalDirectories: From 1883fd98cfd5bd6ce44e375cd3e21b782129a75d Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 14 Nov 2025 16:22:11 +0800 Subject: [PATCH 04/12] update spec commit id --- sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml index 60592fed56b8..697dbc1623cb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/nginx/Nginx.Management -commit: cdc5ac5acf9d2faa1cd9f1ffad70f1ba69c8d788 +commit: fe754a15d8559fac5c475f0ccf688f1647b09fab repo: Azure/azure-rest-api-specs additionalDirectories: From 0920584ad6870fa1274eb91f9497a7178104272a Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Sat, 13 Dec 2025 01:29:58 +0800 Subject: [PATCH 05/12] update --- .../Azure.ResourceManager.Nginx.net10.0.cs | 1145 +++++++++++++++++ .../api/Azure.ResourceManager.Nginx.net8.0.cs | 318 +++-- ...re.ResourceManager.Nginx.netstandard2.0.cs | 318 +++-- .../Azure.ResourceManager.Nginx/assets.json | 2 +- .../src/Azure.ResourceManager.Nginx.csproj | 2 +- .../src/Custom/ArmNginxModelFactory.cs | 68 + .../Custom/Models/NginxConfigurationFile.cs | 15 + .../Models/NginxDeploymentProperties.cs | 29 + .../Models/NginxFrontendIPConfiguration.cs | 47 + .../Custom/NginxConfigurationCollection.cs | 78 ++ .../src/Custom/NginxConfigurationData.cs | 19 + .../src/Custom/NginxConfigurationResource.cs | 74 ++ .../Custom/NginxDeploymentUpdateProperties.cs | 23 + .../src/Generated/ArmNginxModelFactory.cs | 365 +++--- ...tificatesGetAllAsyncCollectionResultOfT.cs | 84 ++ ...nxCertificatesGetAllCollectionResultOfT.cs | 83 ++ ...ResponsesGetAllAsyncCollectionResultOfT.cs | 84 ++ ...ationResponsesGetAllCollectionResultOfT.cs | 83 ++ ...ResponsesGetAllAsyncCollectionResultOfT.cs | 84 ++ ...piKeyResponsesGetAllCollectionResultOfT.cs | 83 ++ ...ploymentsGetAllAsyncCollectionResultOfT.cs | 78 ++ ...inxDeploymentsGetAllCollectionResultOfT.cs | 77 ++ ...ByResourceGroupAsyncCollectionResultOfT.cs | 81 ++ ...tsGetByResourceGroupCollectionResultOfT.cs | 80 ++ ...sGetWafPoliciesAsyncCollectionResultOfT.cs | 84 ++ ...ymentsGetWafPoliciesCollectionResultOfT.cs | 83 ++ .../Extensions/MockableNginxArmClient.cs | 43 +- .../MockableNginxResourceGroupResource.cs | 56 +- .../MockableNginxSubscriptionResource.cs | 75 +- .../Generated/Extensions/NginxExtensions.cs | 174 +-- .../src/Generated/Internal/Argument.cs | 75 +- .../Internal/AsyncPageableWrapper.cs | 48 + .../Internal/ChangeTrackingDictionary.cs | 24 +- .../Generated/Internal/ChangeTrackingList.cs | 17 +- .../Internal/ClientPipelineExtensions.cs | 72 ++ .../Internal/CodeGenMemberAttribute.cs | 20 + .../Internal/CodeGenSerializationAttribute.cs | 48 + .../Internal/CodeGenSuppressAttribute.cs | 29 + .../Internal/CodeGenTypeAttribute.cs | 24 + .../src/Generated/Internal/ErrorResult.cs | 32 + .../Internal/ModelSerializationExtensions.cs | 173 +-- .../src/Generated/Internal/Optional.cs | 12 +- .../src/Generated/Internal/PageableWrapper.cs | 47 + .../RawRequestUriBuilderExtensions.cs | 23 + .../Internal/RequestContextExtensions.cs | 26 + .../Generated/Internal/SerializationFormat.cs | 49 + .../src/Generated/Internal/TypeFormatters.cs | 181 +++ .../Internal/Utf8JsonRequestContent.cs | 8 +- .../LongRunningOperation/NginxArmOperation.cs | 70 +- .../NginxArmOperationOfT.cs | 79 +- .../NginxCertificateOperationSource.cs | 23 +- .../NginxConfigurationOperationSource.cs | 23 +- .../NginxDeploymentOperationSource.cs | 23 +- ...NginxDeploymentWafPolicyOperationSource.cs | 23 +- .../AutoUpgradeProfile.Serialization.cs | 77 +- .../Generated/Models/AutoUpgradeProfile.cs | 45 +- .../AzureResourceManagerNginxContext.cs | 12 +- .../NginxAnalysisConfig.Serialization.cs | 102 +- .../Generated/Models/NginxAnalysisConfig.cs | 51 +- .../NginxAnalysisContent.Serialization.cs | 88 +- .../Generated/Models/NginxAnalysisContent.cs | 47 +- .../NginxAnalysisDiagnostic.Serialization.cs | 105 +- .../Models/NginxAnalysisDiagnostic.cs | 73 +- .../NginxAnalysisResult.Serialization.cs | 91 +- .../Generated/Models/NginxAnalysisResult.cs | 50 +- ...ginxAnalysisResultDetails.Serialization.cs | 90 +- .../Models/NginxAnalysisResultDetails.cs | 49 +- .../NginxCertificateError.Serialization.cs | 78 +- .../Generated/Models/NginxCertificateError.cs | 44 +- ...nxCertificateListResponse.Serialization.cs | 95 +- .../Models/NginxCertificateListResponse.cs | 51 +- ...ginxCertificateProperties.Serialization.cs | 108 +- .../Models/NginxCertificateProperties.cs | 58 +- ...ationContentProtectedFile.Serialization.cs | 163 +++ .../NginxConfigurationContentProtectedFile.cs | 46 + ...tionCreateOrUpdateContent.Serialization.cs | 151 ++- ...NginxConfigurationCreateOrUpdateContent.cs | 66 +- ...nCreateOrUpdateProperties.Serialization.cs | 110 +- ...nxConfigurationCreateOrUpdateProperties.cs | 54 +- .../NginxConfigurationFile.Serialization.cs | 89 +- .../Models/NginxConfigurationFile.cs | 46 +- ...ConfigurationListResponse.Serialization.cs | 95 +- .../Models/NginxConfigurationListResponse.cs | 51 +- ...NginxConfigurationPackage.Serialization.cs | 96 +- .../Models/NginxConfigurationPackage.cs | 45 +- ...nxConfigurationProperties.Serialization.cs | 112 +- .../Models/NginxConfigurationProperties.cs | 62 +- ...ationProtectedFileContent.Serialization.cs | 151 --- .../NginxConfigurationProtectedFileContent.cs | 73 -- ...rationProtectedFileResult.Serialization.cs | 140 -- .../NginxConfigurationProtectedFileResult.cs | 69 - ...iKeyCreateOrUpdateContent.Serialization.cs | 151 ++- ...nxDeploymentApiKeyCreateOrUpdateContent.cs | 66 +- ...loymentApiKeyListResponse.Serialization.cs | 95 +- .../NginxDeploymentApiKeyListResponse.cs | 51 +- ...eploymentApiKeyProperties.Serialization.cs | 82 +- .../Models/NginxDeploymentApiKeyProperties.cs | 40 +- ...ntApiKeyRequestProperties.Serialization.cs | 82 +- .../NginxDeploymentApiKeyRequestProperties.cs | 40 +- ...ploymentAutoScaleSettings.Serialization.cs | 153 +++ .../NginxDeploymentAutoScaleSettings.cs | 43 + ...aultWafPolicyListResponse.Serialization.cs | 154 --- ...xDeploymentDefaultWafPolicyListResponse.cs | 70 - ...efaultWafPolicyListResult.Serialization.cs | 174 +++ ...inxDeploymentDefaultWafPolicyListResult.cs | 43 + ...efaultWafPolicyProperties.Serialization.cs | 84 +- ...inxDeploymentDefaultWafPolicyProperties.cs | 61 +- ...inxDeploymentListResponse.Serialization.cs | 95 +- .../Models/NginxDeploymentListResponse.cs | 51 +- .../NginxDeploymentPatch.Serialization.cs | 125 +- .../Generated/Models/NginxDeploymentPatch.cs | 62 +- ...NginxDeploymentProperties.Serialization.cs | 130 +- .../Models/NginxDeploymentProperties.cs | 99 +- ...PropertiesNginxAppProtect.Serialization.cs | 83 +- ...ginxDeploymentPropertiesNginxAppProtect.cs | 59 +- ...ploymentScalingProperties.Serialization.cs | 115 +- .../NginxDeploymentScalingProperties.cs | 60 +- ...eploymentUpdateProperties.Serialization.cs | 137 +- .../Models/NginxDeploymentUpdateProperties.cs | 109 +- ...PropertiesNginxAppProtect.Serialization.cs | 145 +++ ...ploymentUpdatePropertiesNginxAppProtect.cs | 53 + ...ginxDeploymentUserProfile.Serialization.cs | 74 +- .../Models/NginxDeploymentUserProfile.cs | 39 +- ...ntWafPolicyApplyingStatus.Serialization.cs | 84 +- .../NginxDeploymentWafPolicyApplyingStatus.cs | 41 +- ...nxDeploymentWafPolicyApplyingStatusCode.cs | 50 +- ...tWafPolicyCompilingStatus.Serialization.cs | 84 +- ...NginxDeploymentWafPolicyCompilingStatus.cs | 41 +- ...xDeploymentWafPolicyCompilingStatusCode.cs | 46 +- ...mentWafPolicyListResponse.Serialization.cs | 95 +- .../NginxDeploymentWafPolicyListResponse.cs | 50 +- ...ploymentWafPolicyMetadata.Serialization.cs | 140 +- .../NginxDeploymentWafPolicyMetadata.cs | 66 +- ...fPolicyMetadataProperties.Serialization.cs | 92 +- ...nxDeploymentWafPolicyMetadataProperties.cs | 44 +- ...oymentWafPolicyProperties.Serialization.cs | 102 +- .../NginxDeploymentWafPolicyProperties.cs | 62 +- .../NginxDiagnosticItem.Serialization.cs | 113 +- .../Generated/Models/NginxDiagnosticItem.cs | 75 +- .../Generated/Models/NginxDiagnosticLevel.cs | 40 +- ...nxFrontendIPConfiguration.Serialization.cs | 96 +- .../Models/NginxFrontendIPConfiguration.cs | 47 +- .../Models/NginxLogging.Serialization.cs | 76 +- .../src/Generated/Models/NginxLogging.cs | 39 +- ...orkInterfaceConfiguration.Serialization.cs | 75 +- .../NginxNetworkInterfaceConfiguration.cs | 41 +- .../NginxNetworkProfile.Serialization.cs | 82 +- .../Generated/Models/NginxNetworkProfile.cs | 50 +- .../NginxPrivateIPAddress.Serialization.cs | 87 +- .../Generated/Models/NginxPrivateIPAddress.cs | 45 +- .../Models/NginxPrivateIPAllocationMethod.cs | 40 +- .../Models/NginxProvisioningState.cs | 69 +- .../Models/NginxResourceSku.Serialization.cs | 77 +- .../src/Generated/Models/NginxResourceSku.cs | 45 +- .../Models/NginxScaleProfile.Serialization.cs | 81 +- .../src/Generated/Models/NginxScaleProfile.cs | 48 +- ...NginxScaleProfileCapacity.Serialization.cs | 81 +- .../Models/NginxScaleProfileCapacity.cs | 45 +- .../NginxStorageAccount.Serialization.cs | 78 +- .../Generated/Models/NginxStorageAccount.cs | 44 +- .../WebApplicationFirewallActivationState.cs | 40 +- ...FirewallComponentVersions.Serialization.cs | 81 +- ...WebApplicationFirewallComponentVersions.cs | 49 +- ...pplicationFirewallPackage.Serialization.cs | 81 +- .../Models/WebApplicationFirewallPackage.cs | 48 +- ...plicationFirewallSettings.Serialization.cs | 76 +- .../Models/WebApplicationFirewallSettings.cs | 39 +- ...ApplicationFirewallStatus.Serialization.cs | 98 +- .../Models/WebApplicationFirewallStatus.cs | 43 +- .../Generated/NginxCertificateCollection.cs | 384 +++--- .../NginxCertificateData.Serialization.cs | 134 +- .../src/Generated/NginxCertificateData.cs | 53 +- .../NginxCertificateResource.Serialization.cs | 18 +- .../src/Generated/NginxCertificateResource.cs | 259 ++-- .../Generated/NginxConfigurationCollection.cs | 386 +++--- .../NginxConfigurationData.Serialization.cs | 108 +- .../src/Generated/NginxConfigurationData.cs | 56 +- ...ginxConfigurationResource.Serialization.cs | 21 +- .../Generated/NginxConfigurationResource.cs | 357 +++-- .../NginxDeploymentApiKeyCollection.cs | 384 +++--- ...NginxDeploymentApiKeyData.Serialization.cs | 108 +- .../Generated/NginxDeploymentApiKeyData.cs | 52 +- ...xDeploymentApiKeyResource.Serialization.cs | 18 +- .../NginxDeploymentApiKeyResource.cs | 267 ++-- .../Generated/NginxDeploymentCollection.cs | 384 +++--- .../NginxDeploymentData.Serialization.cs | 168 ++- .../src/Generated/NginxDeploymentData.cs | 76 +- .../NginxDeploymentResource.Serialization.cs | 18 +- .../src/Generated/NginxDeploymentResource.cs | 1117 +++++++--------- .../NginxDeploymentWafPolicyCollection.cs | 332 +++-- ...nxDeploymentWafPolicyData.Serialization.cs | 120 +- .../Generated/NginxDeploymentWafPolicyData.cs | 52 +- ...ploymentWafPolicyResource.Serialization.cs | 18 +- .../NginxDeploymentWafPolicyResource.cs | 259 ++-- .../src/Generated/ProviderConstants.cs | 3 +- .../NginxCertificatesRestOperations.cs | 485 +------ ...inxConfigurationResponsesRestOperations.cs | 593 +-------- ...DeploymentApiKeyResponsesRestOperations.cs | 495 +------ ...ginxDeploymentWafPoliciesRestOperations.cs | 310 +---- .../NginxDeploymentsRestOperations.cs | 975 ++------------ .../Azure.ResourceManager.Nginx.Tests.csproj | 4 +- .../tests/NginxManagementTestBase.cs | 7 +- .../NginxCertificateCollectionTests.cs | 7 - .../Scenario/NginxCertificateResourceTests.cs | 1 - .../NginxConfigurationCollectionTests.cs | 6 - .../NginxConfigurationResourceTests.cs | 3 +- .../NginxDeploymentApiKeyCollectionTests.cs | 12 - .../NginxDeploymentApiKeyResourceTests.cs | 1 - .../NginxDeploymentCollectionTests.cs | 4 - .../Scenario/NginxDeploymentResourceTests.cs | 20 +- .../tsp-location.yaml | 4 +- 211 files changed, 11700 insertions(+), 10147 deletions(-) create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net10.0.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxConfigurationFile.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationCollection.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationResource.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllAsyncCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxCertificatesGetAllCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllAsyncCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxConfigurationResponsesGetAllCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllAsyncCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentApiKeyResponsesGetAllCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllAsyncCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetAllCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupAsyncCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetByResourceGroupCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/CollectionResults/NginxDeploymentsGetWafPoliciesCollectionResultOfT.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/AsyncPageableWrapper.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ClientPipelineExtensions.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenMemberAttribute.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSerializationAttribute.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenSuppressAttribute.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/CodeGenTypeAttribute.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ErrorResult.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/PageableWrapper.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RawRequestUriBuilderExtensions.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/RequestContextExtensions.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/SerializationFormat.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/TypeFormatters.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationContentProtectedFile.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.Serialization.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileContent.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.Serialization.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationProtectedFileResult.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentAutoScaleSettings.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs delete mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResult.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs 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..27054ff4d70e --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/api/Azure.ResourceManager.Nginx.net10.0.cs @@ -0,0 +1,1145 @@ +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, string skuName) { 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) { 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; } } + 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 { } } + 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 91278f27b163..27054ff4d70e 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,8 +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.Pageable GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDefaultWafPoliciesAsync(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; } @@ -218,14 +236,14 @@ 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, 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + 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; } @@ -237,7 +255,10 @@ public partial class NginxDeploymentWafPolicyData : Azure.ResourceManager.Models { 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; } @@ -260,8 +281,8 @@ protected NginxDeploymentWafPolicyResource() { } 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, 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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 { @@ -306,30 +327,39 @@ 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, 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, string skuName) { 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.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(byte[] content = null, string filepath = 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) { 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(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.NginxDeploymentWafPolicyMetadataProperties 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?), byte[] 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.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; } @@ -339,9 +369,12 @@ public partial class NginxAnalysisConfig : System.ClientModel.Primitives.IJsonMo 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; } @@ -352,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; } @@ -369,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; } @@ -381,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; } @@ -391,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; } @@ -405,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; } @@ -423,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; } @@ -446,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; } @@ -460,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; } @@ -473,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; } @@ -482,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; } @@ -536,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; } @@ -548,19 +620,40 @@ 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 byte[] Content { get { throw null; } } + 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; } @@ -575,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; } @@ -589,14 +685,20 @@ 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; } } + 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; } @@ -608,7 +710,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; } @@ -620,7 +725,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; } @@ -633,11 +741,15 @@ 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 { } } + 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; } @@ -650,7 +762,10 @@ 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; } @@ -675,6 +790,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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; } } @@ -684,7 +800,10 @@ 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; } @@ -708,14 +827,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + 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; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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; } @@ -729,7 +856,10 @@ internal NginxDeploymentWafPolicyMetadataProperties() { } 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; } @@ -741,10 +871,13 @@ public partial class NginxDeploymentWafPolicyProperties : System.ClientModel.Pri public NginxDeploymentWafPolicyProperties() { } public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } - public byte[] Content { get { throw null; } set { } } + 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; } @@ -763,7 +896,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; } @@ -785,6 +921,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; } } @@ -793,7 +930,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; } @@ -805,7 +945,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; } @@ -818,7 +961,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; } @@ -840,6 +986,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; } } @@ -865,6 +1012,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; } } @@ -873,7 +1021,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; } @@ -885,7 +1036,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; } @@ -897,7 +1051,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; } @@ -919,6 +1076,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; } } @@ -927,7 +1085,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; } @@ -939,7 +1100,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; } @@ -950,7 +1114,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; } @@ -965,7 +1132,10 @@ internal WebApplicationFirewallStatus() { } 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 91278f27b163..27054ff4d70e 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,8 +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.Pageable GetDefaultWafPolicies(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetDefaultWafPoliciesAsync(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; } @@ -218,14 +236,14 @@ 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, 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + 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; } @@ -237,7 +255,10 @@ public partial class NginxDeploymentWafPolicyData : Azure.ResourceManager.Models { 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; } @@ -260,8 +281,8 @@ protected NginxDeploymentWafPolicyResource() { } 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, 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, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { 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 { @@ -306,30 +327,39 @@ 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, 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, string skuName) { 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.NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(byte[] content = null, string filepath = 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) { 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(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.NginxDeploymentWafPolicyMetadataProperties 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?), byte[] 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.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; } @@ -339,9 +369,12 @@ public partial class NginxAnalysisConfig : System.ClientModel.Primitives.IJsonMo 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; } @@ -352,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; } @@ -369,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; } @@ -381,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; } @@ -391,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; } @@ -405,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; } @@ -423,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; } @@ -446,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; } @@ -460,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; } @@ -473,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; } @@ -482,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; } @@ -536,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; } @@ -548,19 +620,40 @@ 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 byte[] Content { get { throw null; } } + 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; } @@ -575,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; } @@ -589,14 +685,20 @@ 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; } } + 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; } @@ -608,7 +710,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; } @@ -620,7 +725,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; } @@ -633,11 +741,15 @@ 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 { } } + 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; } @@ -650,7 +762,10 @@ 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; } @@ -675,6 +790,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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; } } @@ -684,7 +800,10 @@ 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; } @@ -708,14 +827,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + 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; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + 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; } @@ -729,7 +856,10 @@ internal NginxDeploymentWafPolicyMetadataProperties() { } 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; } @@ -741,10 +871,13 @@ public partial class NginxDeploymentWafPolicyProperties : System.ClientModel.Pri public NginxDeploymentWafPolicyProperties() { } public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyApplyingStatus ApplyingState { get { throw null; } } public Azure.ResourceManager.Nginx.Models.NginxDeploymentWafPolicyCompilingStatus CompilingState { get { throw null; } } - public byte[] Content { get { throw null; } set { } } + 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; } @@ -763,7 +896,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; } @@ -785,6 +921,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; } } @@ -793,7 +930,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; } @@ -805,7 +945,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; } @@ -818,7 +961,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; } @@ -840,6 +986,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; } } @@ -865,6 +1012,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; } } @@ -873,7 +1021,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; } @@ -885,7 +1036,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; } @@ -897,7 +1051,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; } @@ -919,6 +1076,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; } } @@ -927,7 +1085,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; } @@ -939,7 +1100,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; } @@ -950,7 +1114,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; } @@ -965,7 +1132,10 @@ internal WebApplicationFirewallStatus() { } 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..0e6dec02d217 --- /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, string skuName) + => 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) + => 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..0aa245723b5f --- /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; } + } +} 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..48c24d4444a9 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs @@ -0,0 +1,29 @@ +// 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; } + + /// Gets or sets the scaling capacity. + 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..8f544a1cd29d --- /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))] + 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..367a616b9d6f --- /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; } + } +} 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..716863790bae --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +namespace Azure.ResourceManager.Nginx.Models +{ + /// Nginx Deployment Update Properties. + public partial class NginxDeploymentUpdateProperties + { + /// Gets or sets the scaling capacity. + 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 c8ce0f538419..80e08ee66a53 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/ArmNginxModelFactory.cs @@ -8,101 +8,103 @@ 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 = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentApiKeyProperties properties = null) + 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, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . + /// 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 = null, DateTimeOffset? endOn = null) + public static NginxDeploymentApiKeyProperties NginxDeploymentApiKeyProperties(string hint = default, DateTimeOffset? endOn = default) { - return new NginxDeploymentApiKeyProperties(hint, endOn, serializedAdditionalRawData: null); + return new NginxDeploymentApiKeyProperties(hint, endOn, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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. - /// The tags. - /// The 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. + /// Resource tags. + /// The geo-location where the resource lives. /// Nginx Deployment Properties. /// Identity Properties. - /// Resource Sku. + /// Name of the SKU. /// 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, NginxDeploymentProperties properties = null, ManagedServiceIdentity identity = null, string skuName = null) + 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) { - tags ??= new Dictionary(); + tags ??= new ChangeTrackingDictionary(); return new NginxDeploymentData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, tags, location, properties, identity, - skuName != null ? new NginxResourceSku(skuName, serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); + skuName is null ? default : new NginxResourceSku(skuName, null)); } - /// Initializes a new instance of . /// Provisioning State. /// /// Nginx Network Profile. /// The IP address of the deployment. /// - /// Nginx Logging. + /// Nginx Storage Account. /// Information on how the deployment will be scaled. - /// Autoupgrade settings of a deployment. - /// Nginx Deployment User Profile. + /// 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 = 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) + 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, @@ -110,32 +112,43 @@ public static NginxDeploymentProperties NginxDeploymentProperties(NginxProvision networkProfile, ipAddress, enableDiagnosticsSupport, - loggingStorageAccount != null ? new NginxLogging(loggingStorageAccount, serializedAdditionalRawData: null) : null, + loggingStorageAccount is null ? default : new NginxLogging(loggingStorageAccount, null), scalingProperties, - upgradeChannel != null ? new AutoUpgradeProfile(upgradeChannel, serializedAdditionalRawData: null) : null, - userPreferredEmail != null ? new NginxDeploymentUserProfile(userPreferredEmail, serializedAdditionalRawData: null) : null, + upgradeChannel is null ? default : new AutoUpgradeProfile(upgradeChannel, null), + userPreferredEmail is null ? default : new NginxDeploymentUserProfile(userPreferredEmail, null), nginxAppProtect, dataplaneApiEndpoint, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// Settings for the NGINX App Protect Web Application Firewall (WAF). + /// 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 = null, WebApplicationFirewallStatus webApplicationFirewallStatus = null) + public static NginxDeploymentPropertiesNginxAppProtect NginxDeploymentPropertiesNginxAppProtect(WebApplicationFirewallActivationState? webApplicationFirewallActivationState = default, WebApplicationFirewallStatus webApplicationFirewallStatus = default) { - return new NginxDeploymentPropertiesNginxAppProtect(webApplicationFirewallActivationState != null ? new WebApplicationFirewallSettings(webApplicationFirewallActivationState, serializedAdditionalRawData: null) : null, webApplicationFirewallStatus, serializedAdditionalRawData: null); + return new NginxDeploymentPropertiesNginxAppProtect(webApplicationFirewallActivationState is null ? default : new WebApplicationFirewallSettings(webApplicationFirewallActivationState, null), webApplicationFirewallStatus, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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 = null, WebApplicationFirewallPackage attackSignaturesPackage = null, WebApplicationFirewallPackage botSignaturesPackage = null, WebApplicationFirewallPackage threatCampaignsPackage = null, WebApplicationFirewallComponentVersions componentVersions = null) + public static WebApplicationFirewallStatus WebApplicationFirewallStatus(string wafRelease = default, WebApplicationFirewallPackage attackSignaturesPackage = default, WebApplicationFirewallPackage botSignaturesPackage = default, WebApplicationFirewallPackage threatCampaignsPackage = default, WebApplicationFirewallComponentVersions componentVersions = default) { return new WebApplicationFirewallStatus( wafRelease, @@ -143,106 +156,136 @@ public static WebApplicationFirewallStatus WebApplicationFirewallStatus(string w botSignaturesPackage, threatCampaignsPackage, componentVersions, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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 = null, DateTimeOffset revisionDatetime = default) + public static WebApplicationFirewallPackage WebApplicationFirewallPackage(string version = default, DateTimeOffset revisionDatetime = default) { - return new WebApplicationFirewallPackage(version, revisionDatetime, serializedAdditionalRawData: null); + return new WebApplicationFirewallPackage(version, revisionDatetime, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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 = null, string wafNginxVersion = null) + 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) { - return new WebApplicationFirewallComponentVersions(wafEngineVersion, wafNginxVersion, serializedAdditionalRawData: null); + tags ??= new ChangeTrackingDictionary(); + + return new NginxDeploymentPatch( + identity, + tags, + skuName is null ? default : new NginxResourceSku(skuName, null), + location, + properties, + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentWafPolicyMetadataProperties properties = null) + public static NginxDeploymentWafPolicyMetadata NginxDeploymentWafPolicyMetadata(string id = default, string name = default, string @type = default, NginxDeploymentWafPolicyMetadataProperties properties = default, SystemData systemData = default) { return new NginxDeploymentWafPolicyMetadata( id, name, - resourceType, - systemData, + @type, properties, - serializedAdditionalRawData: null); + systemData, + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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 = null, NginxProvisioningState? provisioningState = null, NginxDeploymentWafPolicyCompilingStatus compilingState = null, NginxDeploymentWafPolicyApplyingStatus applyingState = null) + public static NginxDeploymentWafPolicyMetadataProperties NginxDeploymentWafPolicyMetadataProperties(string filepath = default, NginxProvisioningState? provisioningState = default, NginxDeploymentWafPolicyCompilingStatus compilingState = default, NginxDeploymentWafPolicyApplyingStatus applyingState = default) { - return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, serializedAdditionalRawData: null); + return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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 = null, string displayStatus = null, string time = null) + public static NginxDeploymentWafPolicyCompilingStatus NginxDeploymentWafPolicyCompilingStatus(NginxDeploymentWafPolicyCompilingStatusCode? code = default, string displayStatus = default, string time = default) { - return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, serializedAdditionalRawData: null); + return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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 = null, string displayStatus = null, string time = null) + public static NginxDeploymentWafPolicyApplyingStatus NginxDeploymentWafPolicyApplyingStatus(NginxDeploymentWafPolicyApplyingStatusCode? code = default, string displayStatus = default, string time = default) { - return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, serializedAdditionalRawData: null); + return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// 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); + } + + /// Nginx Deployment Default Waf Policy Properties. /// /// /// A new instance for mocking. - public static NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(byte[] content = null, string filepath = null) + public static NginxDeploymentDefaultWafPolicyProperties NginxDeploymentDefaultWafPolicyProperties(BinaryData content = default, string filepath = default) { - return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, serializedAdditionalRawData: null); + return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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. /// /// @@ -252,7 +295,7 @@ public static NginxCertificateData NginxCertificateData(ResourceIdentifier id = /// /// 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, @@ -263,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. /// /// @@ -383,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. /// /// @@ -407,47 +474,47 @@ 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); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// 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 = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NginxDeploymentWafPolicyProperties properties = null) + 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, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . + /// 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 = null, byte[] content = null, string filepath = null, NginxDeploymentWafPolicyCompilingStatus compilingState = null, NginxDeploymentWafPolicyApplyingStatus applyingState = null) + public static NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyProperties(NginxProvisioningState? provisioningState = default, BinaryData content = default, string filepath = default, NginxDeploymentWafPolicyCompilingStatus compilingState = default, NginxDeploymentWafPolicyApplyingStatus applyingState = default) { return new NginxDeploymentWafPolicyProperties( provisioningState, @@ -455,7 +522,7 @@ public static NginxDeploymentWafPolicyProperties NginxDeploymentWafPolicyPropert filepath, compilingState, applyingState, - serializedAdditionalRawData: null); + 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 673c6cc33985..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,7 @@ 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) @@ -58,10 +44,7 @@ public virtual NginxDeploymentResource GetNginxDeploymentResource(ResourceIdenti 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. - /// 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 NginxCertificateResource GetNginxCertificateResource(ResourceIdentifier id) @@ -70,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) @@ -82,10 +62,7 @@ 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 NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResource(ResourceIdentifier 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 59438a4b6071..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 - /// NginxDeployment_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2025-03-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 - /// NginxDeployment_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2025-03-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 3f83c24a38eb..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 _nginxDeploymentClientDiagnostics; - private NginxDeploymentsRestOperations _nginxDeploymentRestClient; + 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 NginxDeploymentClientDiagnostics => _nginxDeploymentClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); - private NginxDeploymentsRestOperations NginxDeploymentRestClient => _nginxDeploymentRestClient ??= new NginxDeploymentsRestOperations(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 - /// NginxDeployment_List + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Default Api Version - /// 2025-03-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) => NginxDeploymentRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentClientDiagnostics, 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 - /// NginxDeployment_List + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Default Api Version - /// 2025-03-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) => NginxDeploymentRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => NginxDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), NginxDeploymentClientDiagnostics, 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 ac0381769cdc..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,13 @@ 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. @@ -71,14 +74,13 @@ public static NginxDeploymentResource GetNginxDeploymentResource(this ArmClient } /// - /// 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,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. @@ -109,14 +110,13 @@ 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. @@ -128,15 +128,15 @@ public static NginxDeploymentWafPolicyResource GetNginxDeploymentWafPolicyResour } /// - /// 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)); @@ -146,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-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) { @@ -184,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-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) { @@ -222,33 +184,15 @@ public static Response GetNginxDeployment(this Resource /// /// List the NGINX deployments resources - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// NginxDeployment_List - /// - /// - /// Default Api Version - /// 2025-03-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)); @@ -258,30 +202,12 @@ public static AsyncPageable GetNginxDeploymentsAsync(th /// /// List the NGINX deployments resources - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments - /// - /// - /// Operation Id - /// NginxDeployment_List - /// - /// - /// Default Api Version - /// 2025-03-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..d55a94253dd2 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Internal/ModelSerializationExtensions.cs @@ -11,18 +11,16 @@ using System.Diagnostics; using System.Globalization; 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 +46,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 +91,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 +105,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 +179,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; @@ -259,151 +254,5 @@ 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 - { - 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() - }; - } } } 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 index 2835a5ca861c..730842b5a80e 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/LongRunningOperation/NginxDeploymentWafPolicyOperationSource.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 NginxDeploymentWafPolicyOperationSource : IOperationSource + /// + 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) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); + 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) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerNginxContext.Default); - return await Task.FromResult(new NginxDeploymentWafPolicyResource(_client, data)).ConfigureAwait(false); + 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 193448337bc8..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,8 +43,9 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyRequestProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentApiKeyResource))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentAutoScaleSettings))] [ModelReaderWriterBuildable(typeof(NginxDeploymentData))] - [ModelReaderWriterBuildable(typeof(NginxDeploymentDefaultWafPolicyListResponse))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentDefaultWafPolicyListResult))] [ModelReaderWriterBuildable(typeof(NginxDeploymentDefaultWafPolicyProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentListResponse))] [ModelReaderWriterBuildable(typeof(NginxDeploymentPatch))] @@ -54,6 +54,7 @@ namespace Azure.ResourceManager.Nginx [ModelReaderWriterBuildable(typeof(NginxDeploymentResource))] [ModelReaderWriterBuildable(typeof(NginxDeploymentScalingProperties))] [ModelReaderWriterBuildable(typeof(NginxDeploymentUpdateProperties))] + [ModelReaderWriterBuildable(typeof(NginxDeploymentUpdatePropertiesNginxAppProtect))] [ModelReaderWriterBuildable(typeof(NginxDeploymentUserProfile))] [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyApplyingStatus))] [ModelReaderWriterBuildable(typeof(NginxDeploymentWafPolicyCompilingStatus))] @@ -80,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 5a62ff24c1db..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,49 +7,21 @@ 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 . @@ -57,22 +29,25 @@ public NginxAnalysisConfig() /// /// /// Nginx Configuration Package. - /// Keeps track of any properties unknown to the library. - internal NginxAnalysisConfig(string rootFile, IList files, IList protectedFiles, NginxConfigurationPackage package, IDictionary serializedAdditionalRawData) + /// 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 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 ef1a993f08ff..c1662cb5e73f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateError.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 87600e9828d0..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,15 +35,14 @@ 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."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (NginxCertificateData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,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; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { 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)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + 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, 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": @@ -130,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: @@ -146,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 ab8313ce818d..3bf783736aca 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateListResponse.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// 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 . /// The NginxCertificate items on this page. - /// is null. internal NginxCertificateListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// 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(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxCertificateListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxCertificateListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The NginxCertificate items on this page. - public IReadOnlyList Value { get; } + 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 16883a9dd3bc..694fa4e98f3b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxCertificateProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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() @@ -59,8 +30,8 @@ public NginxCertificateProperties() /// /// /// 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 serializedAdditionalRawData) + /// 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,23 +41,30 @@ internal NginxCertificateProperties(NginxProvisioningState? provisioningState, s KeyVaultSecretVersion = keyVaultSecretVersion; KeyVaultSecretCreated = keyVaultSecretCreated; CertificateError = certificateError; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// 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; } + /// 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 1be45798713e..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 { /// Nginx Configuration Request. - public partial class NginxConfigurationCreateOrUpdateContent : ResourceData + 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. + /// + /// + /// /// Nginx Configuration Request Properties. - /// 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) + /// 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 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 9a6e391a9cd9..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,49 +7,21 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// 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 . @@ -58,26 +30,30 @@ public NginxConfigurationCreateOrUpdateProperties() /// /// 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; } /// 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 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 941e81ddd633..42659b0273a5 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationFile.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 c1cc97f0e30d..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,15 +35,14 @@ 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."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (NginxConfigurationData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,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; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { 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)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + 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, 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": @@ -130,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: @@ -146,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 16fa8543bbb4..572b419cf4da 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxConfigurationListResponse.cs @@ -8,72 +8,37 @@ 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 . /// The NginxConfigurationResponse items on this page. - /// is null. internal NginxConfigurationListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// 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(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxConfigurationListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxConfigurationListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The NginxConfigurationResponse items on this page. - public IReadOnlyList Value { get; } + 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 e4f7f38b2516..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 { /// 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 8adba78123bc..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,49 +7,21 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// 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 . @@ -58,26 +30,30 @@ internal NginxConfigurationProperties() /// /// 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; } /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// Gets the files. - public IReadOnlyList Files { get; } - /// Gets the protected files. - public IReadOnlyList ProtectedFiles { get; } + + /// Gets the Files. + public IList Files { get; } + + /// Gets the ProtectedFiles. + public IList ProtectedFiles { get; } + /// Nginx Configuration Package. - public NginxConfigurationPackage Package { get; } - /// Gets the root file. - public string RootFile { get; } + 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 4b1040c12aec..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 -{ - /// Nginx Configuration Protected File Request. - 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 c59fdf0aeaa2..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 -{ - /// Nginx Configuration Protected File Response. - 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 e744b8673af5..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 { /// Nginx Deployment Api Key Request. - public partial class NginxDeploymentApiKeyCreateOrUpdateContent : ResourceData + 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. + /// + /// + /// /// Nginx Deployment Api Key Request Properties. - /// 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) + /// 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 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 f5941117f4a3..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,15 +35,14 @@ 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."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (NginxDeploymentApiKeyData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,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; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { 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)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + 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, 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": @@ -130,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: @@ -146,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 4b607177e4eb..1bd23189fc47 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyListResponse.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// 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 . /// The NginxDeploymentApiKeyResponse items on this page. - /// is null. internal NginxDeploymentApiKeyListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// 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(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentApiKeyListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxDeploymentApiKeyListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The NginxDeploymentApiKeyResponse items on this page. - public IReadOnlyList Value { get; } + 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 5a3744f57b5a..55b00f9f0a78 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 02fb7356bfcd..6c49a3c97164 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentApiKeyRequestProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs deleted file mode 100644 index d88b19583e79..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.Serialization.cs +++ /dev/null @@ -1,154 +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 -{ - internal partial class NginxDeploymentDefaultWafPolicyListResponse : 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(NginxDeploymentDefaultWafPolicyListResponse)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NginxDeploymentDefaultWafPolicyListResponse 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(NginxDeploymentDefaultWafPolicyListResponse)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNginxDeploymentDefaultWafPolicyListResponse(document.RootElement, options); - } - - internal static NginxDeploymentDefaultWafPolicyListResponse DeserializeNginxDeploymentDefaultWafPolicyListResponse(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NginxDeploymentDefaultWafPolicyListResponse(value ?? new ChangeTrackingList(), nextLink, 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(NginxDeploymentDefaultWafPolicyListResponse)} does not support writing '{options.Format}' format."); - } - } - - NginxDeploymentDefaultWafPolicyListResponse 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 DeserializeNginxDeploymentDefaultWafPolicyListResponse(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NginxDeploymentDefaultWafPolicyListResponse)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs deleted file mode 100644 index 1991a9bcdfe2..000000000000 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyListResponse.cs +++ /dev/null @@ -1,70 +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 -{ - /// Nginx Deployment Default Waf Policy List Response. - internal partial class NginxDeploymentDefaultWafPolicyListResponse - { - /// - /// 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 NginxDeploymentDefaultWafPolicyListResponse() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// - /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentDefaultWafPolicyListResponse(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// Gets the next link. - public string NextLink { get; } - } -} 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 index 413917c4773f..8b2142e26196 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.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 NginxDeploymentDefaultWafPolicyProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Default Waf Policy Properties. + public partial class NginxDeploymentDefaultWafPolicyProperties : 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,31 +29,30 @@ 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(NginxDeploymentDefaultWafPolicyProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Content)) { writer.WritePropertyName("content"u8); - writer.WriteBase64StringValue(Content, "D"); + writer.WriteBase64StringValue(Content.ToArray(), "D"); } if (options.Format != "W" && Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); writer.WriteStringValue(Filepath); } - 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 } } - NginxDeploymentDefaultWafPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentDefaultWafPolicyProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentDefaultWafPolicyProperties(document.RootElement, options); } - internal static NginxDeploymentDefaultWafPolicyProperties DeserializeNginxDeploymentDefaultWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentDefaultWafPolicyProperties DeserializeNginxDeploymentDefaultWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - byte[] content = default; + BinaryData content = default; string filepath = 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("content"u8)) + if (prop.NameEquals("content"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - content = property.Value.GetBytesFromBase64("D"); + content = BinaryData.FromBytes(prop.Value.GetBytesFromBase64("D")); continue; } - if (property.NameEquals("filepath"u8)) + if (prop.NameEquals("filepath"u8)) { - filepath = property.Value.GetString(); + filepath = 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 NginxDeploymentDefaultWafPolicyProperties(content, filepath, serializedAdditionalRawData); + return new NginxDeploymentDefaultWafPolicyProperties(content, filepath, 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(Mo } } - NginxDeploymentDefaultWafPolicyProperties 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentDefaultWafPolicyProperties(document.RootElement, options); } default: @@ -139,6 +150,7 @@ NginxDeploymentDefaultWafPolicyProperties 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/NginxDeploymentDefaultWafPolicyProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs index 1631830ddcc0..ce7981512bd8 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentDefaultWafPolicyProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Nginx Deployment Default Waf Policy Properties. public partial class NginxDeploymentDefaultWafPolicyProperties { - /// - /// 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 NginxDeploymentDefaultWafPolicyProperties() @@ -53,17 +24,33 @@ internal NginxDeploymentDefaultWafPolicyProperties() /// Initializes a new instance of . /// /// - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentDefaultWafPolicyProperties(byte[] content, string filepath, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentDefaultWafPolicyProperties(BinaryData content, string filepath, IDictionary additionalBinaryDataProperties) { Content = content; Filepath = filepath; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the content. - public byte[] Content { get; } - /// Gets the filepath. + /// + /// 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 301241ad28f9..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,15 +35,14 @@ 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."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (NginxDeploymentData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,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; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { 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)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + 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, 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": @@ -130,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: @@ -146,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 724618e0b0f9..0dd59fe84501 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentListResponse.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { /// 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 . /// The NginxDeployment items on this page. - /// is null. internal NginxDeploymentListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// 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(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxDeploymentListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The NginxDeployment items on this page. - public IReadOnlyList Value { get; } + 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 68afaefedb41..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 { /// 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() @@ -59,33 +31,43 @@ public NginxDeploymentPatch() /// 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 serializedAdditionalRawData) + /// 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; } /// Identity Properties. public ManagedServiceIdentity Identity { get; set; } + /// Dictionary of <string>. public IDictionary Tags { get; } + /// 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); - } /// 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 + { + return Sku is null ? default : Sku.Name; + } + set + { + Sku = new NginxResourceSku(value); + } + } } } 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 8555063131df..66f42c003c9f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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() @@ -62,8 +33,8 @@ public NginxDeploymentProperties() /// 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; } /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// Gets the nginx version. + + /// Gets the NginxVersion. public string NginxVersion { get; } + /// 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; } + /// Nginx Logging. internal NginxLogging Logging { get; set; } + + /// 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); + } } - /// Nginx Deployment 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 f8140583f3ad..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); @@ -64,23 +64,20 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("autoUpgradeProfile"u8); writer.WriteObjectValue(AutoUpgradeProfile, options); } - writer.WritePropertyName("nginxAppProtect"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(WebApplicationFirewallSettings)) + if (Optional.IsDefined(NginxAppProtect)) { - writer.WritePropertyName("webApplicationFirewallSettings"u8); - writer.WriteObjectValue(WebApplicationFirewallSettings, options); + writer.WritePropertyName("nginxAppProtect"u8); + writer.WriteObjectValue(NginxAppProtect, 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); } @@ -89,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; @@ -115,92 +117,78 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate NginxDeploymentUserProfile userProfile = default; NginxNetworkProfile networkProfile = default; AutoUpgradeProfile autoUpgradeProfile = default; - WebApplicationFirewallSettings webApplicationFirewallSettings = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect = default; + 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) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("webApplicationFirewallSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(property0.Value, options); - continue; - } - } + 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, @@ -208,14 +196,17 @@ internal static NginxDeploymentUpdateProperties DeserializeNginxDeploymentUpdate userProfile, networkProfile, autoUpgradeProfile, - webApplicationFirewallSettings, - serializedAdditionalRawData); + nginxAppProtect, + 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": @@ -225,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: @@ -241,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 18d45cb1d7ff..d6723d60bffd 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdateProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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() @@ -57,9 +28,9 @@ public NginxDeploymentUpdateProperties() /// Nginx Deployment User Profile. /// Nginx Network Profile. /// Autoupgrade settings of a deployment. - /// Settings for the NGINX App Protect Web Application Firewall (WAF). - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLogging logging, NginxDeploymentScalingProperties scalingProperties, NginxDeploymentUserProfile userProfile, NginxNetworkProfile networkProfile, AutoUpgradeProfile autoUpgradeProfile, WebApplicationFirewallSettings webApplicationFirewallSettings, IDictionary serializedAdditionalRawData) + /// 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 additionalBinaryDataProperties) { EnableDiagnosticsSupport = enableDiagnosticsSupport; Logging = logging; @@ -67,64 +38,92 @@ internal NginxDeploymentUpdateProperties(bool? enableDiagnosticsSupport, NginxLo UserProfile = userProfile; NetworkProfile = networkProfile; AutoUpgradeProfile = autoUpgradeProfile; - WebApplicationFirewallSettings = webApplicationFirewallSettings; - _serializedAdditionalRawData = serializedAdditionalRawData; + NginxAppProtect = nginxAppProtect; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets or sets the enable diagnostics support. + /// Gets or sets the EnableDiagnosticsSupport. public bool? EnableDiagnosticsSupport { get; set; } + /// Nginx Logging. internal NginxLogging Logging { get; set; } + + /// 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; } - /// Nginx Deployment 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; } } - /// Nginx 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); + } } - /// 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 NginxAppProtect is null ? default : NginxAppProtect.WebApplicationFirewallActivationState; + } set { - if (WebApplicationFirewallSettings is null) - WebApplicationFirewallSettings = new WebApplicationFirewallSettings(); - WebApplicationFirewallSettings.ActivationState = value; + if (NginxAppProtect is null) + { + NginxAppProtect = new NginxDeploymentUpdatePropertiesNginxAppProtect(); + } + 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 new file mode 100644 index 000000000000..1de523e0dba4 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.Serialization.cs @@ -0,0 +1,145 @@ +// 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 +{ + /// Update settings for NGINX App Protect (NAP). + internal partial class NginxDeploymentUpdatePropertiesNginxAppProtect : 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(NginxDeploymentUpdatePropertiesNginxAppProtect)} does not support writing '{format}' format."); + } + if (Optional.IsDefined(WebApplicationFirewallSettings)) + { + writer.WritePropertyName("webApplicationFirewallSettings"u8); + writer.WriteObjectValue(WebApplicationFirewallSettings, 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. + 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) + { + 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); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentUpdatePropertiesNginxAppProtect DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebApplicationFirewallSettings webApplicationFirewallSettings = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("webApplicationFirewallSettings"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + webApplicationFirewallSettings = WebApplicationFirewallSettings.DeserializeWebApplicationFirewallSettings(prop.Value, options); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new NginxDeploymentUpdatePropertiesNginxAppProtect(webApplicationFirewallSettings, 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(NginxDeploymentUpdatePropertiesNginxAppProtect)} does not support writing '{options.Format}' 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)) + { + return DeserializeNginxDeploymentUpdatePropertiesNginxAppProtect(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NginxDeploymentUpdatePropertiesNginxAppProtect)} 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/NginxDeploymentUpdatePropertiesNginxAppProtect.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs new file mode 100644 index 000000000000..e59337d8f173 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUpdatePropertiesNginxAppProtect.cs @@ -0,0 +1,53 @@ +// 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 +{ + /// Update settings for NGINX App Protect (NAP). + internal partial class NginxDeploymentUpdatePropertiesNginxAppProtect + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + 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 additionalBinaryDataProperties) + { + WebApplicationFirewallSettings = webApplicationFirewallSettings; + _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 + { + 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 fb25afbc3b08..1bb6a7fd8fdb 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentUserProfile.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 index f5cddc99a9fc..13587dc19e21 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.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 NginxDeploymentWafPolicyApplyingStatus : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy Applying Status. + public partial class NginxDeploymentWafPolicyApplyingStatus : 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(NginxDeploymentWafPolicyApplyingStatus)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -49,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("time"u8); writer.WriteStringValue(Time); } - 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,22 +66,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentWafPolicyApplyingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentWafPolicyApplyingStatus)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyApplyingStatus(document.RootElement, options); } - internal static NginxDeploymentWafPolicyApplyingStatus DeserializeNginxDeploymentWafPolicyApplyingStatus(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyApplyingStatus DeserializeNginxDeploymentWafPolicyApplyingStatus(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,42 +94,43 @@ internal static NginxDeploymentWafPolicyApplyingStatus DeserializeNginxDeploymen NginxDeploymentWafPolicyApplyingStatusCode? code = default; string displayStatus = default; string time = 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)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - code = new NginxDeploymentWafPolicyApplyingStatusCode(property.Value.GetString()); + code = new NginxDeploymentWafPolicyApplyingStatusCode(prop.Value.GetString()); continue; } - if (property.NameEquals("displayStatus"u8)) + if (prop.NameEquals("displayStatus"u8)) { - displayStatus = property.Value.GetString(); + displayStatus = prop.Value.GetString(); continue; } - if (property.NameEquals("time"u8)) + if (prop.NameEquals("time"u8)) { - time = property.Value.GetString(); + time = 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 NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, serializedAdditionalRawData); + return new NginxDeploymentWafPolicyApplyingStatus(code, displayStatus, time, 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 +140,20 @@ BinaryData IPersistableModel.Write(Model } } - NginxDeploymentWafPolicyApplyingStatus 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyApplyingStatus(document.RootElement, options); } default: @@ -150,6 +161,7 @@ NginxDeploymentWafPolicyApplyingStatus 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/NginxDeploymentWafPolicyApplyingStatus.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs index e065e7ab6485..220681c470ef 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatus.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Nginx Deployment Waf Policy Applying Status. public partial class NginxDeploymentWafPolicyApplyingStatus { - /// - /// 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 NginxDeploymentWafPolicyApplyingStatus() @@ -54,19 +25,21 @@ internal NginxDeploymentWafPolicyApplyingStatus() /// 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 serializedAdditionalRawData) + /// 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; - _serializedAdditionalRawData = serializedAdditionalRawData; + _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 index 6205b3c878ec..c6ef5af44d7a 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyApplyingStatusCode.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { @@ -14,47 +15,72 @@ namespace Azure.ResourceManager.Nginx.Models 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) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string NotAppliedValue = "NotApplied"; - private const string ApplyingValue = "Applying"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string RemovingValue = "Removing"; + _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 to a . + + /// 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 index eff2cf1a4c15..a4701dd58447 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.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 NginxDeploymentWafPolicyCompilingStatus : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy Compiling Status. + public partial class NginxDeploymentWafPolicyCompilingStatus : 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 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(NginxDeploymentWafPolicyCompilingStatus)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -49,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("time"u8); writer.WriteStringValue(Time); } - 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,22 +66,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentWafPolicyCompilingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentWafPolicyCompilingStatus)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyCompilingStatus(document.RootElement, options); } - internal static NginxDeploymentWafPolicyCompilingStatus DeserializeNginxDeploymentWafPolicyCompilingStatus(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyCompilingStatus DeserializeNginxDeploymentWafPolicyCompilingStatus(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,42 +94,43 @@ internal static NginxDeploymentWafPolicyCompilingStatus DeserializeNginxDeployme NginxDeploymentWafPolicyCompilingStatusCode? code = default; string displayStatus = default; string time = 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)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - code = new NginxDeploymentWafPolicyCompilingStatusCode(property.Value.GetString()); + code = new NginxDeploymentWafPolicyCompilingStatusCode(prop.Value.GetString()); continue; } - if (property.NameEquals("displayStatus"u8)) + if (prop.NameEquals("displayStatus"u8)) { - displayStatus = property.Value.GetString(); + displayStatus = prop.Value.GetString(); continue; } - if (property.NameEquals("time"u8)) + if (prop.NameEquals("time"u8)) { - time = property.Value.GetString(); + time = 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 NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, serializedAdditionalRawData); + return new NginxDeploymentWafPolicyCompilingStatus(code, displayStatus, time, 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 +140,20 @@ BinaryData IPersistableModel.Write(Mode } } - NginxDeploymentWafPolicyCompilingStatus 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyCompilingStatus(document.RootElement, options); } default: @@ -150,6 +161,7 @@ NginxDeploymentWafPolicyCompilingStatus 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/NginxDeploymentWafPolicyCompilingStatus.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs index 60c9e2345275..4fb8b78f925b 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatus.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Nginx Deployment Waf Policy Compiling Status. public partial class NginxDeploymentWafPolicyCompilingStatus { - /// - /// 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 NginxDeploymentWafPolicyCompilingStatus() @@ -54,19 +25,21 @@ internal NginxDeploymentWafPolicyCompilingStatus() /// 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 serializedAdditionalRawData) + /// 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; - _serializedAdditionalRawData = serializedAdditionalRawData; + _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 index ce47d8b46f75..7fb67985598c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyCompilingStatusCode.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { @@ -14,44 +15,67 @@ namespace Azure.ResourceManager.Nginx.Models 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) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string NotStartedValue = "NotStarted"; - private const string InProgressValue = "InProgress"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; + _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 to a . + + /// 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 index a817976b35ca..201658da6633 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.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 NginxDeploymentWafPolicyListResponse : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy List Response. + internal partial class NginxDeploymentWafPolicyListResponse : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// 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(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter write /// 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(NginxDeploymentWafPolicyListResponse)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (NginxDeploymentWafPolicyMetadata item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); 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); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentWafPolicyListResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentWafPolicyListResponse)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, options); } - internal static NginxDeploymentWafPolicyListResponse DeserializeNginxDeploymentWafPolicyListResponse(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyListResponse DeserializeNginxDeploymentWafPolicyListResponse(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = 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("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + 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 NginxDeploymentWafPolicyListResponse(value, nextLink, serializedAdditionalRawData); + return new NginxDeploymentWafPolicyListResponse(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": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - NginxDeploymentWafPolicyListResponse 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement, options); } default: @@ -146,6 +163,14 @@ NginxDeploymentWafPolicyListResponse IPersistableModel 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 index 5002bc7cdafb..7b9bb755d722 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyListResponse.cs @@ -14,66 +14,30 @@ namespace Azure.ResourceManager.Nginx.Models /// Nginx Deployment Waf Policy List Response. internal partial class NginxDeploymentWafPolicyListResponse { - /// - /// 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 NginxDeploymentWafPolicyMetadata items on this page. - /// is null. internal NginxDeploymentWafPolicyListResponse(IEnumerable value) { - Argument.AssertNotNull(value, nameof(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(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxDeploymentWafPolicyListResponse(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal NginxDeploymentWafPolicyListResponse() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The NginxDeploymentWafPolicyMetadata items on this page. - public IReadOnlyList Value { get; } + 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 index 5e63b49c6af6..68d54045a963 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.Serialization.cs @@ -10,15 +10,16 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; -using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { - public partial class NginxDeploymentWafPolicyMetadata : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy Metadata. + public partial class NginxDeploymentWafPolicyMetadata : 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 +29,142 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// 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(NginxDeploymentWafPolicyMetadata)} 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(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 + } + } } - NginxDeploymentWafPolicyMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentWafPolicyMetadata)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyMetadata(document.RootElement, options); } - internal static NginxDeploymentWafPolicyMetadata DeserializeNginxDeploymentWafPolicyMetadata(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyMetadata DeserializeNginxDeploymentWafPolicyMetadata(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxDeploymentWafPolicyMetadataProperties properties = default; - ResourceIdentifier id = default; + string id = default; string name = default; - ResourceType type = default; + string @type = default; + NginxDeploymentWafPolicyMetadataProperties 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 = NginxDeploymentWafPolicyMetadataProperties.DeserializeNginxDeploymentWafPolicyMetadataProperties(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(); + @type = 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 = NginxDeploymentWafPolicyMetadataProperties.DeserializeNginxDeploymentWafPolicyMetadataProperties(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 NginxDeploymentWafPolicyMetadata( id, name, - type, - systemData, + @type, 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 +174,20 @@ BinaryData IPersistableModel.Write(ModelReader } } - NginxDeploymentWafPolicyMetadata 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyMetadata(document.RootElement, options); } default: @@ -150,6 +195,7 @@ NginxDeploymentWafPolicyMetadata 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/NginxDeploymentWafPolicyMetadata.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs index 100c4a908487..a6831071c405 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadata.cs @@ -7,45 +7,15 @@ using System; using System.Collections.Generic; -using Azure.Core; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Nginx.Models { /// Nginx Deployment Waf Policy Metadata. - public partial class NginxDeploymentWafPolicyMetadata : ResourceData + public partial class NginxDeploymentWafPolicyMetadata { - /// - /// 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 NginxDeploymentWafPolicyMetadata() @@ -53,19 +23,35 @@ internal NginxDeploymentWafPolicyMetadata() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// + /// + /// /// Nginx Deployment Waf Policy Metadata Properties. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentWafPolicyMetadata(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxDeploymentWafPolicyMetadataProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// 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; - _serializedAdditionalRawData = serializedAdditionalRawData; + 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 index eba9d693bb11..eea8fb15fe25 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.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 NginxDeploymentWafPolicyMetadataProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy Metadata Properties. + public partial class NginxDeploymentWafPolicyMetadataProperties : 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(NginxDeploymentWafPolicyMetadataProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); @@ -54,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("applyingState"u8); writer.WriteObjectValue(ApplyingState, 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,22 +71,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentWafPolicyMetadataProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentWafPolicyMetadataProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyMetadataProperties(document.RootElement, options); } - internal static NginxDeploymentWafPolicyMetadataProperties DeserializeNginxDeploymentWafPolicyMetadataProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyMetadataProperties DeserializeNginxDeploymentWafPolicyMetadataProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -95,55 +100,56 @@ internal static NginxDeploymentWafPolicyMetadataProperties DeserializeNginxDeplo NginxProvisioningState? provisioningState = default; NginxDeploymentWafPolicyCompilingStatus compilingState = default; NginxDeploymentWafPolicyApplyingStatus applyingState = 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("filepath"u8)) + if (prop.NameEquals("filepath"u8)) { - filepath = property.Value.GetString(); + filepath = prop.Value.GetString(); continue; } - 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("compilingState"u8)) + if (prop.NameEquals("compilingState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(property.Value, options); + compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(prop.Value, options); continue; } - if (property.NameEquals("applyingState"u8)) + if (prop.NameEquals("applyingState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(property.Value, options); + applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(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 NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, serializedAdditionalRawData); + return new NginxDeploymentWafPolicyMetadataProperties(filepath, provisioningState, compilingState, applyingState, 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": @@ -153,15 +159,20 @@ BinaryData IPersistableModel.Write(M } } - NginxDeploymentWafPolicyMetadataProperties 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyMetadataProperties(document.RootElement, options); } default: @@ -169,6 +180,7 @@ NginxDeploymentWafPolicyMetadataProperties 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/NginxDeploymentWafPolicyMetadataProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs index 2efbf5ce44f5..bb37f71dd5ad 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyMetadataProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Nginx Deployment Waf Policy Metadata Properties. public partial class NginxDeploymentWafPolicyMetadataProperties { - /// - /// 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 NginxDeploymentWafPolicyMetadataProperties() @@ -55,22 +26,25 @@ internal NginxDeploymentWafPolicyMetadataProperties() /// 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 serializedAdditionalRawData) + /// 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; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } - /// Gets the filepath. + /// 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 index 965d94cf10c0..ee4edb1079e9 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.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 NginxDeploymentWafPolicyProperties : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy Properties. + public partial class NginxDeploymentWafPolicyProperties : 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, /// 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(NginxDeploymentWafPolicyProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Content)) { writer.WritePropertyName("content"u8); - writer.WriteBase64StringValue(Content, "D"); + writer.WriteBase64StringValue(Content.ToArray(), "D"); } if (Optional.IsDefined(Filepath)) { @@ -59,15 +59,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("applyingState"u8); writer.WriteObjectValue(ApplyingState, 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); } @@ -76,95 +76,101 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NginxDeploymentWafPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// 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) { - 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(NginxDeploymentWafPolicyProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyProperties(document.RootElement, options); } - internal static NginxDeploymentWafPolicyProperties DeserializeNginxDeploymentWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyProperties DeserializeNginxDeploymentWafPolicyProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } NginxProvisioningState? provisioningState = default; - byte[] content = default; + BinaryData content = default; string filepath = default; NginxDeploymentWafPolicyCompilingStatus compilingState = default; NginxDeploymentWafPolicyApplyingStatus applyingState = 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("content"u8)) + if (prop.NameEquals("content"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - content = property.Value.GetBytesFromBase64("D"); + content = BinaryData.FromBytes(prop.Value.GetBytesFromBase64("D")); continue; } - if (property.NameEquals("filepath"u8)) + if (prop.NameEquals("filepath"u8)) { - filepath = property.Value.GetString(); + filepath = prop.Value.GetString(); continue; } - if (property.NameEquals("compilingState"u8)) + if (prop.NameEquals("compilingState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(property.Value, options); + compilingState = NginxDeploymentWafPolicyCompilingStatus.DeserializeNginxDeploymentWafPolicyCompilingStatus(prop.Value, options); continue; } - if (property.NameEquals("applyingState"u8)) + if (prop.NameEquals("applyingState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(property.Value, options); + applyingState = NginxDeploymentWafPolicyApplyingStatus.DeserializeNginxDeploymentWafPolicyApplyingStatus(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 NginxDeploymentWafPolicyProperties( provisioningState, content, filepath, compilingState, applyingState, - 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": @@ -174,15 +180,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - NginxDeploymentWafPolicyProperties 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyProperties(document.RootElement, options); } default: @@ -190,6 +201,7 @@ NginxDeploymentWafPolicyProperties 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/NginxDeploymentWafPolicyProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs index 8d37db6f137a..83fd56ca64ad 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxDeploymentWafPolicyProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// Nginx Deployment Waf Policy Properties. public partial class NginxDeploymentWafPolicyProperties { - /// - /// 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 NginxDeploymentWafPolicyProperties() @@ -56,25 +27,44 @@ public NginxDeploymentWafPolicyProperties() /// 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, byte[] content, string filepath, NginxDeploymentWafPolicyCompilingStatus compilingState, NginxDeploymentWafPolicyApplyingStatus applyingState, IDictionary serializedAdditionalRawData) + /// 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; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Provisioning State. public NginxProvisioningState? ProvisioningState { get; } - /// The byte content of the Policy. - public byte[] Content { get; set; } + + /// + /// 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 0094bfebaf39..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,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Nginx; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Nginx.Models @@ -14,37 +15,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 5b9f0a4bc6e6..ff6d8ffba281 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxLogging.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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() @@ -52,11 +23,11 @@ public NginxLogging() /// Initializes a new instance of . /// Nginx Storage Account. - /// Keeps track of any properties unknown to the library. - internal NginxLogging(NginxStorageAccount storageAccount, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal NginxLogging(NginxStorageAccount storageAccount, IDictionary additionalBinaryDataProperties) { StorageAccount = storageAccount; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Nginx Storage Account. 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 d3e2260e02e2..a3bfab42d7bd 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkInterfaceConfiguration.cs @@ -14,37 +14,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 9b6633bad86a..c1531f287068 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxNetworkProfile.cs @@ -14,37 +14,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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() @@ -54,26 +25,33 @@ public NginxNetworkProfile() /// Initializes a new instance of . /// Nginx Frontend IP Configuration. /// Nginx Network Interface Configuration. - /// Keeps track of any properties unknown to the library. - internal NginxNetworkProfile(NginxFrontendIPConfiguration frontEndIPConfiguration, NginxNetworkInterfaceConfiguration networkInterfaceConfiguration, IDictionary serializedAdditionalRawData) + /// 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; } /// Nginx Frontend IP Configuration. public NginxFrontendIPConfiguration FrontEndIPConfiguration { get; set; } + /// 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 86f286993e3d..dbdf51119bb0 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxPrivateIPAddress.cs @@ -15,37 +15,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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() @@ -56,20 +27,22 @@ public NginxPrivateIPAddress() /// /// 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; } + /// 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 bc3828313470..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,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 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 63822b0c29da..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,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.Nginx; namespace Azure.ResourceManager.Nginx.Models { @@ -14,14 +15,6 @@ namespace Azure.ResourceManager.Nginx.Models 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 457431157765..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 { /// 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 5f4e6b0440a5..618380187480 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/Models/NginxStorageAccount.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.Nginx.Models /// 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 7e48fb885ed5..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,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(WebApplicationFirewallStatus)} does not support writing '{format}' format."); } - if (Optional.IsDefined(WafRelease)) { writer.WritePropertyName("wafRelease"u8); @@ -59,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); } @@ -76,22 +76,27 @@ 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; @@ -101,70 +106,71 @@ internal static WebApplicationFirewallStatus DeserializeWebApplicationFirewallSt 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("wafRelease"u8)) + if (prop.NameEquals("wafRelease"u8)) { - wafRelease = property.Value.GetString(); + wafRelease = prop.Value.GetString(); continue; } - if (property.NameEquals("attackSignaturesPackage"u8)) + if (prop.NameEquals("attackSignaturesPackage"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + 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( wafRelease, attackSignaturesPackage, botSignaturesPackage, threatCampaignsPackage, componentVersions, - 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": @@ -174,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: @@ -190,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 e9f5c50b9cf2..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() @@ -56,25 +27,29 @@ internal WebApplicationFirewallStatus() /// 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(string wafRelease, 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 347a41d5d176..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 _nginxCertificateClientDiagnostics; - private readonly NginxCertificatesRestOperations _nginxCertificateRestClient; + 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) { - _nginxCertificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxCertificateResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(NginxCertificateResource.ResourceType, out string nginxCertificateApiVersion); - _nginxCertificateRestClient = new NginxCertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxCertificateApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _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 - /// NginxCertificate_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxCertificateRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.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 - /// NginxCertificate_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxCertificateRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.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 - /// NginxCertificate_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); scope.Start(); try { - var response = await _nginxCertificateRestClient.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 - /// NginxCertificate_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Get"); scope.Start(); try { - var response = _nginxCertificateRestClient.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 - /// NginxCertificate_List + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxCertificateRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxCertificateRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxCertificateResource(Client, NginxCertificateData.DeserializeNginxCertificateData(e)), _nginxCertificateClientDiagnostics, 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 - /// NginxCertificate_List + /// Operation Id. + /// NginxCertificates_List. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxCertificateRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxCertificateRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxCertificateResource(Client, NginxCertificateData.DeserializeNginxCertificateData(e)), _nginxCertificateClientDiagnostics, 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 - /// NginxCertificate_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); scope.Start(); try { - var response = await _nginxCertificateRestClient.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 - /// NginxCertificate_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.Exists"); scope.Start(); try { - var response = _nginxCertificateRestClient.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 - /// NginxCertificate_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxCertificateRestClient.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 - /// NginxCertificate_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateCollection.GetIfExists"); scope.Start(); try { - var response = _nginxCertificateRestClient.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 1e9a3797008f..139b5175fe1c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxCertificateData.cs @@ -13,43 +13,11 @@ namespace Azure.ResourceManager.Nginx { - /// - /// A class representing the NginxCertificate data model. - /// Nginx Certificate - /// + /// 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() @@ -57,22 +25,23 @@ public NginxCertificateData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The 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. - /// 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) + 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; } /// Nginx Certificate Properties. public NginxCertificateProperties Properties { get; set; } + /// 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 a446983e466c..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 _nginxCertificateClientDiagnostics; - private readonly NginxCertificatesRestOperations _nginxCertificateRestClient; + 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) { - _nginxCertificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string nginxCertificateApiVersion); - _nginxCertificateRestClient = new NginxCertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxCertificateApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _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 - /// NginxCertificate_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); scope.Start(); try { - var response = await _nginxCertificateRestClient.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 - /// NginxCertificate_Get + /// Operation Id. + /// NginxCertificates_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Get"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Get"); scope.Start(); try { - var response = _nginxCertificateRestClient.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 - /// NginxCertificate_Delete + /// Operation Id. + /// NginxCertificates_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); scope.Start(); try { - var response = await _nginxCertificateRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.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 - /// NginxCertificate_Delete + /// Operation Id. + /// NginxCertificates_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Delete"); scope.Start(); try { - var response = _nginxCertificateRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.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 - /// NginxCertificate_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Update"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); scope.Start(); try { - var response = await _nginxCertificateRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.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 - /// NginxCertificate_CreateOrUpdate + /// Operation Id. + /// NginxCertificates_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxCertificateClientDiagnostics.CreateScope("NginxCertificateResource.Update"); + using DiagnosticScope scope = _nginxCertificatesClientDiagnostics.CreateScope("NginxCertificateResource.Update"); scope.Start(); try { - var response = _nginxCertificateRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new NginxArmOperation(new NginxCertificateOperationSource(Client), _nginxCertificateClientDiagnostics, Pipeline, _nginxCertificateRestClient.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 acec49f38359..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 _nginxConfigurationNginxConfigurationResponsesClientDiagnostics; - private readonly NginxConfigurationResponsesRestOperations _nginxConfigurationNginxConfigurationResponsesRestClient; + 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) { - _nginxConfigurationNginxConfigurationResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxConfigurationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxConfigurationResource.ResourceType, out string nginxConfigurationNginxConfigurationResponsesApiVersion); - _nginxConfigurationNginxConfigurationResponsesRestClient = new NginxConfigurationResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxConfigurationNginxConfigurationResponsesApiVersion); -#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 - /// NginxConfigurationResponse_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationName, content, cancellationToken); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Get"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_List + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxConfigurationResource(Client, NginxConfigurationData.DeserializeNginxConfigurationData(e)), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, 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 - /// NginxConfigurationResponse_List + /// Operation Id. + /// NginxConfigurationResponses_List. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxConfigurationNginxConfigurationResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxConfigurationResource(Client, NginxConfigurationData.DeserializeNginxConfigurationData(e)), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, 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 - /// NginxConfigurationResponse_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.Exists"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationCollection.GetIfExists"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.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 13f6c8e741c9..64d60b799fcf 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxConfigurationData.cs @@ -13,63 +13,31 @@ namespace Azure.ResourceManager.Nginx { - /// - /// A class representing the NginxConfiguration data model. - /// Nginx Configuration Response - /// + /// 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. + /// 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. - /// 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) + 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; } /// Nginx Configuration Response Properties. - public NginxConfigurationProperties Properties { get; } + 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 a8811b756e01..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 _nginxConfigurationNginxConfigurationResponsesClientDiagnostics; - private readonly NginxConfigurationResponsesRestOperations _nginxConfigurationNginxConfigurationResponsesRestClient; + 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) { - _nginxConfigurationNginxConfigurationResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string nginxConfigurationNginxConfigurationResponsesApiVersion); - _nginxConfigurationNginxConfigurationResponsesRestClient = new NginxConfigurationResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxConfigurationNginxConfigurationResponsesApiVersion); -#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 - /// NginxConfigurationResponse_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Get + /// Operation Id. + /// NginxConfigurationResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Get"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Delete + /// Operation Id. + /// NginxConfigurationResponses_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_Delete + /// Operation Id. + /// NginxConfigurationResponses_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Delete"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_Analysis. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponse_CreateOrUpdate + /// Operation Id. + /// NginxConfigurationResponses_Analysis. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new NginxArmOperation(new NginxConfigurationOperationSource(Client), _nginxConfigurationNginxConfigurationResponsesClientDiagnostics, Pipeline, _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponses_Analysis + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); scope.Start(); try { - var response = await _nginxConfigurationNginxConfigurationResponsesRestClient.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 - /// NginxConfigurationResponses_Analysis + /// Operation Id. + /// NginxConfigurationResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxConfigurationNginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Analysis"); + using DiagnosticScope scope = _nginxConfigurationResponsesClientDiagnostics.CreateScope("NginxConfigurationResource.Update"); scope.Start(); try { - var response = _nginxConfigurationNginxConfigurationResponsesRestClient.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 edaf647c2a52..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 _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics; - private readonly NginxDeploymentApiKeyResponsesRestOperations _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient; + 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) { - _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentApiKeyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxDeploymentApiKeyResource.ResourceType, out string nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); - _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient = new NginxDeploymentApiKeyResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); -#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 - /// NginxDeploymentApiKeyResponse_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content, cancellationToken).ConfigureAwait(false); - var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, apiKeyName, content, cancellationToken); - var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_List + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentApiKeyResource(Client, NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(e)), _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics, 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 - /// NginxDeploymentApiKeyResponse_List + /// Operation Id. + /// NginxDeploymentApiKeyResponses_List. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentApiKeyResource(Client, NginxDeploymentApiKeyData.DeserializeNginxDeploymentApiKeyData(e)), _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics, 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 - /// NginxDeploymentApiKeyResponse_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 5ab6f813243b..109d8b4cae81 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentApiKeyData.cs @@ -13,43 +13,11 @@ namespace Azure.ResourceManager.Nginx { - /// - /// A class representing the NginxDeploymentApiKey data model. - /// Nginx Deployment Api Key Response - /// + /// 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() @@ -57,16 +25,16 @@ internal NginxDeploymentApiKeyData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The 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. - /// 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) + 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; } /// Nginx Deployment Api Key Response Properties. 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 9fddcd23d5d1..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 _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics; - private readonly NginxDeploymentApiKeyResponsesRestOperations _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient; + 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) { - _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); - _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient = new NginxDeploymentApiKeyResponsesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesApiVersion); -#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 - /// NginxDeploymentApiKeyResponse_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Get + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Get"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Delete + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_Delete + /// Operation Id. + /// NginxDeploymentApiKeyResponses_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Delete"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); scope.Start(); try { - var response = await _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 - /// NginxDeploymentApiKeyResponse_CreateOrUpdate + /// Operation Id. + /// NginxDeploymentApiKeyResponses_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); + using DiagnosticScope scope = _nginxDeploymentApiKeyResponsesClientDiagnostics.CreateScope("NginxDeploymentApiKeyResource.Update"); scope.Start(); try { - var response = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var uri = _nginxDeploymentApiKeyNginxDeploymentApiKeyResponsesRestClient.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 aecca902f7a7..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,51 +26,49 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _nginxDeploymentClientDiagnostics; - private readonly NginxDeploymentsRestOperations _nginxDeploymentRestClient; + 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) { - _nginxDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(NginxDeploymentResource.ResourceType, out string nginxDeploymentApiVersion); - _nginxDeploymentRestClient = new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _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 - /// NginxDeployment_CreateOrUpdate + /// Operation Id. + /// NginxDeployments_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -77,21 +76,33 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The name of targeted NGINX deployment. /// 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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.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,20 +116,16 @@ 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 - /// NginxDeployment_CreateOrUpdate + /// Operation Id. + /// NginxDeployments_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -126,21 +133,33 @@ public virtual async Task> CreateOrUpdateA /// The name of targeted NGINX deployment. /// 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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, deploymentName, data, cancellationToken); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.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 - /// NginxDeployment_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.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 - /// NginxDeployment_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentRestClient.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 - /// NginxDeployment_ListByResourceGroup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxDeploymentRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), _nginxDeploymentClientDiagnostics, 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 - /// NginxDeployment_ListByResourceGroup + /// Operation Id. + /// NginxDeployments_ListByResourceGroup. /// /// - /// Default Api Version - /// 2025-03-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) => _nginxDeploymentRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NginxDeploymentResource(Client, NginxDeploymentData.DeserializeNginxDeploymentData(e)), _nginxDeploymentClientDiagnostics, 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 - /// NginxDeployment_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.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 - /// NginxDeployment_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentRestClient.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 - /// NginxDeployment_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.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 - /// NginxDeployment_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentRestClient.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 5cdbef2ebf87..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,12 +38,11 @@ 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(Properties)) { @@ -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; } - NginxDeploymentProperties properties = default; - ManagedServiceIdentity identity = 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("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = NginxDeploymentProperties.DeserializeNginxDeploymentProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("type"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); + 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)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("properties"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"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, properties, identity, - sku, - serializedAdditionalRawData); + 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 71d7a7f7f5ec..8fb46b3bbf81 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentData.cs @@ -13,85 +13,57 @@ namespace Azure.ResourceManager.Nginx { - /// - /// A class representing the NginxDeployment data model. - /// Nginx Deployment - /// + /// 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. + /// 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. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NginxDeploymentProperties properties, ManagedServiceIdentity identity, NginxResourceSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + 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) { + _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; } + /// Identity Properties. public ManagedServiceIdentity Identity { get; set; } + /// 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 b7f79575e03e..1b9b7d95e3bc 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentResource.cs @@ -7,50 +7,37 @@ using System; 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; 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 _nginxDeploymentClientDiagnostics; - private readonly NginxDeploymentsRestOperations _nginxDeploymentRestClient; - private readonly ClientDiagnostics _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics; - private readonly NginxDeploymentsRestOperations _nginxDeploymentWafPolicyNginxDeploymentsRestClient; + 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) @@ -59,350 +46,92 @@ 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) { - _nginxDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string nginxDeploymentApiVersion); - _nginxDeploymentRestClient = new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentApiVersion); - _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentWafPolicyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(NginxDeploymentWafPolicyResource.ResourceType, out string nginxDeploymentWafPolicyNginxDeploymentsApiVersion); - _nginxDeploymentWafPolicyNginxDeploymentsRestClient = new NginxDeploymentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentWafPolicyNginxDeploymentsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _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 - /// NginxDeploymentApiKeyResponse_Get - /// - /// - /// Default Api Version - /// 2025-03-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 - /// NginxDeploymentApiKeyResponse_Get - /// - /// - /// Default Api Version - /// 2025-03-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 - /// NginxCertificate_Get - /// - /// - /// Default Api Version - /// 2025-03-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 - /// NginxCertificate_Get - /// - /// - /// Default Api Version - /// 2025-03-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) - { - return GetNginxCertificates().Get(certificateName, cancellationToken); - } - - /// Gets a collection of NginxConfigurationResources in the NginxDeployment. - /// An object representing collection of NginxConfigurationResources 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 - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} - /// - /// - /// Operation Id - /// NginxConfigurationResponse_Get - /// - /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// 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) - { - return await GetNginxConfigurations().GetAsync(configurationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get the NGINX configuration of given NGINX deployment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName} - /// - /// - /// Operation Id - /// NginxConfigurationResponse_Get - /// - /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// 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) - { - return GetNginxConfigurations().Get(configurationName, cancellationToken); - } - - /// Gets a collection of NginxDeploymentWafPolicyResources in the NginxDeployment. - /// An object representing collection of NginxDeploymentWafPolicyResources 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 - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} - /// - /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get - /// - /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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) + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName) { - return await GetNginxDeploymentWafPolicies().GetAsync(wafPolicyName, cancellationToken).ConfigureAwait(false); + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); } - /// - /// Get the Nginx Waf Policy of given Nginx deployment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} - /// - /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get - /// - /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// 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) + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) { - return GetNginxDeploymentWafPolicies().Get(wafPolicyName, cancellationToken); + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// 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 - /// NginxDeployment_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -416,33 +145,41 @@ public virtual async Task> GetAsync(Cancellati /// 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 - /// NginxDeployment_Get + /// Operation Id. + /// NginxDeployments_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Get"); scope.Start(); try { - var response = _nginxDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new NginxDeploymentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -453,38 +190,52 @@ public virtual Response Get(CancellationToken cancellat } /// - /// Delete the NGINX deployment resource + /// 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 - /// NginxDeployment_Delete + /// Operation Id. + /// NginxDeployments_Update. /// /// - /// Default Api Version - /// 2025-03-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 DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentPatch patch = default, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + 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.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -495,38 +246,52 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Delete the NGINX deployment resource + /// 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 - /// NginxDeployment_Delete + /// Operation Id. + /// NginxDeployments_Update. /// /// - /// Default Api Version - /// 2025-03-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 ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentPatch patch = default, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); scope.Start(); try { - var response = _nginxDeploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + 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.WaitForCompletionResponse(cancellationToken); + { + operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -537,42 +302,45 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Update the NGINX deployment + /// 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 - /// NginxDeployment_Update + /// Operation Id. + /// NginxDeployments_Delete. /// /// - /// Default Api Version - /// 2025-03-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. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); scope.Start(); try { - var response = await _nginxDeploymentRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -583,42 +351,45 @@ public virtual async Task> UpdateAsync(Wai } /// - /// Update the NGINX deployment + /// 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 - /// NginxDeployment_Update + /// Operation Id. + /// NginxDeployments_Delete. /// /// - /// Default Api Version - /// 2025-03-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. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _nginxDeploymentClientDiagnostics.CreateScope("NginxDeploymentResource.Update"); + using DiagnosticScope scope = _nginxDeploymentsClientDiagnostics.CreateScope("NginxDeploymentResource.Delete"); scope.Start(); try { - var response = _nginxDeploymentRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new NginxArmOperation(new NginxDeploymentOperationSource(Client), _nginxDeploymentClientDiagnostics, Pipeline, _nginxDeploymentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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.WaitForCompletion(cancellationToken); + { + operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -632,50 +403,52 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// List Waf Policies of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies. /// /// - /// Operation Id - /// NginxDeployments_GetWafPolicies + /// Operation Id. + /// NginxDeployments_WafPolicyList. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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 GetWafPoliciesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(e), _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics, Pipeline, "NginxDeploymentResource.GetWafPolicies", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new NginxDeploymentsGetWafPoliciesAsyncCollectionResultOfT(_nginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// /// List Waf Policies of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies. /// /// - /// Operation Id - /// NginxDeployments_GetWafPolicies + /// Operation Id. + /// NginxDeployments_WafPolicyList. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -683,90 +456,110 @@ public virtual AsyncPageable GetWafPoliciesAsy /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetWafPolicies(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nginxDeploymentWafPolicyNginxDeploymentsRestClient.CreateGetWafPoliciesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NginxDeploymentWafPolicyMetadata.DeserializeNginxDeploymentWafPolicyMetadata(e), _nginxDeploymentWafPolicyNginxDeploymentsClientDiagnostics, Pipeline, "NginxDeploymentResource.GetWafPolicies", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new NginxDeploymentsGetWafPoliciesCollectionResultOfT(_nginxDeploymentsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// /// Get the Nginx Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies. /// /// - /// Operation Id - /// NginxDeployments_GetDefaultWafPolicies + /// Operation Id. + /// NginxDeployments_DefaultWafPolicyList. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDefaultWafPoliciesAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetDefaultWafPoliciesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentRestClient.CreateGetDefaultWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(e), _nginxDeploymentClientDiagnostics, Pipeline, "NginxDeploymentResource.GetDefaultWafPolicies", "value", null, cancellationToken); + 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 = 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) + { + scope.Failed(e); + throw; + } } /// /// Get the Nginx Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies. /// /// - /// Operation Id - /// NginxDeployments_GetDefaultWafPolicies + /// Operation Id. + /// NginxDeployments_DefaultWafPolicyList. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDefaultWafPolicies(CancellationToken cancellationToken = default) + public virtual Response GetDefaultWafPolicies(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nginxDeploymentRestClient.CreateGetDefaultWafPoliciesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => NginxDeploymentDefaultWafPolicyProperties.DeserializeNginxDeploymentDefaultWafPolicyProperties(e), _nginxDeploymentClientDiagnostics, Pipeline, "NginxDeploymentResource.GetDefaultWafPolicies", "value", null, cancellationToken); + 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. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName} - /// - /// - /// Operation Id - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-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. @@ -776,28 +569,34 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _nginxDeploymentClientDiagnostics.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 _nginxDeploymentRestClient.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()); } } @@ -808,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-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. @@ -838,28 +617,34 @@ public virtual Response AddTag(string key, string value Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _nginxDeploymentClientDiagnostics.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 = _nginxDeploymentRestClient.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()); } } @@ -870,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.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 _nginxDeploymentRestClient.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()); } } @@ -927,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentClientDiagnostics.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 = _nginxDeploymentRestClient.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()); } } @@ -984,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -1012,28 +749,34 @@ public virtual async Task> RemoveTagAsync(stri { Argument.AssertNotNull(key, nameof(key)); - using var scope = _nginxDeploymentClientDiagnostics.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 _nginxDeploymentRestClient.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()); } } @@ -1044,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 - /// NginxDeployment_Get - /// - /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -1072,28 +795,34 @@ public virtual Response RemoveTag(string key, Cancellat { Argument.AssertNotNull(key, nameof(key)); - using var scope = _nginxDeploymentClientDiagnostics.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 = _nginxDeploymentRestClient.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()); } } @@ -1103,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 index d7b057c147a3..ef1de4e98111 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyCollection.cs @@ -6,11 +6,13 @@ #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 { @@ -21,51 +23,49 @@ namespace Azure.ResourceManager.Nginx /// public partial class NginxDeploymentWafPolicyCollection : ArmCollection { - private readonly ClientDiagnostics _nginxDeploymentWafPolicyClientDiagnostics; - private readonly NginxDeploymentWafPoliciesRestOperations _nginxDeploymentWafPolicyRestClient; + private readonly ClientDiagnostics _nginxDeploymentWafPoliciesClientDiagnostics; + private readonly NginxDeploymentWafPolicies _nginxDeploymentWafPoliciesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of NginxDeploymentWafPolicyCollection for mocking. protected NginxDeploymentWafPolicyCollection() { } - /// 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 NginxDeploymentWafPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxDeploymentWafPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", NginxDeploymentWafPolicyResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(NginxDeploymentWafPolicyResource.ResourceType, out string nginxDeploymentWafPolicyApiVersion); - _nginxDeploymentWafPolicyRestClient = new NginxDeploymentWafPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentWafPolicyApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _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(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 Waf Policy for given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} - /// - /// - /// Operation Id - /// NginxDeploymentWafPolicy_Create + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -73,21 +73,33 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// 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. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string wafPolicyName, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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) @@ -101,20 +113,16 @@ public virtual async Task> Create /// 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 - /// NginxDeploymentWafPolicy_Create + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// @@ -122,21 +130,33 @@ public virtual async Task> Create /// 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. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string wafPolicyName, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.CreateOrUpdate"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data, cancellationToken); - var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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) @@ -150,38 +170,42 @@ public virtual ArmOperation CreateOrUpdate(Wai /// Get the Nginx Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of Waf Policy. /// 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 wafPolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken).ConfigureAwait(false); + 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) @@ -195,38 +219,42 @@ public virtual async Task> GetAsync(s /// Get the Nginx Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of Waf Policy. /// 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 wafPolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Get"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken); + 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) @@ -240,36 +268,50 @@ public virtual Response Get(string wafPolicyNa /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of Waf Policy. /// 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 wafPolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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) @@ -283,36 +325,50 @@ public virtual async Task> ExistsAsync(string wafPolicyName, Canc /// Checks to see if the resource exists in azure. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of Waf Policy. /// 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 wafPolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.Exists"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken); + 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) @@ -326,38 +382,54 @@ public virtual Response Exists(string wafPolicyName, CancellationToken can /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of Waf Policy. /// 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 wafPolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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) @@ -371,38 +443,54 @@ public virtual async Task> Ge /// Tries to get details for this resource from the service. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-01-preview - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-01-preview. /// /// /// /// The name of Waf Policy. /// 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 wafPolicyName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyCollection.GetIfExists"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, wafPolicyName, cancellationToken: cancellationToken); + 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) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs index aadcaa53213e..31720f439d36 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.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 NginxDeploymentWafPolicyData : IUtf8JsonSerializable, IJsonModel + /// Nginx Deployment Waf Policy. + public partial class NginxDeploymentWafPolicyData : 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, Model /// 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(NginxDeploymentWafPolicyData)} 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 } } - NginxDeploymentWafPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions 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) { - 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(NginxDeploymentWafPolicyData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeNginxDeploymentWafPolicyData(document.RootElement, options); } - internal static NginxDeploymentWafPolicyData DeserializeNginxDeploymentWafPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static NginxDeploymentWafPolicyData DeserializeNginxDeploymentWafPolicyData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - NginxDeploymentWafPolicyProperties 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(); + NginxDeploymentWafPolicyProperties 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 = NginxDeploymentWafPolicyProperties.DeserializeNginxDeploymentWafPolicyProperties(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 = NginxDeploymentWafPolicyProperties.DeserializeNginxDeploymentWafPolicyProperties(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 NginxDeploymentWafPolicyData( 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(ModelReaderWrit } } - NginxDeploymentWafPolicyData 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. + 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)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeNginxDeploymentWafPolicyData(document.RootElement, options); } default: @@ -151,6 +171,26 @@ NginxDeploymentWafPolicyData IPersistableModel.Cre } } + /// 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 index bb96f34346db..0ad28bfa11aa 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyData.cs @@ -13,43 +13,11 @@ namespace Azure.ResourceManager.Nginx { - /// - /// A class representing the NginxDeploymentWafPolicy data model. - /// Nginx Deployment Waf Policy - /// + /// Nginx Deployment Waf Policy. public partial class NginxDeploymentWafPolicyData : 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 NginxDeploymentWafPolicyData() @@ -57,16 +25,16 @@ public NginxDeploymentWafPolicyData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The 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 Waf Policy Properties. - /// Keeps track of any properties unknown to the library. - internal NginxDeploymentWafPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NginxDeploymentWafPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NginxDeploymentWafPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, NginxDeploymentWafPolicyProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } /// Nginx Deployment Waf Policy Properties. diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs index 0240855d5c0a..8149623ae42d 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.Nginx { + /// public partial class NginxDeploymentWafPolicyResource : IJsonModel { - private static NginxDeploymentWafPolicyData s_dataDeserializationInstance; - private static NginxDeploymentWafPolicyData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + 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); - NginxDeploymentWafPolicyData 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. + 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); - 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/NginxDeploymentWafPolicyResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs index b0ccdee57d1b..1c5d478250af 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/NginxDeploymentWafPolicyResource.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 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 GetNginxDeploymentWafPolicyResource method. - /// Otherwise you can get one from its parent resource using the GetNginxDeploymentWafPolicy method. + /// 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 { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The deploymentName. - /// The wafPolicyName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _nginxDeploymentWafPolicyClientDiagnostics; - private readonly NginxDeploymentWafPoliciesRestOperations _nginxDeploymentWafPolicyRestClient; + 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 the class for mocking. + /// Initializes a new instance of NginxDeploymentWafPolicyResource for mocking. protected NginxDeploymentWafPolicyResource() { } - /// 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 NginxDeploymentWafPolicyResource(ArmClient client, NginxDeploymentWafPolicyData data) : this(client, data.Id) @@ -54,71 +43,93 @@ internal NginxDeploymentWafPolicyResource(ArmClient client, NginxDeploymentWafPo _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 NginxDeploymentWafPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _nginxDeploymentWafPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Nginx", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string nginxDeploymentWafPolicyApiVersion); - _nginxDeploymentWafPolicyRestClient = new NginxDeploymentWafPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, nginxDeploymentWafPolicyApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _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. - /// Throws if there is no data loaded in the current instance. 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(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 Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + 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) @@ -132,33 +143,41 @@ public virtual async Task> GetAsync(C /// Get the Nginx Waf Policy of given Nginx deployment /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Get + /// Operation Id. + /// NginxDeploymentWafPolicies_Get. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Get"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + 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) @@ -172,20 +191,20 @@ public virtual Response Get(CancellationToken /// Reset the Nginx Waf Policy of given Nginx deployment to default /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Delete + /// Operation Id. + /// NginxDeploymentWafPolicies_Delete. /// /// - /// Default Api Version - /// 2025-03-01-preview + /// Default Api Version. + /// 2025-03-01-preview. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -193,14 +212,21 @@ public virtual Response Get(CancellationToken /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(_nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + 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) @@ -214,20 +240,20 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// Reset the Nginx Waf Policy of given Nginx deployment to default /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Delete + /// Operation Id. + /// NginxDeploymentWafPolicies_Delete. /// /// - /// Default Api Version - /// 2025-03-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 = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Delete"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new NginxArmOperation(_nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + 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) @@ -253,42 +286,52 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Create or update the Nginx Waf Policy for given Nginx deployment + /// Update a NginxDeploymentWafPolicy. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Create + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. /// /// - /// Default Api Version - /// 2025-03-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 Waf Policy. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); scope.Start(); try { - var response = await _nginxDeploymentWafPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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) @@ -299,42 +342,52 @@ public virtual async Task> Update } /// - /// Create or update the Nginx Waf Policy for given Nginx deployment + /// Update a NginxDeploymentWafPolicy. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}. /// /// - /// Operation Id - /// NginxDeploymentWafPolicy_Create + /// Operation Id. + /// NginxDeploymentWafPolicies_Create. /// /// - /// Default Api Version - /// 2025-03-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 Waf Policy. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, NginxDeploymentWafPolicyData data = default, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _nginxDeploymentWafPolicyClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); + using DiagnosticScope scope = _nginxDeploymentWafPoliciesClientDiagnostics.CreateScope("NginxDeploymentWafPolicyResource.Update"); scope.Start(); try { - var response = _nginxDeploymentWafPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new NginxArmOperation(new NginxDeploymentWafPolicyOperationSource(Client), _nginxDeploymentWafPolicyClientDiagnostics, Pipeline, _nginxDeploymentWafPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + 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) 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/NginxCertificatesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs index 72fcb2f7f5e5..8d0a25a11a2f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxCertificatesRestOperations.cs @@ -6,146 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - internal partial class NginxCertificatesRestOperations + internal partial class NginxCertificates { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of NginxCertificatesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public NginxCertificatesRestOperations(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 ?? "2025-03-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName) + /// Initializes a new instance of NginxCertificates for mocking. + protected NginxCertificates() { - 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) + /// 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) { - 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; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// 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)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - 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); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - /// 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) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string certificateName, RequestContext context) { - 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(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -153,18 +54,20 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath("/certificates/", false); uri.AppendPath(certificateName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + 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(string subscriptionId, string resourceGroupName, string deploymentName, string certificateName, NginxCertificateData data) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string certificateName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -172,99 +75,25 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r 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.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) + request.Method = RequestMethod.Put; + if ("application/json" != null) { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); + request.Headers.SetValue("Content-Type", "application/json"); } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - 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) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string certificateName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -272,241 +101,43 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG 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; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; 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 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) + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - 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 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(); + RawRequestUriBuilder 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(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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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) + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - 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); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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/NginxConfigurationResponsesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs index 612dc854892b..8a2a72d75087 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxConfigurationResponsesRestOperations.cs @@ -6,61 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - internal partial class NginxConfigurationResponsesRestOperations + internal partial class NginxConfigurationResponses { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of NginxConfigurationResponsesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public NginxConfigurationResponsesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of NginxConfigurationResponses for mocking. + protected NginxConfigurationResponses() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + /// 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) { - 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; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName) + /// 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) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -68,103 +54,20 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou 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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContent content, RequestContext context) { - 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(); + RawRequestUriBuilder 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -172,99 +75,25 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r 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.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) + request.Method = RequestMethod.Put; + if ("application/json" != null) { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); + request.Headers.SetValue("Content-Type", "application/json"); } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - 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) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -272,185 +101,51 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG 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; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; 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 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 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("/configurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string deploymentName) + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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) + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - 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 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; + 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(string subscriptionId, string resourceGroupName, string deploymentName, string configurationName, NginxAnalysisContent content) + internal HttpMessage CreateAnalysisRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string configurationName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -459,165 +154,17 @@ internal HttpMessage CreateAnalysisRequest(string subscriptionId, string resourc 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.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) + request.Method = RequestMethod.Post; + if ("application/json" != null) { - 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); + request.Headers.SetValue("Content-Type", "application/json"); } - } - - 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); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; 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/NginxDeploymentApiKeyResponsesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs index 5a51ae60e44f..7135556242ff 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentApiKeyResponsesRestOperations.cs @@ -6,146 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - internal partial class NginxDeploymentApiKeyResponsesRestOperations + internal partial class NginxDeploymentApiKeyResponses { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of NginxDeploymentApiKeyResponsesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public NginxDeploymentApiKeyResponsesRestOperations(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 ?? "2025-03-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName) + /// Initializes a new instance of NginxDeploymentApiKeyResponses for mocking. + protected NginxDeploymentApiKeyResponses() { - 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) + /// 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) { - 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); - } + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// 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)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - 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); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -153,18 +54,20 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath("/apiKeys/", false); uri.AppendPath(apiKeyName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + 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(string subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, NginxDeploymentApiKeyCreateOrUpdateContent content) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -172,109 +75,25 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r 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.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) + request.Method = RequestMethod.Put; + if ("application/json" != null) { - 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); + request.Headers.SetValue("Content-Type", "application/json"); } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - 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) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string apiKeyName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -282,241 +101,43 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG 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; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; 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) + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - 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 CreateListRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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(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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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) + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - 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); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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/NginxDeploymentWafPoliciesRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs index 3f4aba5ceb9b..f99db7716444 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentWafPoliciesRestOperations.cs @@ -6,145 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; namespace Azure.ResourceManager.Nginx { - internal partial class NginxDeploymentWafPoliciesRestOperations + internal partial class NginxDeploymentWafPolicies { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of NginxDeploymentWafPoliciesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public NginxDeploymentWafPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of NginxDeploymentWafPolicies for mocking. + protected NginxDeploymentWafPolicies() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) - { - 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("/wafPolicies/", false); - uri.AppendPath(wafPolicyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) - { - 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("/wafPolicies/", false); - uri.AppendPath(wafPolicyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the Nginx Waf Policy 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 Waf Policy. - /// 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 wafPolicyName, CancellationToken cancellationToken = default) + /// 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) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentWafPolicyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentWafPolicyData.DeserializeNginxDeploymentWafPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxDeploymentWafPolicyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// Get the Nginx Waf Policy 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 Waf Policy. - /// 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 wafPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - using var message = CreateGetRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentWafPolicyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentWafPolicyData.DeserializeNginxDeploymentWafPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((NginxDeploymentWafPolicyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData data) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -152,18 +54,20 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath("/wafPolicies/", false); uri.AppendPath(wafPolicyName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + 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(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -171,99 +75,25 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG 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.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 Waf Policy 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 Waf Policy. - /// The Nginx Deployment Waf Policy. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName, 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 Waf Policy 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 Waf Policy. - /// The Nginx Deployment Waf Policy. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, NginxDeploymentWafPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) + request.Method = RequestMethod.Put; + if ("application/json" != null) { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); + request.Headers.SetValue("Content-Type", "application/json"); } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) - { - 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("/wafPolicies/", false); - uri.AppendPath(wafPolicyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, string wafPolicyName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Nginx.NginxPlus/nginxDeployments/", false); @@ -271,63 +101,11 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG 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; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; return message; } - - /// Reset the Nginx Waf Policy 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 Waf Policy. - /// 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 wafPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Reset the Nginx Waf Policy 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 Waf Policy. - /// 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 wafPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); - Argument.AssertNotNullOrEmpty(wafPolicyName, nameof(wafPolicyName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, deploymentName, wafPolicyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs index 24b1566d58da..7d7f3754b592 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Generated/RestOperations/NginxDeploymentsRestOperations.cs @@ -6,989 +6,234 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Nginx.Models; namespace Azure.ResourceManager.Nginx { - internal partial class NginxDeploymentsRestOperations + internal partial class NginxDeployments { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of NginxDeploymentsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// Service host. - /// The API version to use for this operation. - /// or is null. - public NginxDeploymentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of NginxDeployments for mocking. + protected NginxDeployments() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-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) + /// 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) { - 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); - } + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// 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)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - 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); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentData data) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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); - return uri; + 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(string subscriptionId, string resourceGroupName, string deploymentName, NginxDeploymentData data) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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.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 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 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 Nginx deployment. - /// 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) + request.Method = RequestMethod.Put; + if ("application/json" != null) { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); + request.Headers.SetValue("Content-Type", "application/json"); } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - 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) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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.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 Nginx deployment update parameters. - /// 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 202: - 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 Nginx deployment update parameters. - /// 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) + request.Method = RequestMethod.Patch; + if ("application/json" != null) { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); + request.Headers.SetValue("Content-Type", "application/json"); } + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; + return message; } - 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) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; 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 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 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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(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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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) + internal HttpMessage CreateNextGetByResourceGroupRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, RequestContext context) { - 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 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; + 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 CreateListRequest(string subscriptionId) + internal HttpMessage CreateGetAllRequest(Guid subscriptionId, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); 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) + internal HttpMessage CreateNextGetAllRequest(Uri nextPage, Guid subscriptionId, RequestContext context) { - 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 CreateGetWafPoliciesRequestUri(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("/wafPolicies", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + 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(string subscriptionId, string resourceGroupName, string deploymentName) + internal HttpMessage CreateGetWafPoliciesRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// List Waf Policies 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> GetWafPoliciesAsync(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 = CreateGetWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentWafPolicyListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Waf Policies 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 GetWafPolicies(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 = CreateGetWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentWafPolicyListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetDefaultWafPoliciesRequestUri(string subscriptionId, string resourceGroupName, string deploymentName) + internal HttpMessage CreateNextGetWafPoliciesRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - 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("/listDefaultWafPolicies", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + 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(string subscriptionId, string resourceGroupName, string deploymentName) + internal HttpMessage CreateGetDefaultWafPoliciesRequest(Guid subscriptionId, string resourceGroupName, string deploymentName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + 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.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get the Nginx Waf Policy 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> GetDefaultWafPoliciesAsync(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 = CreateGetDefaultWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentDefaultWafPolicyListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentDefaultWafPolicyListResponse.DeserializeNginxDeploymentDefaultWafPolicyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get the Nginx Waf Policy 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 GetDefaultWafPolicies(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 = CreateGetDefaultWafPoliciesRequest(subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentDefaultWafPolicyListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentDefaultWafPolicyListResponse.DeserializeNginxDeploymentDefaultWafPolicyListResponse(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); - } - } - - 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 CreateGetWafPoliciesNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string deploymentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateGetWafPoliciesNextPageRequest(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); + request.Method = RequestMethod.Post; + request.Headers.SetValue("Accept", "application/json"); return message; } - - /// List Waf Policies 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> GetWafPoliciesNextPageAsync(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 = CreateGetWafPoliciesNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentWafPolicyListResponse value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List Waf Policies 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 GetWafPoliciesNextPage(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 = CreateGetWafPoliciesNextPageRequest(nextLink, subscriptionId, resourceGroupName, deploymentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - NginxDeploymentWafPolicyListResponse value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NginxDeploymentWafPolicyListResponse.DeserializeNginxDeploymentWafPolicyListResponse(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } 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..68addecbd4e4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs @@ -137,7 +137,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..f26b5b119243 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs @@ -138,7 +138,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 +158,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..ac19ce608463 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs @@ -119,7 +119,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 ed816471db49..21eeab4ae11f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs @@ -77,7 +77,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 +205,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 +219,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 +242,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; diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml index 697dbc1623cb..dd41ed1416c1 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/nginx/Nginx.Management -commit: fe754a15d8559fac5c475f0ccf688f1647b09fab +commit: dcabb1a78c6b55eb4d1ce6e4f8d4eac5dc42c7c8 repo: Azure/azure-rest-api-specs -additionalDirectories: +emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json" From 1319e9fef31ab8d006c7b5daa60c010bfea3d66d Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 11:36:23 +0800 Subject: [PATCH 06/12] update --- .../Sample_NginxCertificateCollection.cs | 196 ++++++++++++ .../Sample_NginxCertificateResource.cs | 109 +++++++ .../Sample_NginxConfigurationCollection.cs | 197 ++++++++++++ .../Sample_NginxConfigurationResource.cs | 137 ++++++++ .../Sample_NginxDeploymentApiKeyCollection.cs | 197 ++++++++++++ .../Sample_NginxDeploymentApiKeyResource.cs | 110 +++++++ .../Sample_NginxDeploymentCollection.cs | 295 ++++++++++++++++++ .../Samples/Sample_NginxDeploymentResource.cs | 169 ++++++++++ .../Sample_SubscriptionResourceExtensions.cs | 50 +++ .../tsp-location.yaml | 2 +- 10 files changed, 1461 insertions(+), 1 deletion(-) create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs create mode 100644 sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs new file mode 100644 index 000000000000..1aa0eb2752e3 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateCollection.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxCertificateCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CertificatesCreateOrUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_CreateOrUpdate.json + // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxCertificateResource + NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); + + // invoke the operation + string certificateName = "default"; + NginxCertificateData data = new NginxCertificateData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, certificateName, data); + NginxCertificateResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CertificatesGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json + // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxCertificateResource + NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); + + // invoke the operation + string certificateName = "default"; + NginxCertificateResource result = await collection.GetAsync(certificateName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CertificatesList() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_List.json + // this example is just showing the usage of "Certificates_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxCertificateResource + NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); + + // invoke the operation and iterate over the result + await foreach (NginxCertificateResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxCertificateData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CertificatesGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json + // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxCertificateResource + NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); + + // invoke the operation + string certificateName = "default"; + bool result = await collection.ExistsAsync(certificateName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CertificatesGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json + // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxCertificateResource + NginxCertificateCollection collection = nginxDeployment.GetNginxCertificates(); + + // invoke the operation + string certificateName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(certificateName); + NginxCertificateResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs new file mode 100644 index 000000000000..a38dd6b1eb46 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxCertificateResource.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxCertificateResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CertificatesGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json + // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxCertificateResource created on azure + // for more information of creating NginxCertificateResource, please refer to the document of NginxCertificateResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string certificateName = "default"; + ResourceIdentifier nginxCertificateResourceId = NginxCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, certificateName); + NginxCertificateResource nginxCertificate = client.GetNginxCertificateResource(nginxCertificateResourceId); + + // invoke the operation + NginxCertificateResource result = await nginxCertificate.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CertificatesDelete() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Delete.json + // this example is just showing the usage of "Certificates_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxCertificateResource created on azure + // for more information of creating NginxCertificateResource, please refer to the document of NginxCertificateResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string certificateName = "default"; + ResourceIdentifier nginxCertificateResourceId = NginxCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, certificateName); + NginxCertificateResource nginxCertificate = client.GetNginxCertificateResource(nginxCertificateResourceId); + + // invoke the operation + await nginxCertificate.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CertificatesCreateOrUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_CreateOrUpdate.json + // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxCertificateResource created on azure + // for more information of creating NginxCertificateResource, please refer to the document of NginxCertificateResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string certificateName = "default"; + ResourceIdentifier nginxCertificateResourceId = NginxCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, certificateName); + NginxCertificateResource nginxCertificate = client.GetNginxCertificateResource(nginxCertificateResourceId); + + // invoke the operation + NginxCertificateData data = new NginxCertificateData(); + ArmOperation lro = await nginxCertificate.UpdateAsync(WaitUntil.Completed, data); + NginxCertificateResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs new file mode 100644 index 000000000000..eab6e91e2b50 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationCollection.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Nginx.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxConfigurationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ConfigurationsCreateOrUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_CreateOrUpdate.json + // this example is just showing the usage of "Configurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxConfigurationResource + NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); + + // invoke the operation + string configurationName = "default"; + NginxConfigurationCreateOrUpdateContent content = new NginxConfigurationCreateOrUpdateContent(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configurationName, content); + NginxConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConfigurationsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json + // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxConfigurationResource + NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); + + // invoke the operation + string configurationName = "default"; + NginxConfigurationResource result = await collection.GetAsync(configurationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ConfigurationsList() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_List.json + // this example is just showing the usage of "Configurations_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxConfigurationResource + NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); + + // invoke the operation and iterate over the result + await foreach (NginxConfigurationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxConfigurationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ConfigurationsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json + // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxConfigurationResource + NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); + + // invoke the operation + string configurationName = "default"; + bool result = await collection.ExistsAsync(configurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ConfigurationsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json + // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxConfigurationResource + NginxConfigurationCollection collection = nginxDeployment.GetNginxConfigurations(); + + // invoke the operation + string configurationName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(configurationName); + NginxConfigurationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs new file mode 100644 index 000000000000..e5ad1878da39 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxConfigurationResource.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Nginx.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ConfigurationsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json + // this example is just showing the usage of "Configurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxConfigurationResource created on azure + // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string configurationName = "default"; + ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); + NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); + + // invoke the operation + NginxConfigurationResource result = await nginxConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ConfigurationsDelete() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Delete.json + // this example is just showing the usage of "Configurations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxConfigurationResource created on azure + // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string configurationName = "default"; + ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); + NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); + + // invoke the operation + await nginxConfiguration.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ConfigurationsCreateOrUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_CreateOrUpdate.json + // this example is just showing the usage of "Configurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxConfigurationResource created on azure + // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string configurationName = "default"; + ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); + NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); + + // invoke the operation + NginxConfigurationCreateOrUpdateContent content = new NginxConfigurationCreateOrUpdateContent(); + ArmOperation lro = await nginxConfiguration.UpdateAsync(WaitUntil.Completed, content); + NginxConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Analysis_ConfigurationsAnalysis() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Analysis.json + // this example is just showing the usage of "Configurations_Analysis" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxConfigurationResource created on azure + // for more information of creating NginxConfigurationResource, please refer to the document of NginxConfigurationResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string configurationName = "default"; + ResourceIdentifier nginxConfigurationResourceId = NginxConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, configurationName); + NginxConfigurationResource nginxConfiguration = client.GetNginxConfigurationResource(nginxConfigurationResourceId); + + // invoke the operation + NginxAnalysisResult result = await nginxConfiguration.AnalysisAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs new file mode 100644 index 000000000000..9381fb5929ce --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyCollection.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Nginx.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxDeploymentApiKeyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ApiKeysCreateOrUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_CreateOrUpdate.json + // this example is just showing the usage of "ApiKeys_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxDeploymentApiKeyResource + NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); + + // invoke the operation + string apiKeyName = "myApiKey"; + NginxDeploymentApiKeyCreateOrUpdateContent content = new NginxDeploymentApiKeyCreateOrUpdateContent(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, apiKeyName, content); + NginxDeploymentApiKeyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentApiKeyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ApiKeysGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json + // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxDeploymentApiKeyResource + NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); + + // invoke the operation + string apiKeyName = "myApiKey"; + NginxDeploymentApiKeyResource result = await collection.GetAsync(apiKeyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentApiKeyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ApiKeysList() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_List.json + // this example is just showing the usage of "ApiKeys_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxDeploymentApiKeyResource + NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); + + // invoke the operation and iterate over the result + await foreach (NginxDeploymentApiKeyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentApiKeyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ApiKeysGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json + // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxDeploymentApiKeyResource + NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); + + // invoke the operation + string apiKeyName = "myApiKey"; + bool result = await collection.ExistsAsync(apiKeyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ApiKeysGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json + // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // get the collection of this NginxDeploymentApiKeyResource + NginxDeploymentApiKeyCollection collection = nginxDeployment.GetNginxDeploymentApiKeys(); + + // invoke the operation + string apiKeyName = "myApiKey"; + NullableResponse response = await collection.GetIfExistsAsync(apiKeyName); + NginxDeploymentApiKeyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentApiKeyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs new file mode 100644 index 000000000000..83a79c4cce9e --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentApiKeyResource.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Nginx.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxDeploymentApiKeyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ApiKeysGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json + // this example is just showing the usage of "ApiKeys_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentApiKeyResource created on azure + // for more information of creating NginxDeploymentApiKeyResource, please refer to the document of NginxDeploymentApiKeyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string apiKeyName = "myApiKey"; + ResourceIdentifier nginxDeploymentApiKeyResourceId = NginxDeploymentApiKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + NginxDeploymentApiKeyResource nginxDeploymentApiKey = client.GetNginxDeploymentApiKeyResource(nginxDeploymentApiKeyResourceId); + + // invoke the operation + NginxDeploymentApiKeyResource result = await nginxDeploymentApiKey.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentApiKeyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ApiKeysDelete() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Delete.json + // this example is just showing the usage of "ApiKeys_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentApiKeyResource created on azure + // for more information of creating NginxDeploymentApiKeyResource, please refer to the document of NginxDeploymentApiKeyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string apiKeyName = "myApiKey"; + ResourceIdentifier nginxDeploymentApiKeyResourceId = NginxDeploymentApiKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + NginxDeploymentApiKeyResource nginxDeploymentApiKey = client.GetNginxDeploymentApiKeyResource(nginxDeploymentApiKeyResourceId); + + // invoke the operation + await nginxDeploymentApiKey.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ApiKeysCreateOrUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_CreateOrUpdate.json + // this example is just showing the usage of "ApiKeys_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentApiKeyResource created on azure + // for more information of creating NginxDeploymentApiKeyResource, please refer to the document of NginxDeploymentApiKeyResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + string apiKeyName = "myApiKey"; + ResourceIdentifier nginxDeploymentApiKeyResourceId = NginxDeploymentApiKeyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName, apiKeyName); + NginxDeploymentApiKeyResource nginxDeploymentApiKey = client.GetNginxDeploymentApiKeyResource(nginxDeploymentApiKeyResourceId); + + // invoke the operation + NginxDeploymentApiKeyCreateOrUpdateContent content = new NginxDeploymentApiKeyCreateOrUpdateContent(); + ArmOperation lro = await nginxDeploymentApiKey.UpdateAsync(WaitUntil.Completed, content); + NginxDeploymentApiKeyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentApiKeyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs new file mode 100644 index 000000000000..f8017738e6e4 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentCollection.cs @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxDeploymentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DeploymentsCreate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Create.json + // this example is just showing the usage of "Deployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + NginxDeploymentData data = new NginxDeploymentData(default); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + NginxDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DeploymentsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + NginxDeploymentResource result = await collection.GetAsync(deploymentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DeploymentsGetAutoScale() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + NginxDeploymentResource result = await collection.GetAsync(deploymentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DeploymentsListByResourceGroup() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_ListByResourceGroup.json + // this example is just showing the usage of "Deployments_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation and iterate over the result + await foreach (NginxDeploymentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DeploymentsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_DeploymentsGetAutoScale() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DeploymentsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + NginxDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_DeploymentsGetAutoScale() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this NginxDeploymentResource + NginxDeploymentCollection collection = resourceGroupResource.GetNginxDeployments(); + + // invoke the operation + string deploymentName = "myDeployment"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + NginxDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs new file mode 100644 index 000000000000..b2df491b0c83 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_NginxDeploymentResource.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Nginx.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_NginxDeploymentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DeploymentsGet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // invoke the operation + NginxDeploymentResource result = await nginxDeployment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_DeploymentsGetAutoScale() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get_AutoScale.json + // this example is just showing the usage of "Deployments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // invoke the operation + NginxDeploymentResource result = await nginxDeployment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeploymentsDelete() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Delete.json + // this example is just showing the usage of "Deployments_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // invoke the operation + await nginxDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DeploymentsUpdate() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Update.json + // this example is just showing the usage of "Deployments_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // invoke the operation + NginxDeploymentPatch patch = new NginxDeploymentPatch(); + ArmOperation lro = await nginxDeployment.UpdateAsync(WaitUntil.Completed, patch); + NginxDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_DeploymentsUpdateSubnet() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_UpdateSubnet.json + // this example is just showing the usage of "Deployments_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NginxDeploymentResource created on azure + // for more information of creating NginxDeploymentResource, please refer to the document of NginxDeploymentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string deploymentName = "myDeployment"; + ResourceIdentifier nginxDeploymentResourceId = NginxDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, deploymentName); + NginxDeploymentResource nginxDeployment = client.GetNginxDeploymentResource(nginxDeploymentResourceId); + + // invoke the operation + NginxDeploymentPatch patch = new NginxDeploymentPatch(); + ArmOperation lro = await nginxDeployment.UpdateAsync(WaitUntil.Completed, patch); + NginxDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..d267633d0a58 --- /dev/null +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Nginx.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetNginxDeployments_DeploymentsList() + { + // Generated from example definition: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_List.json + // this example is just showing the usage of "Deployments_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (NginxDeploymentResource item in subscriptionResource.GetNginxDeploymentsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NginxDeploymentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml index dd41ed1416c1..8a5d7f3c4ccf 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/nginx/Nginx.Management -commit: dcabb1a78c6b55eb4d1ce6e4f8d4eac5dc42c7c8 +commit: 8e03c7684307e54b1b21a779522e032dbd28f3b7 repo: Azure/azure-rest-api-specs emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json" From 2a66a368eb4d281ff964c6767cd3c7db1f539173 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 11:49:03 +0800 Subject: [PATCH 07/12] update --- .../Generated/Internal/ModelSerializationExtensions.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 d55a94253dd2..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,6 +10,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; +using System.Runtime.InteropServices; using System.Text.Json; namespace Azure.ResourceManager.Nginx @@ -254,5 +255,14 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo { writer.WriteObjectValue(value, options); } + + public static BinaryData GetUtf8Bytes(this JsonElement element) + { +#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 + } } } From 84d483c3e2a1a5fcfc2f25a66a58d05c9e299df5 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 11:56:24 +0800 Subject: [PATCH 08/12] update changelog --- sdk/nginx/Azure.ResourceManager.Nginx/CHANGELOG.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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) From 591d0e29e7f96f6617a6d6834865e0cc37e034c9 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 14:24:06 +0800 Subject: [PATCH 09/12] update --- .../tests/Scenario/NginxConfigurationResourceTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxConfigurationResourceTests.cs index f26b5b119243..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] From 6178cfbc9a58300d797ba1283c624f0946c227d9 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 14:55:51 +0800 Subject: [PATCH 10/12] update --- .../tests/Scenario/NginxCertificateResourceTests.cs | 1 - .../tests/Scenario/NginxDeploymentApiKeyResourceTests.cs | 1 - .../tests/Scenario/NginxDeploymentResourceTests.cs | 1 - 3 files changed, 3 deletions(-) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxCertificateResourceTests.cs index 68addecbd4e4..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] diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentApiKeyResourceTests.cs index ac19ce608463..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] diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs b/sdk/nginx/Azure.ResourceManager.Nginx/tests/Scenario/NginxDeploymentResourceTests.cs index 21eeab4ae11f..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] From f0f193785404629ae491b342f55754609b3b40e9 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 15:26:26 +0800 Subject: [PATCH 11/12] update --- sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml index 8a5d7f3c4ccf..ec16fe7a8d7c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml +++ b/sdk/nginx/Azure.ResourceManager.Nginx/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/nginx/Nginx.Management -commit: 8e03c7684307e54b1b21a779522e032dbd28f3b7 +commit: c5c49c665603a5408c5ebc2152e898566791d911 repo: Azure/azure-rest-api-specs emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json" From d376e648fc8958fe7cad7dc3aac9772fd07ad5fc Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Dec 2025 16:46:00 +0800 Subject: [PATCH 12/12] update --- .../api/Azure.ResourceManager.Nginx.net10.0.cs | 6 ++++-- .../api/Azure.ResourceManager.Nginx.net8.0.cs | 6 ++++-- .../api/Azure.ResourceManager.Nginx.netstandard2.0.cs | 6 ++++-- .../src/Custom/ArmNginxModelFactory.cs | 4 ++-- .../src/Custom/Models/NginxConfigurationFile.cs | 2 +- .../src/Custom/Models/NginxDeploymentProperties.cs | 3 ++- .../src/Custom/Models/NginxFrontendIPConfiguration.cs | 2 +- .../src/Custom/NginxConfigurationData.cs | 2 +- .../src/Custom/NginxDeploymentUpdateProperties.cs | 3 +++ 9 files changed, 22 insertions(+), 12 deletions(-) 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 index 27054ff4d70e..98c6cd76378e 100644 --- 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 @@ -344,13 +344,13 @@ public static partial class ArmNginxModelFactory 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, string skuName) { 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) { 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; } @@ -691,6 +691,7 @@ public NginxDeploymentProperties() { } 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 { } } @@ -741,6 +742,7 @@ 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 { } } 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 27054ff4d70e..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 @@ -344,13 +344,13 @@ public static partial class ArmNginxModelFactory 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, string skuName) { 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) { 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; } @@ -691,6 +691,7 @@ public NginxDeploymentProperties() { } 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 { } } @@ -741,6 +742,7 @@ 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 { } } 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 27054ff4d70e..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 @@ -344,13 +344,13 @@ public static partial class ArmNginxModelFactory 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, string skuName) { 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) { 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; } @@ -691,6 +691,7 @@ public NginxDeploymentProperties() { } 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 { } } @@ -741,6 +742,7 @@ 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 { } } diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs index 0e6dec02d217..3feab50fd274 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/ArmNginxModelFactory.cs @@ -39,7 +39,7 @@ public static NginxConfigurationData NginxConfigurationData(ResourceIdentifier i /// /// /// 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, string skuName) + 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 . @@ -62,7 +62,7 @@ public static NginxCertificateProperties NginxCertificateProperties(NginxProvisi /// /// /// 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) + 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 index 0aa245723b5f..7a673f91e37f 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxConfigurationFile.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxConfigurationFile.cs @@ -10,6 +10,6 @@ namespace Azure.ResourceManager.Nginx.Models public partial class NginxConfigurationFile { /// Gets or sets the Content. - public string ContentHash { get; set; } + 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 index 48c24d4444a9..6750dd2d2de6 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxDeploymentProperties.cs @@ -12,9 +12,10 @@ public partial class NginxDeploymentProperties { /// The managed resource group to deploy VNet injection related network resources. [EditorBrowsable(EditorBrowsableState.Never)] - public string ManagedResourceGroup { get; set; } + 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; diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs index 8f544a1cd29d..a55f59510b6c 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/Models/NginxFrontendIPConfiguration.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.Nginx.Models { /// Nginx Frontend IP Configuration. - [Microsoft.TypeSpec.Generator.Customizations.CodeGenSerialization(nameof(PublicIPAddresses), DeserializationValueHook = nameof(DeserializePublicIPAddresses))] + [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) diff --git a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs index 367a616b9d6f..208c38476292 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxConfigurationData.cs @@ -14,6 +14,6 @@ public partial class NginxConfigurationData : ResourceData { /// Gets or sets the location. [EditorBrowsable(EditorBrowsableState.Never)] - public AzureLocation? Location { get; set; } + 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/NginxDeploymentUpdateProperties.cs b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs index 716863790bae..6b2ecca96df4 100644 --- a/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs +++ b/sdk/nginx/Azure.ResourceManager.Nginx/src/Custom/NginxDeploymentUpdateProperties.cs @@ -3,12 +3,15 @@ #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;